8000 GitHub - hellman/fixenv: Fix stack addresses (when no ASLR) with and without debugging · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2FGitHub.com%2Fhellman%2Ffixenv","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E\u0026source=header-repo\u0026source_repo=hellman%2Ffixenv","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://GitHub.com/hellman/fixenv\",\"user_id\":null}}","auth_hydro_click_hmac":"79a7445f26b48c43f7bf094673e9df9680970d6b0c9976bd09d394ad6d5fe79b"}}
hellmanPublic

About

Fix stack addresses (when no ASLR) with and without debugging

Resources

Stars

183 stars

Watchers

4 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

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)

About

Fix stack addresses (when no ASLR) with and without debugging

Resources

Stars

183 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0