首页
社区
课程
招聘
[求助]x64dbg表达式函数,求个正确实例
2020-6-29 08:15 4685

[求助]x64dbg表达式函数,求个正确实例

2020-6-29 08:15
4685

ReadByte,Byte,byte(addr):从 addr 读取一个字节,并返回该值。

ReadWord,Word,word(addr):从 addr 读取一个字(2字节),并返回该值。

ReadDword,Dword,dword(addr):从 addr 读取双字(4字节),并返回该值。

ReadQword,Qword,qword(addr):从 addr 读取四字(8字节),并返回该值(仅用于x64)。

ReadPtr,ReadPointer,ptr,Pointer,pointer(addr):从 addr 读取一个指针(4/8 字节),并返回该值。


不知道 以上内容如何去模仿? 



[CTF入门培训]顶尖高校博士及硕士团队亲授《30小时教你玩转CTF》,视频+靶场+题目!助力进入CTF世界

收藏
点赞2
打赏
分享
最新回复 (12)
雪    币: 4255
活跃值: (8410)
能力值: ( LV9,RANK:181 )
在线值:
发帖
回帖
粉丝
nevinhappy 2 2020-6-29 09:23
2
1

这个文档挺反人类的,看到上面的格式,可能以为应该是:

ReadByte, Byte, byte(EIP)

但是执行会给报错,其实它是说:ReadByte(addr), Byte(addr), byte(addr),这三个函数都能从地址addr读一个byte:


下面的几个函数同理。


