|
[求助] 为什么 C 语言的数组在 gcc 中反汇编和实际大小不符合 ?
.file "demo.c" .text .globl main .type main, @function main: pushq %rbp movq %rsp, %rbp movl %edi, -84(%rbp) movq %rsi, -96(%rbp) movl $1, -4(%rbp) movb $97, -17(%rbp) // 为什么是 -17 ,不是 -5? movl $0, %eax popq %rbp ret .size main, .-main .ident "GCC: (GNU) 9.1.0" .section .note.GNU-stack,"",@progbits ========= int main(int argc, char** argv) { int i; char buffer[64]; i = 1; buffer[63] = 'a'; return 0; } 后面大师讨论说: 这里的 movb $97, -17(%rbp) 的是由于 编译器的 16 字节对齐 ,所以开始是 17 |
|
[求助] 为什么 C 语言的数组在 gcc 中反汇编和实际大小不符合 ?
哈哈 找到了 是由于默认的 stack-protector 给加了个内容,再算上ebp : 8 + 8 + 4 + 64 = 84 。这样就说通了 gcc -fno-stack-protector -fno-asynchronous-unwind-tables -S -O0 demo.c 得到如下: .file "demo.c" .text .globl main .type main, @function main: pushq %rbp movq %rsp, %rbp movl $1, -4(%rbp) movb $97, -80(%rbp) movb $97, -17(%rbp) movl $0, %eax popq %rbp ret .size main, .-main .ident "GCC: (GNU) 9.1.0" .section .note.GNU-stack,"",@progbits |
|
[求助]x86: 保护模式下,iret 指令返回到 特权级 ring1 还是 rang3 呀 ?
hzqst 取决于堆栈里保存的cs是多少嗯嗯 现在在 内核任务切换到用户任务, ring0->ring3 的情况下 是不是得看 ldt 中的段选择子呀 @Socrates.sissy |
|
[讨论]请问下,未来开发和逆向,哪个方向更有前途?各位都有什么看法?
说的没错呀,现在搞搞机器学习 随随便便 年薪飞起。真的看市场 |
|
[原创]告别临时会员了
唉 奋斗中 |
|
请问写天龙八部的内存挂会被抓吗
你已经被包围了 |
|
[求助]“我的电脑” 究竟是什么
windows中 我的电脑 就是我的电脑啊 懂得设置就好了 不用拘泥于 名字 反正翻译过来 多多少少变了味道 |
|
[原创]转正了。嘎嘎
恭喜 我还有15个kx 就可以转了 回个帖都不行 |
|
在不启动系统的情况下,如何判断操作系统是32位还是64位?
不启动系统 是无法查看的 不过利用老毛桃 这类工具 可以看到 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值