andrew_zx 发表于 2006-6-2 21:13:25

用sock录制,data.ws中的数据怎么做关联?

用sock录制,data.ws中的数据怎么做关联?

andrew_zx 发表于 2006-6-3 15:06:49

ding

Zee 发表于 2006-6-3 19:39:27

找到数据关系就是了。步骤一样的

andrew_zx 发表于 2006-6-5 10:15:33

那么那些函数(web_reg_save_param.......)写在哪里?

action里面还是 data.ws里面???

谢谢

yuxingxin 发表于 2006-6-5 10:17:16

当然是action中。

thefirstred 发表于 2006-6-5 10:50:14

不能用web_reg_save_param函数,socks脚本有自己的函数

andrew_zx 发表于 2006-6-5 11:15:17

data.ws中我要换的是    282888a80b7048b0010b70e1b44b0014

sendbuf137 289
        "<body rid='765740' sid='282888a80b7048b0010b70e1b44b0014' xmlns='http://ja"
        "bber.org/protocol/httpbind' key='1541120fac8eec02e7e525f03c816280aebdab43'"
        " ><iq type=\"get\" id=\"auth1\"><query xmlns=\"jabber:iq:auth\"><username>"
        "~200127.03.eb15accc6fc720060602172941176</username></query></iq>\r\n"
        "</body>"


Action中是这段

    lrs_send("socket1", "buf137", LrsLastArg);
-----------------------------------------------------------------------

谢谢拉

到底要用什么函数?写在Action的哪里啊?

Zee 发表于 2006-6-5 11:56:11

看看一个例子。

For example, lets say you have to capture the PID from the following receive buffer (This is
an example from LR function reference):
"\r"
"\x0 blah blah blah "
"\r\n blah blah blah "
"PID TT STAT TIME COMMAND\r\n PID 28469 q2"
" S 0:01 -tcsh (tcsh)\r\n"
……
In a typical web script, you would use a web_create_html_param and use “PID “ and “ q2” as
the boundaries to capture the data.
In a Winsock script, you would use lrs_save_param that saves data from a static or received
buffer to a parameter. See the example below:
lrs_receive("socket2", "buf47", LrsLastArg);
lrs_save_param("socket2", NULL, "param1", 67, 5);
Unlike web_create_html_param, lrs_save_param goes after the request is made. In
this example, the first statement is receiving buf47. The following are the arguments
used in the lrs_save_param statement:
socket2: Capture from a buffer on socket2
NULL: NULL indicates that the parameter should be captured from the last received buffer. In
this case it is buf47. If you were to capture from any other buffer, you will have to specify the
buffer number.
param1: Name of the LR parameter in which to staore the captured value
67: Offset – explained below.
5: length of the to be captured
Offset: This is the number of bytes from the beginning of the buffer to start capturing. In the
above example, the PID starts after 67 bytes from the beginning of buf47. How do you
determine this?
Highlight the whole buffer in data.ws that contains the parameter to be captured and hit F7.
This will bring up a window as shown below:
In the left column, you will see the offset that corresponds to that line. In the middle 4
columns, you see the EBCDIC translation of the buffer. And in the right column, you have the
actual buffer itself. So if you look at the fifth line in the actual buffer, that is where you PID
lies. But we want to start capturing after the third location in that line. The offset for that
entire line is 64, and the offset for the PID within that line is 3, which makes the offset 67.
(Now does that explain why I had to add all those blah blah blahs in the buffer to make it
match my example? J)

andrew_zx 发表于 2006-6-5 13:09:14

我的receive buffer 里面没有这个sessionid(282888a80b7048b0010b70e1b44b0014
)字符串

Zee 发表于 2006-6-5 13:12:59

原帖由 andrew_zx 于 2006-6-5 13:09 发表
我的receive buffer 里面没有这个sessionid(282888a80b7048b0010b70e1b44b0014
)字符串
我说了是个例子,你不能照搬嘛,你要看你自己的里面的相应的变量。

andrew_zx 发表于 2006-6-5 13:25:06

现在重点是,我不知道sessionid从哪里取的,再放到send的那些函数里,现在录制下来的data.ws里只有send数据包里有sessionid

andrew_zx 发表于 2006-6-5 17:21:52

大家帮帮忙啊

谢谢了

andrew_zx 发表于 2006-6-6 09:35:34

help

yuxingxin 发表于 2006-6-6 13:52:29

你都不知道那个session是从哪儿来的,别人怎么会知道?
除非这儿有人是上帝。

leey 发表于 2006-6-7 16:34:07

手工关联
手工添加函数,把最后收到的buffer保存到字符串数组,然后取出你要的,然后指定要发出的buffer。

yxd2006 发表于 2012-6-10 16:35:19

关注中……
页: [1]
查看完整版本: 用sock录制,data.ws中的数据怎么做关联?