|
[求助]高难度汇编代码
随便写一段 .386 .model flat,stdcall option casemap:none include WINDOWS.INC include kernel32.inc include user32.inc include wininet.inc includelib kernel32.lib includelib user32.lib includelib wininet.lib .data szAgent db "MyAgent",0 szURL db "http://www.somewhere.com/somepath/somefile.dat",0 hInternet dd 0 hInternetFile dd 0 dwContent dd 0 szOK db "ok",0 szErr db "error",0 szNull db 0,0,0,0 dwBytesRead dd 0 .data? buffer db 256 dup (?) .code start: invoke InternetOpen, offset szAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 mov hInternet, eax test eax, eax jz Error invoke InternetOpenUrl, hInternet, offset szURL, NULL, 0, INTERNET_FLAG_RELOAD, 0 mov hInternetFile, eax test eax, eax jz Error invoke InternetReadFile, hInternetFile, offset buffer, 255, offset dwBytesRead invoke InternetCloseHandle, hInternetFile invoke InternetCloseHandle, hInternet invoke MessageBox, NULL,offset buffer,offset szOK, MB_OK jmp Exit Error: invoke MessageBox, NULL,offset szErr, offset szErr, MB_OK or MB_ICONERROR Exit: invoke ExitProcess,0 end start |
|
|
|
[求助]高难度汇编代码
暂时想到3种办法 1. Socket编程,功能强大,内容丰富 2. Wininet编程,简单方便 3. 直接用URLDownloadToFile或者类似的函数,就一行代码,够简单了吧?不过一般都会被当木马杀掉。 无论哪一种,网上资料都一片一片的。 |
|
|
|
|
|
[求助]请问怎么知道某个函数(CALL)来自那个程序文件
Alt+K或者点工具栏里面的K |
|
动态修改DLL重定位表某处的值
不客气,我也学到了不少东西。 |
|
|
|
动态修改DLL重定位表某处的值
你说的方法我也试了,还拿刚才的例子说吧,我把MessageBoxA的RVA改回原始的000407EA。 用OD载入user32.dll,停在入口点 0087B217 > $ 8BFF mov edi, edi 0087B219 . 55 push ebp 0087B21A . 8BEC mov ebp, esp 0087B21C . 837D 0C 01 cmp dword ptr [ebp+C], 1 0087B220 . 75 05 jnz short 0087B227 0087B222 . E8 5D070000 call 0087B984 0087B227 > 5D pop ebp 前3条指令正好5个字节,改成jmp到空白地方,如下 0087B217 > $ /E9 A4500500 jmp 008D02C0 0087B21C . |837D 0C 01 cmp dword ptr [ebp+C], 1 0087B220 . |75 05 jnz short 0087B227 0087B222 > |E8 5D070000 call 0087B984 0087B227 > |5D pop ebp 来到空白地方 008D02C0 > \8BFF mov edi, edi ; 恢复原始入口的3条指令 008D02C2 . 55 push ebp ; 008D02C3 . 8BEC mov ebp, esp ; 008D02C5 . 60 pushad 008D02C6 . E8 00000000 call 008D02CB ; 将下一条指令地址压入堆栈 008D02CB $ 58 pop eax ; 让eax等于此指令地址 008D02CC . 2D 33C20500 sub eax, 5C233 ; 让eax指向原MessageBoxA RVA 000407EA 008D02D1 . C700 90020600 mov dword ptr [eax], 60290 ; 修改成新的RVA 00060290 008D02D7 . 61 popad 008D02D8 .^ E9 45AFFAFF jmp 0087B222 ; 返回原dll入口第4条指令 其中 008D02CC . 2D 33C20500 sub eax, 5C233 这句是因为当前 eax=008D02CB,而存放MessageBoxA RVA的地址在00874098,所以减去偏移量0005C233。修改好了保存dll。从OD的内存列表可以看出,这里00874098是属于.text段,所以要用LordPE把.text段属性改成可写,不然dll载入会出错。最后修正Checksum就能用了,效果和前面改MessageBoxA地址是一样的。 |
|
[求助]占用内存的问题
是不是占用了Virtual Memory啊?在任务管理器里面View > Select Columns... 把Memory Usage Virtualmemory Size都选上看看。 |
|
[求助]16进制查找指定字节位置,请大家帮帮忙
sizeof(searchpbyte) 是不是永远等于4啊? |
|
[求助]字串長度問題,能解決嗎?
可以用Delphi工具修改吧?不知道DeDe可不可以。或者用ResHacker修改RCData>TForm1数据。 |
|
动态修改DLL重定位表某处的值
今天自己学着改了一下dll,也许对楼主有帮助,我不是编程改的函数地址,直接用LordPE修改的。修改user32.dll的MessageBoxA,让HelloWorld12345变成HelloKitty12345。 图-------0 程序中其中LoadLibrary主要是为了载入D盘下的user32.dll而不是系统目录下的user32.dll,因为是自己写的程序,知道HelloWorld12345可以修改,不然如果内存不可写的话会出错。 .386 .model flat, stdcall option casemap:none include WINDOWS.INC ;include user32.inc include kernel32.inc ;includelib user32.lib includelib kernel32.lib .data szMsg db "HelloWorld12345",0 szUser32 db "D:/user32.dll",0 szMsgBoxA db "MessageBoxA",0 .data? hUser32 dd ? hMsgBoxA dd ? .code start: invoke LoadLibrary,offset szUser32 mov hUser32,eax invoke GetProcAddress,hUser32,offset szMsgBoxA mov hMsgBoxA,eax ;invoke MessageBox, NULL, offset szMsg, 0, MB_OK push MB_OK push offset szMsg push offset szMsg push NULL call hMsgBoxA invoke ExitProcess, NULL end start 把user32.dll从系统目录下面复制一份到D盘,下面所有的操作都在这个D盘上的user32.dll上面改。 用PEiD打开user32.dll,看到入口点RVA是0000B217。 图-------1 来看看都有哪些Section (点EP Section右边的> ),在.text段上面点右键,选Cave Finder 图-------2 图-------3 .text 段在0006028A地方有空间,还有000000176字节,够用了。用OD载入user32.dll,停在入口点0087B217。 基地址=0087B217-0B217=00870000 图-------4 在命令行里打入 d 00870000+6028A 来到我们刚才找到的空位。 图-------5 找个好地方,干脆就从008D0290开始写我们的代码吧。在反汇编窗口写比较方便,用 d MessageBoxA 可以看到原来 MessageBoxA函数的地址 图-------6 写好了之后就收工吧,选Copy to executable > All Modifications > Copy All > Save File,换个名字 myuser32.dll。 图-------7 图-------8 myuser32.dll现在还不能用,代码虽然写到里面了,但是还要改映射到内存的大小和MessageBoxA的RVA。用LordPE改吧。载入myuser32.dll,选Section,把VSize从0005F283改成0005F2C0,因为我们的代码从OD上看在008D0290到008D02B6。稍微让它多映射一点比如到008D02BF,这样换算成VSize=8d02BF-871000+1=5F2C0。 图-------9 图-------10 改MessageBoxA的RVA,选Directories > Export Table ... > MessageBoxA > Edit...,把RVA从000407EA改成60290,因为8d0290-870000=60290 图-------11 图-------12 最后修复一下Checksum,保存。把myuser32.dll改名成user32.dll测试一下。果然能用了。 图-------13 完 |
|
[求助]段地址:必须被16整除?
其实很好理解啊,举个例子。 -r AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=0B5D ES=0B5D SS=0B5D CS=0B5D IP=0100 NV UP EI PL NZ NA PO NC 0B5D:0100 730B JNB 010D 这里的CS就是段地址,IP就是偏移地址。 CS的值是0B5D,但是他表示的物理地址是0B5D0,上面说的段地址能被16整除指的是0B5D0,而不是CS里面的0B5D |
|
[求助]怎么用VC6编辑资源并拿到汇编源码中来用?
回答: 1. 可以直接创建 2. 应该是把rc自动编译成res 3. 可以在其他地方与obj一起链接生成exe 自己截了几张图,哪里不清楚,再讨论好了。 直接创建资源 添加资源 拿对话框举个例子,选好了点New 旁边的工具栏可以加控件 最后文件另存为res |
|
|
|
[求助][求助]VC++中怎么找到unicode 开关
Project > Properties... > Configuration Properties > General > Character Set 选 Not Set |
|
[求助]段地址:必须被16整除?
一个CPU能够直接操作的内存容量是它的一个重要的性能指标,这个指标取决于CPU芯片的地址信号线的位数。8086有20根地址线,寻址空间可达1M,寄存器只有16位,怎么在16位的机器里表示20位的地址呢?于是就采用了存储器地址分段的办法。 内存地址(物理地址 PA)是通过把一个16位数据(段地址 SA)左移4位(也就是乘以16)再加上一个16位数据(偏移地址 EA)得到的。 PA = SA * 16 + EA 举个例子,2个不同的逻辑地址其实是一个物理地址: 1CBEE = 10FA:BC4E = 1800:4BEE |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值