|
[求助]mov eax, 38E38E39
顺便贴一下minimize size选项下的汇编: 00401000 push esi 00401001 call _rand (0040105c) 00401006 mov ecx,eax 00401008 push 9 0040100A cdq 0040100B pop esi 0040100C idiv eax,esi 0040100E push eax 0040100F push ecx 00401010 push offset string "b = %d, a= %d\n" (00407030) 00401015 call _printf (00401021) 0040101A add esp,0Ch 0040101D xor eax,eax 0040101F pop esi 00401020 ret maximize speed下的是 00401000 call _rand (0040106b) 00401005 mov ecx,eax 00401007 mov eax,38E38E39h 0040100C imul ecx 0040100E sar edx,1 00401010 mov eax,edx 00401012 shr eax,1Fh 00401015 add edx,eax 00401017 push edx 00401018 push ecx 00401019 push offset string "b = %d, a= %d\n" (00407030) 0040101E call _printf (00401030) 00401023 add esp,0Ch 00401026 xor eax,eax 00401028 ret minimize下由于用idiv指令,节省了8个字节 |
|
[求助]mov eax, 38E38E39
《加密与解密》这本书里整数的除法那一章有讲这个 [QUOTE=davidcui;483454]006A0200 /$ 8B41 04 mov eax, dword ptr [ecx+4] ; 0F0C78A8 006A0203 |. 85C0 test eax, eax 006A0205 |. 75 01 jnz...[/QUOTE] |
|
[分享]最简单覆盖ret,我的学习心得
当然是debug时看内存阿,不清楚的话就学习下函数调用的栈帧结构 对于strcpy遇到0,没有什么办法解决,就比如写shellcode都会避免出现00字节一样,因为一旦出现在shellcode的中间某处,strcpy就会到此结束。debug下你可以直接把旧ebp值覆盖破坏掉,不理会那个debug error对话框。release下没有使用ebp时,直接覆盖返回地址,这时是没问题的 |
|
[分享]最简单覆盖ret,我的学习心得
你的字符串overflow_str有很多问题 首先,你的意思应该是"aaa\\x40\x10\xc4",你写掉了后面的\x 其次,小端机器里0x004010c4在内存里看起来应该是c4 10 40 00 因此你写字符串时应该反过来 再次,overflow时先覆盖的是旧的ebp值(除非你在release模式下没使用ebp),因此你覆盖时要先覆盖ebp,再才是返回地址 按你的思路,典型的字符串差不多是这样:overflow_str = "aaa\\x80\xff\x12\x00\xc4\x10\x40\x00" 其中0012ff80是旧ebp值,以保证它不被破坏,然后004010c4才是你想覆盖的返回地址 也就是跳过printf后的下一条指令地址 但是这样还是不行,因为字符串中间ebp值中含有\x00,strcpy在遇到它后会认为到达字符串末尾 因此你根本就不能覆盖后面的返回地址 如果我们把\x00改称非0值,比如\x01,则可以覆盖返回地址,执行时printf函数被跳过 但当main函数执行完后会平衡esp指针然后执行一个chkesp函数,它会检查esp指针和ebp指针是否相等 由于ebp改成了0112ff80是个错误值,因此报出一个debug错误框 |
|
|
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值