最后于 2020-6-29 09:23 被nevinhappy编辑 ,原因:
雪    币: 4357
活跃值: (2176)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
whitehack 2020-6-29 09:51
3
0
学到一招
雪    币: 32108
活跃值: (7105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ninebell 2020-6-29 11:22
4
0
nevinhappy 这个文档挺反人类的,看到上面的格式,可能以为应该是:ReadByte, Byte, byte(EIP)但是执行会给报错,其实它是说:ReadByte(addr), Byte(addr), byte(a ...
原来是这样,又助我扫了一颗雷。谢谢。
而且这个帮助做的太可恶,有的地方该(有地址)它却不加。
最可恶的是该帮助有不少地方你不能复制出来直接测试,最后发现用Opera复制,比如表达式函数模块这一小节
雪    币: 9934
活跃值: (2554)
能力值: ( LV6,RANK:87 )
在线值:
发帖
回帖
粉丝
Lixinist 1 2020-6-29 11:35
5
0
1:[addr],2:[addr],4:[addr]。
可以看看我以前发的x64dbg脚本,也许能有点用
雪    币: 32108
活跃值: (7105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ninebell 2020-6-29 15:10
6
0
@Lixinist  @nevinhappy
还有下面的地方不解,折腾不出所以然来

Complex Type
{mem;size@address} will print the size bytes starting at address in hex.

{winerror@code} will print the name of windows error code(returned with GetLastError()) and the description of it(with FormatMessage). It is similar to ErrLookup utility.

{ntstatus@code} will print the name of NTSTATUS error code and the description of it(with FormatMessage).
雪    币: 4255
活跃值: (8410)
能力值: ( LV9,RANK:181 )
在线值:
发帖
回帖
粉丝
nevinhappy 2 2020-6-29 16:31
7
0
ninebell @Lixinist  @nevinhappy 还有下面的地方不解,折腾不出所以然来 Complex Type {mem;size@address} will print the size b ...

我在(https://bbs.pediy.com/thread-254746.htm) 这个里的脚本中最后包含了例子!

看了这些奔溃的文档,https://help.x64dbg.com/en/latest/introduction/Formatting.html?highlight=will%20print%20the%20size%20bytes%20starting%20at%20address%20in%20hex.

这个奔溃的页面本来是没有Example的,是我给他们提了才加了,本来要我自己到github去加!果断放弃这个坑,Python它不香么!

最后于 2020-6-29 16:44 被nevinhappy编辑 ,原因:
雪    币: 32108
活跃值: (7105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ninebell 2020-7-2 08:23
8
0

@nevinhappy


问题是这样的:

我发现有两条命令很有意思:一条是TraceIntoConditional/ticnd ,另一条是 TraceOverConditional/tocnd

于是我做了一些试验: 

用point-h crackme.exe 这个程序来搞的。

帮助中是这样写的:

TraceIntoConditional/ticnd 

通过StepInto(F7)跟踪程序,直到满足指定条件或达到最大步数。

参数1 使用条件: 当计算为0以外的值时, 跟踪将停止

参数2 在调试器放弃之前跟踪的最大步数

逐步跟踪10000次程序,当eax=79时,断下

ticnd eax==79,10000 结果我们成功了!的确比OD更强大,而不必设置具体的地址!但有做了下面的试验

ticnd ESP==&"cuicui",10000    成功了!但转天无论如何又不成功了。


于是我又换了个软件叫MageBros

当前 esp==19fc14 ,字符串为 &"MB-3186-2945"

于是我搞了个分解动作:

msg {s:esp}                             ; 弹出&"MB-3186-2945"

msg &"MB-3186-2945"         ; 弹出&"MB-3186-2945",说明表达式直接这样写也对,不用加{}


于是我到 【步过直到满足条件】 对话框这样设置:

第一行:{s:esp}==&"MB-3186-2945"     ,行进步数10000

等价于tocnd {s:esp}==&"MB-3186-2945",100000


于是又只前进了一步就停止了,实在不解,难道字符串比较就不行呢?

看过 https://www.52pojie.cn/thread-1042228-1-1.html这个贴子 

https://bbs.pediy.com/thread-251385.htm这个贴子 


参数1 使用条件: 当计算为0以外的值时, 跟踪将停止,我尝试写成 !=也是只走了一步就停止了。

研究了两天,大部分命令都会了。进行文本比较咋就不成功呢?

最后于 2020-7-2 08:25 被ninebell编辑 ,原因:
雪    币: 4255
活跃值: (8410)
能力值: ( LV9,RANK:181 )
在线值:
发帖
回帖
粉丝
nevinhappy 2 2020-7-2 08:54
9
0

没试过,不过我找一下:

https://github.com/x64dbg/x64dbg/issues/1485

https://github.com/x64dbg/x64dbg/issues/2067

目测开发者说不支持!

最后于 2020-7-2 08:56 被nevinhappy编辑 ,原因:
雪    币: 32108
活跃值: (7105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ninebell 2020-7-2 09:00
10
0
nevinhappy 没试过,不过我找一下:https://github.com/x64dbg/x64dbg/issues/1485https://github.com/x64dbg/x64dbg/issues/2067目 ...
感谢回复,懂了,原来是不支持啊。狂晕中。。。
看了下 Scriptw 这脚本工具
需要if 循环 执行。。。抵达目标位置来模仿。。。
雪    币: 32108
活跃值: (7105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ninebell 2020-7-2 09:57
11
0
解决办法1:
就是使用Scriptw 【脚本编辑器插件】,这样你就拥有了标签,if判断,有了这几个的支持,你就有了小型的循环结构;以上问题解决起来就不是个问题了。

解决办法2,使用看门狗 来解决。
AddWatchAdd a watch item.
argumentsarg1 The expression to watch.[arg2] The data type of the watch item. uint displays hexadecimal value, int displays signed decimal value, ascii displays the ASCII string pointed by the value. unicode displays the Unicode string pointed by the value. uint is the default type.


解决办法3:https://github.com/pastaoficial/cndsteroids 使用字符串比较插件解决 ,晕死,今天才知道这东西原来是为了排这颗雷的。
雪    币: 32108
活跃值: (7105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ninebell 2020-7-4 21:16
12
0
@nevinhappy 还有个问题,拜托给我看看,谢谢。https://bbs.pediy.com/thread-260465.htm
雪    币: 32108
活跃值: (7105)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
ninebell 2020-7-5 19:05
13
0
setstring 8888, "MeiMei"                                              // 在第一次发现的地方起作用了,显示的地方还是不可读取字样!
addwatch "CmpStr([esp] , $ansi, .8888)",ascii               //凑合有效果了
游客
登录 | 注册 方可回帖
返回