Error[8]: Undefined offset: 5, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述void return_input (void){ char array[30]; gets (array); printf("%s\n", array); } 在gcc中编译之后,此函数将转换为以下程序集代码: push %ebpmov %esp,%ebpsub $0x28,%espmov %gs:0x14,%eaxmov %
voID return_input (voID){    char array[30];    gets (array);    printf("%s\n",array); }

在gcc中编译之后,此函数将转换为以下程序集代码:

push   %ebpmov    %esp,%ebpsub    
mov    %gs:0x14,%eax
x28,%espmov %gs:0x14,%eaxmov %eax,-0x4(%ebp)xor %eax,%eaxlea -0x22(%ebp),(%esp)call 0x8048374 lea -0x22(%ebp),(%esp)call 0x80483a4 mov -0x4(%ebp),%eaxxor %gs:0x14,%eaxje 0x80484ac call 0x8048394 leave ret

我不明白两行:

cc -c -mpreferred-stack-boundary=2 -ggdb file.c

什么是%gs,这两行究竟是什么呢?

这是编译命令:

mov    %gs:0x14,%eax
解决方法 GS是一个段寄存器,其在linux中的使用可以在 here上读取(它基本上用于每个进程数据). [+++]

该代码用于验证堆栈没有爆炸或已被证实,使用存储在GS 0x14中的金丝雀值,参见this.

总结

以上是内存溢出为你收集整理的linux – 什么是汇编中的%gs全部内容,希望文章能够帮你解决linux – 什么是汇编中的%gs所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
linux – 什么是汇编中的%gs_系统运维_内存溢出

linux – 什么是汇编中的%gs

linux – 什么是汇编中的%gs,第1张

概述void return_input (void){ char array[30]; gets (array); printf("%s\n", array); } 在gcc中编译之后,此函数将转换为以下程序集代码: push %ebpmov %esp,%ebpsub $0x28,%espmov %gs:0x14,%eaxmov %
voID return_input (voID){    char array[30];    gets (array);    printf("%s\n",array); }

在gcc中编译之后,此函数将转换为以下程序集代码:

push   %ebpmov    %esp,%ebpsub    
mov    %gs:0x14,%eax
x28,%espmov %gs:0x14,%eaxmov %eax,-0x4(%ebp)xor %eax,%eaxlea -0x22(%ebp),(%esp)call 0x8048374 lea -0x22(%ebp),(%esp)call 0x80483a4 mov -0x4(%ebp),%eaxxor %gs:0x14,%eaxje 0x80484ac call 0x8048394 leave ret

我不明白两行:

cc -c -mpreferred-stack-boundary=2 -ggdb file.c

什么是%gs,这两行究竟是什么呢?

这是编译命令:

mov    %gs:0x14,%eax
解决方法 GS是一个段寄存器,其在linux中的使用可以在 here上读取(它基本上用于每个进程数据).

该代码用于验证堆栈没有爆炸或已被证实,使用存储在GS 0x14中的金丝雀值,参见this.

总结

以上是内存溢出为你收集整理的linux – 什么是汇编中的%gs全部内容,希望文章能够帮你解决linux – 什么是汇编中的%gs所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1048911.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存