我有一个程序可以激活赛车结果芯片。(这只是一块硬件)。
当我把芯片和我的电脑连接起来时,我用Fiddler (嗅探程序)观察我的pc机的输入和输出流量。
程序发送以下HTTP请求:
POST http://example.com/index.php HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Content-Length: 185
Content-Type: application/x-www-form-urlencoded
Host: example.com
Pragma: no-cache
User-Agent: SomeProgram 1.2.3
Data==%0D%0AAjlFNEEw-SOMELONGSECRETKEY-RGAw%3D%3D%0D%0A我收到以下答复:
<?xml version="1.0" encoding="utf-8"?>
<message type="3" result="1" txid="someid" activationdate="" availablecredits="732" firstname="John" lastname="Doe" email="JohnDoe@outlook.com" phonenumber="00123445" notification_email="1" notification_text="1"/>是否可以编辑响应,以便当程序检查availablecredits变量时,他得到的值是9999而不是732。
我在Windows 8笔记本电脑上工作。
发布于 2015-04-25 20:52:42
当然- Fiddler允许您通过modify requests and responses adding rules to FiddlerScript。引用Fiddler文件:
要对web请求和响应进行自定义更改,请使用FiddlerScript向Fiddler的OnBeforeRequest或OnBeforeResponse函数添加规则。哪个函数合适取决于代码使用的对象:在每个请求之前调用OnBeforeRequest,在每个响应之前调用OnBeforeResponse。
因此,您所要做的就是向OnBeforeResponse添加一个逻辑,将availablecredits属性值替换为您想要的任何值。
https://stackoverflow.com/questions/29869825
复制相似问题