|
堆栈数据如何修改
程序由于特殊的原因不能上传,但希望得到各位朋友的帮助 |
|
堆栈数据如何修改
各位朋友,你们好! 我下面的问题走过百度、方过谷哥、踏过众多win32汇编QQ群 同时也在看雪里发过贴子,但问题始终没人能解决。得到的结果如下,一回答不具体,只说其一,不说其二,就好知道什么说什么(当然这也许是出于热心的原帮) 二、回答不够专业(用其他语言来解决,这当然不行,因为我只会win32汇编) 三、都不愿意一直回答下去(可以是太忙了吧) 但最后还是将希望寄托在看雪 我的问题如下: 用OD加载某A程序、运行,且我在0040E1D2处下断(有朋友就问为什么要在那下断)为此我把图给各位看,一看到inet_addr就知道为什么要在那下断了。 0040E1C0 |. 51 push ecx ; /NetShort 0040E1C1 |. 894424 14 mov dword ptr [esp+14], eax ; | 0040E1C5 |. 66:C74424 08 >mov word ptr [esp+8], 2 ; | 0040E1CC |. FF15 B4E54300 call dword ptr [<&WS2_32.#9>] ; \ntohs 0040E1D2 |. 8B5424 1C mov edx, dword ptr [esp+1C]0040E1D6 |. 52 push edx ; /pAddr 0040E1D7 |. 66:894424 0A mov word ptr [esp+A], ax ; | 0040E1DC |. FF15 B8E54300 call dword ptr [<&WS2_32.#11>] ; \inet_addr 从反汇编上看,为了给inet_addr函数压入参数 先是用了一个 0040E1D2 |. 8B5424 1C mov edx, dword ptr [esp+1C] 然后再push edx 现在的问题是 0040E1D2 |. 8B5424 1C mov edx, dword ptr [esp+1C] 中esp+1C所向的IP地址为192.168.1.200 可以从堆栈窗口中看出,但这个值不符合要求 Stack ss:[0012EBC4]=0012F018, (ASCII "192.168.1.200") edx=00000038 我需要的是192.168.1.有朋友马上就说,你可以直接在程序的堆栈窗口中修改一下不就行了吗 是的,我们可以动态修改,有朋友还说,你还可以从内存窗口中修改,我的回答是,可以 但这些都不是彻底解决问题的办法 在我认为,最彻底的办法是,如果我能在目标进程一开始的地方(从代码的脚度看) 定义常量的地方,定义这么一个szIP='192.168.1.1' 而上面需要压入的参数直接用push 我们szIP的地址,这不就行了吗,想法很大胆,也很天真,很多高手会笑话我,哪有那么容易,我知道这是不可能的 但是我们也会有办法吗,用一个进程来打开它,控制它,然后在他里面申请一块内存,放入我们上面的值,同时用WriteProcessMemory修改那个位置的代码,这不就行了吗 是的如果能这样做当然行 为此有的朋友就说你用DLL注入啊,用CreateProcess+WriteProcessMemory以及 VirtualProtectEx配合啊。 可是,我要说的是可是 包括我在内的很多朋友都知道这样的思路,但做起来就不一样啊 希望热心的朋友能给出段代码(限win32汇编的代码,其它语言实现起来有可能很简单) 且有解决问题的明确思路 在此,先谢过 我第三次在看雪上发贴,第一次时不知道直接填了100Kx后来才知道后悔了 现在我没有Kx了......................... 难过中 |
|
堆栈数据如何修改
多谢这位兄弟的热心支持 这么多回答中,你的回答我比较满意,因为我想要的就是你要说的 最后补充一点 不能跳过inet_addr因为程序需要用到它来连服务器 另,一万分的真诚求你的QQ号,或手机号,我想直接问一问,谢谢 |
|
堆栈数据如何修改
感谢各位的热心帮助,我想还是我的问题没有表达清楚 首先函数VirtualProtectEx函数我明白他的意思,就是修改目标进程指定内存页的属性 现在的关键问题不是这些 关键问题是 一、我上面提到的0040E1D2这个地址是在OD里面看到的代码段 而他上面的语句是 mov edx, dword ptr [esp+1C] push edx 它要实际的是给函数inet_addr压入所需参数,由于esp+1C指向的是堆栈段数据 我无法修改为此,我才要编写一个程序来启动这个程序,以达到控制这个程序的目的 那么,问题出来了,你不可能在目标进程中定义常量szIP='192.168.1.1' 只能在自己进程中定义,然后通过在目标进程中临时申请一块内存,再将我上面的常量放进去 此时在修改0040E1D2处的代码push 00140000(0014000是申请到目标进程的地址),这样,目标进程才能访问自己进程内的数据。 而不是只是修改内存属性,再者,修改代码段的属性还是修改数据段的属性呢?这是一问 从上面004E1D2 看得出是代码段地址,要修改这个地方,直接用createprocess与writeProcessMemory来修改就行了,不费事,关键是我们的常量szIP目标进程要能访问 谢谢 |
|
堆栈数据如何修改
感谢enthos的热心帮助,我想还是我的问题没有表达清楚 首先函数VirtualProtectEx函数我明白他的意思,就是修改目标进程指定内存页的属性 现在的关键问题不是这些 关键问题是 一、我上面提到的0040E1D2这个地址是在OD里面看到的代码段 而他上面的语句是 mov edx, dword ptr [esp+1C] push edx 它要实际的是给函数inet_addr压入所需参数,由于esp+1C指向的是堆栈段数据 我无法修改为此,我才要编写一个程序来启动这个程序,以达到控制这个程序的目的 那么,问题出来了,你不可能在目标进程中定义常量szIP='192.168.1.1' 只能在自己进程中定义,然后通过在目标进程中临时申请一块内存,再将我上面的常量放进去 此时在修改0040E1D2处的代码push 00140000(0014000是申请到目标进程的地址),这样,目标进程才能访问自己进程内的数据。 而不是只是修改内存属性,再者,修改代码段的属性还是修改数据段的属性呢?这是一问 从上面004E1D2 看得出是代码段地址,要修改这个地方,直接用createprocess与writeProcessMemory来修改就行了,不费事,关键是我们的常量szIP目标进程要能访问 谢谢 |
|
如何动态修改程序的参数
我不太明白楼主为什么说要用到VirtualProtectEx这个函数 这是个修改指定内存为可读写的函数 我现在要做的是 mov edx, dword ptr [esp+1C] push edx 这两句改成我想要压入的数据比如push 00140000,但00140000处的数据为零,我需要的数据是一个IP地址 如192.168.1.200 |
|
|
|
|
|
加密解密第三版PDF
首先得声明,不要因为我的意见和你的不统一而删除贴子 否则非君子所为 我认为网络的出现,特别有了电子版后,散发在所难免,如果每一样都要讲侵权的话那中国的软件市场根本没有今天的长足发展,就拿微软来说,国家政府官员都已出面为维护广大中国人的利益而说话,更何况国内的技术呢,至少我支持一楼的共享精神,网络的根本就是共享。 特留此贴,望不要使用特权, |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值