Comments (3)
No, because $ebp
/$rbp
is
- specific to x86 architectures (some archs simply do not have frame pointers)
- can be omitted by the compiler directive
-fomit-frame-pointer
Whereas$rsp
(aka$sp
) has to always be there.
You can use the dereference
command to dump N entries from $rbp
when it exists. Example:
gef➤ dereference $ebp 10
0xffffd3f8│+0x0000: 0x0 ← $ebp
0xffffd3fc│+0x0004: 0xf7e0f5f7 → <__libc_start_main+247>: add esp,0x10
0xffffd400│+0x0008: 0x1
0xffffd404│+0x000c: 0xffffd494 → 0xffffd654 → "/home/hugsy/code/gef/tests/win32"
0xffffd408│+0x0010: 0xffffd49c → 0xffffd675 → "ALTERNATE_EDITOR=/usr/bin/nano"
0xffffd40c│+0x0014: 0x0
0xffffd410│+0x0018: 0x0
0xffffd414│+0x001c: 0x0
0xffffd418│+0x0020: 0xf7fa6000 → 0x1aedb0
0xffffd41c│+0x0024: 0xf7ffdc04 → 0x0
from gef.
Would it be possible to generically define a register from which the offset would be calculated and just set it to $rsp by default? I'm mostly wondering because some binaries have code like this:
gef➤ x/10i 0x0000000000400B90
0x400b90: mov rax,QWORD PTR [rbp-0x30]
0x400b94: mov rdx,QWORD PTR [rbp-0x18]
0x400b98: add rdx,rax
0x400b9b: mov rax,QWORD PTR [rbp-0x30]
0x400b9f: mov rcx,QWORD PTR [rbp-0x18]
0x400ba3: add rax,rcx
0x400ba6: movzx ecx,BYTE PTR [rax]
0x400ba9: mov rax,QWORD PTR [rbp-0x58]
0x400bad: mov rsi,QWORD PTR [rax+0x8]
0x400bb1: mov rax,QWORD PTR [rbp-0x30]
Being able to see stack value offsets based on $rbp would make it a bit easier to find the values mentioned in the code. Otherwise you have to constantly remember "oh yeah, $rbp-0x30 is $rsp+0x30".
from gef.
This seems like a not simple thing to implement for a very little gain, especially since you can use the dereference
command.
If you want, submit a PR and I will have a look.
Thanks.
from gef.
Related Issues (20)
- how to use gef-remote command when debuging by gdb-multiarch, and target is localhost:1234 HOT 1
- Permission Error while loading gef in GDB HOT 1
- display ascii char with x/c command HOT 2
- how to show filename:lineNumber in trace view ? HOT 4
- [Bug] vmmap command not showing memory regions of QEMU emulated x86-64 binary HOT 2
- any possible to add vmmap to show kernel memory in qemu? HOT 6
- bp_prefix not set on breakpoints declared with function name instead of hex_address ( HOT 5
- [Bug] Weird memory mapping with rr replay HOT 3
- [Bug] pyenv site_packages_dir assertion fails when setting multiple python versions in pyenv HOT 5
- [Bug] GEF installation error with GDB 8.2 with Python3.6 bindings HOT 3
- [Bug] read_cstring length can be set so that it reads into an unmapped region HOT 1
- [Bug] Missing update of local `/proc/{pid}/maps` in remote session when new shared library is loaded HOT 5
- [Bug] cant open under ubuntu 16.0.4 python 3.6 HOT 2
- Question about pyenv HOT 5
- [Docs] Add `pre-commit` documentation
- sth. about function and UI HOT 1
- gef for windows HOT 1
- The Gef Frame Is small HOT 1
- [Bug] AssertionError HOT 5
- [Bug] GEF tele and Stack view is broken on Remote-Gef HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gef.