https://github.com/hellman/fixenv
Fix stack addresses (when no ASLR) with and without debugging
https://github.com/hellman/fixenv
Last synced: 11 months ago
JSON representation
Fix stack addresses (when no ASLR) with and without debugging
- Host: GitHub
- URL: https://github.com/hellman/fixenv
- Owner: hellman
- Created: 2012-02-13T13:47:52.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2015-01-23T08:26:50.000Z (about 11 years ago)
- Last Synced: 2025-04-04T11:05:52.441Z (11 months ago)
- Language: Shell
- Homepage:
- Size: 118 KB
- Stars: 180
- Watchers: 7
- Forks: 31
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
fixenv
====================
A script to make stack addresses the same when running a program under gdb,ltrace,strace or without debugging (without ASLR of course).
Env variables order is saved too.
Usage
---------------------
Usage:
./r.sh getvar [var_name] - get address of envvar's value
./r.sh dump [start_addr [size]] - dump the end of the stack
Running programs:
./r.sh ./program - run program
./r.sh strace ./program - run program in strace
./r.sh ltrace ./program - run program in ltrace
./r.sh gdb ./program [arg1 [arg2 [ ... ]]] - run program in gdb
Example
---------------------
$ ./r.sh gdb test/test
...
Local var: 0xbffffa5c
Env vars:
0xbffffc5f SHELL=/bin/bash
...
$ ./r.sh strace test/test 2>/dev/null
Local var: 0xbffffa5c
Env vars:
0xbffffc5f SHELL=/bin/bash
...
$ ./r.sh test/test
Local var: 0xbffffa5c
Env vars:
0xbffffc5f SHELL=/bin/bash
$ export XYZ=SOMEDATA
$ ./r.sh getvar XYZ
0xbffffcb8 \xb8\xfc\xff\xbf (XYZ)
$ ./r.sh test/test | grep XYZ
0xbffffcb4 XYZ=SOMEDATA
Author: hellman ( hellman1908@gmail.com )
License: GNU General Public License v2 (http://opensource.org/licenses/gpl-2.0.php)