For the following C++ code:
class person { public: person() {} person(const person& rhs) {} }; void func(person p) { } int main(int argc, const char *argv[]) { person yao; func(yao); return 0; }
Run "g++ -S" produces (some .cfi directives removed):
.file "clean.cpp" .section .text._ZN6personC2Ev,"axG",@progbits,_ZN6personC5Ev,comdat .align 2 .weak _ZN6personC2Ev .type _ZN6personC2Ev, @function _ZN6personC2Ev: .LFB1: pushl %ebp movl %esp, %ebp popl %ebp ret .LFE1: .size _ZN6personC2Ev, .-_ZN6personC2Ev .section .text._ZN6personC2ERKS_,"axG",@progbits,_ZN6personC5ERKS_,comdat .align 2 .weak _ZN6personC2ERKS_ .type _ZN6personC2ERKS_, @function _ZN6personC2ERKS_: .LFB4: pushl %ebp movl %esp, %ebp popl %ebp ret .LFE4: .size _ZN6personC2ERKS_, .-_ZN6personC2ERKS_ .text .globl _Z4func6person .type _Z4func6person, @function _Z4func6person: .LFB6: pushl %ebp movl %esp, %ebp popl %ebp ret .LFE6: .size _Z4func6person, .-_Z4func6person .globl main .type main, @function main: .LFB7: pushl %ebp movl %esp, %ebp andl $-16, %esp subl $32, %esp leal 30(%esp), %eax movl %eax, (%esp) call _ZN6personC1Ev leal 30(%esp), %eax movl %eax, 4(%esp) leal 31(%esp), %eax movl %eax, (%esp) call _ZN6personC1ERKS_ leal 31(%esp), %eax movl %eax, (%esp) call _Z4func6person movl $0, %eax leave ret .LFE7: .size main, .-main .weak _ZN6personC1Ev .set _ZN6personC1Ev,_ZN6personC2Ev .weak _ZN6personC1ERKS_ .set _ZN6personC1ERKS_,_ZN6personC2ERKS_ .ident "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3" .section .note.GNU-stack,"",@progbits
To see the meaningful names for the mangle function names, user c++filt. For how gcc does name mangling on Linux, see http://refspecs.linux-foundation.org/cxxabi-1.83.html#mangling.
For the source code, we can have the following conclusion. A person object is created using its constructor. Before calling func, a new person object is created using its copy constructor.
相关推荐
Hacking the Code ASP.NET Web Application Security.pdf [拒绝黑客-ASP.NET.Web应用程序安全性剖析].Mark.M.Burnett.pdf 高清完整的文字版 不同于网上流传的CHM epub等版本 此pdf版由本人亲自制作
Learn the basics, like reverse engineering, assembly code analysis, programmatic memory manipulation, and code injection, and hone your new skills with hands-on example code and practice binaries....
hacking hacking hacking hacking
With a Foreword written by HackerOne Co-Founders Michiel Prins and Jobert Abma, Web Hacking 101 is about the ethical exploration of software for security issues but learning to hack isn’t always easy...
Hacking Vim 7.2 - by Kim Schulz,
This book is made up of five major parts, from basic knowledge to actual hacking code. A beginner is naturally expected to become a hacker while reading this book. Hacking Preparation: Briefly ...
Hacking_ A 101 Hacking Guide,hack参考书,值的一看。
as well as in hacking exploits and reverse engineering Covering assembly language in the Pentium microprocessor environment, this code-intensive guide shows programmers how to create stand-alone ...
Hacking_Tool_Developer_Sources_Primer_v10_by_Gunther.rar
WiFi Hacking for Beginners - Learn Hacking by Hacking WiFi networks (2017) (Azw3)
as well as in hacking exploits and reverse engineering Covering assembly language in the Pentium microprocessor environment, this code-intensive guide shows programmers how to create stand-alone ...
WiFi Hacking for Beginners - Learn Hacking by Hacking WiFi networks (2017) (Epub)
Hacking the Hacker takes you inside the world of ... final chapters include a guide for parents of young hackers, as well as the Code of Ethical Hacking to help you start your own journey to the top.
Learn the basics, like reverse engineering, assembly code analysis, programmatic memory manipulation, and code injection, and hone your new skills with hands-on example code and practice binaries....
CAN总线脱敏数据集,包含韩国HCLR实验室所用的Car Hacking和Road两个数据集,包含的攻击模式有Fuzzy/Ddos/Spoofing等。可直接拿来做异常检测。基于该数据集的论文有Song, Hyun Min, Jiyoung Woo, and Huy Kang Kim. ...
比较新的Hacking攻防的概念和技术,具有很好的指导价值。
HackingTeam RCSAndroid sample
hacking Web learning book
Ethical Hacking & Countermeasures