-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add demo on GOT (and PLT) analysis #1
base: master
Are you sure you want to change the base?
Conversation
got-plt/README.md
Outdated
Starting program: /home/razvan/projects/snippets.git/got-plt/nostdlib/main | ||
|
||
Temporary breakpoint 1, 0x0000555555554395 in main () | ||
(gdb) maint info sections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this command displays something and it's confusing because here it looks like it shouldn't display anything
tbh, I would remove it; or if you want to present both options, add the output for both
got-plt/README.md
Outdated
391: 55 push rbp | ||
392: 48 89 e5 mov rbp,rsp | ||
395: e8 d6 ff ff ff call 370 <flowers@plt> | ||
39a: e8 d1 ff ff ff call 370 <flowers@plt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basket.c
doesn't disassemble into this, there is only one flower()
call in the main
function
got-plt/README.md
Outdated
0x0000555555554391 <+0>: push rbp | ||
0x0000555555554392 <+1>: mov rbp,rsp | ||
0x0000555555554395 <+4>: call 0x555555554370 <flowers@plt> | ||
=> 0x000055555555439a <+9>: call 0x555555554370 <flowers@plt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing as above
got-plt/README.md
Outdated
### Nice to Know | ||
|
||
The lazy binding feature of the loader can be disabled by using the `-z now` linker option. | ||
In that case, function addresses will be resolved at load time, and the `.got.plt` entries will be populated from the start with the actual addresses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/start/beginning so there is no confusion with the start
method
There are two source code files (
main.c
andbasket.c
), a header file (basket.h
) and aMakefile
. Thebascket.c
file will be compiled into a shared library (libbasket.so
). Themain.c
will be compiled and linked against the shared library, resulting in an executablemain
. We investigate the resulting files: themain
executable and thelibbasket.so
library.We used
nm
,objdump
andreadelf
for static analysis and GDB for dynamic analysis.