以内存地址作为参数执行远程函数
我正在尝试在正在运行的(旧)Win32 Borland 应用程序(窗口具有 OLW_WINDOW 类)中执行函数。通过使用 OllyDbg,我发现该函数有一个参数,即内存地址。函数使用的一个变量/值存储在该地址的偏移量处。我的想法是找到该内存地址(位于内存块中的恒定偏移量),将变量/值更改为我想要的,然后执行该函数。使用WriteProcessMemory和CreateRemoteThread来执行是可以的,但问题是如何找到内存地址/块?当在 OllyDbg 中打开“内存映射”时,内存块没有所有者、部分或包含。是否可以获取指定线程创建的内存块列表?或者我可以通过某种方式从应用程序中获取它吗?顺便说一句:该函数通常在单击按钮时执行,并且我要设置的变量/值是列表视图(或等效视图)中列出(按名称)的数据库 ID。
I'm trying to execute a function in a running (old) Win32 Borland application (Window has class OLW_WINDOW). By using OllyDbg I've found out that the function has one parameter which is a memory address. One variable/value used by the function is stored at an offset of that address. My idea is to find that memory address (which is at an constant offset in a memory block), change the variable/value to what I want and then execute the function. To use WriteProcessMemory and CreateRemoteThread to execute is okey, but the problem is how to find the memory address/block? When opening "Memory map" in OllyDbg the memory block has no owner, section or contains. Is it possible to get a list of memory blocks created by a specified thread? Or could I get it from the application somehow? Btw: the function is normally executed when a button is clicked and the variable/value I want to set is a database ID listed (by name) in a listview (or equivalent).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的办法就是调用该函数。
这里的一个例子是一个将输出打印到控制台的函数:
要调用它,我们将在目标二进制文件中找到该函数的地址。假设它是在 0xDEADC0DE 处找到的。
我们将为函数指针形成一个 typedef:
我们将创建该函数指针类型的实例
要调用该函数,我们只需执行以下操作:
同样,对于您的项目,您将输入所需的任何参数。
The best thing to do is just call the function.
As an example here is a function which prints output to a console:
To call it, we would find the address of this function in the target binary. Let's say it's found at 0xDEADC0DE.
We would form a typedef for a function pointer:
We would create an instance of that function pointer type
To call the function we would simply do:
Likewise for your project, you would input whatever argument you required.