【发布时间】:2018-08-12 00:46:21
【问题描述】:
我想知道如何手动执行附加应用程序中存在的功能?我到处搜索,找不到任何有用的词。在 IDA Pro 中它被称为 appCall 那么它与 olly 的等价物是什么?
【问题讨论】:
标签: ollydbg
我想知道如何手动执行附加应用程序中存在的功能?我到处搜索,找不到任何有用的词。在 IDA Pro 中它被称为 appCall 那么它与 olly 的等价物是什么?
【问题讨论】:
标签: ollydbg
手动调用任何函数都相当于将函数调用就地组装
假设你在 ollydbg 下运行 calc.exe
内部函数 SetBox(,) 在科学模式下设置 inv 和 hyp 复选框中的复选标记
== CheckBox 的 Id 并且您已确定 Id 为 0x8c 和 0x8d
您还确定此函数是 __stdcall
假设你想手动调用这个函数,并且想要设置 id 为 0x8c 的复选框,你需要做的就是找到一个地方并组装以下序列并执行它们
push 1
push 0x8c
call calc.SetBox
当你这样做时,你需要注意的是不要破坏堆栈,当你完成执行 sn -p 后返回到你最初转移的地方
ollydbg.exe calc.exe ->f9 运行 exe,然后 f12 暂停 注意 ollydbg 暂停的地址(对于 xpsp3,它将是 ntdll!KiFastSystemCallRet())
现在找到一个代码洞穴组装在此处使用新原点传输eip到新组装的代码执行sn-p完成后选择原始暂停地址(对于xpsp3 ntdll!kiFastSystemCallRet())和reset eip back to that address with new origin here and f9 to run the exe you will notice you have set the check mark without click the checkbox :)
有时我要么手动执行(f12 书签 eip 向下滚动到空白空间,然后通过书签执行并返回)
或使用脚本并使用 ODBGSCRIPT 运行它
当您使用下面的 f12 暂停 ollydbg 时,上述场景的脚本(计算复选框)
编辑注释脚本并添加一个 malloc 来摆脱洞穴搜索的琐事
var myret ;variable
var cave ;variable
var mem ;variable
mov myret , eip ;save current eip
alloc 1000 ;allocate memory (no need to search for code caves
mov mem, $RESULT ;save for freeing the allocated memory
mov cave,$RESULT ;mov newly allocated space to var cave
mov eip , cave ;detour current eip to cave
asm cave, "push 01" ;assemble instruction (pop all push dont corrupt stack)
add cave,$RESULT ;lenght added to find next address for assembling
asm cave, "push 08c" ;assemble next instruction
add cave,$RESULT ;len of previous instruction added to current address
asm cave, "call calc.SetBox" ; assemble call
step ; we assembled 3 instructions lets step thrice
step ;
step ;
mov eip , myret ;restore saved eip
free mem,1000 ;free
go ;run the binary to notice the check box ticked
【讨论】:
Ollydbg 中的应用程序没有内置的方法来执行此操作。您可能需要编写一个插件来执行此操作。
但是,如果您的目标是 DLL 中的导出函数,您可以使用 Ollydbg 中的“调用 DLL 导出”功能。使用“调用导出”功能,您可以使用参数调用导出的函数,如下面的屏幕截图所示。
【讨论】: