radare2 icon indicating copy to clipboard operation
radare2 copied to clipboard

Implement -H in rasm2 rabin2 rahash2 ...

Open trufae opened this issue 1 year ago • 3 comments

The same way it's done in r2 or r2pm

  • Update manpages

trufae avatar Aug 27 '24 17:08 trufae

Also verify these paths and if they are in use IMG_6831

trufae avatar Oct 09 '24 18:10 trufae

related https://github.com/radareorg/radare2/issues/21484

trufae avatar Oct 10 '24 17:10 trufae

also note history is saved in ~/.cache but anos are in ~/.local/share/radare2/cache <- inconsistent!

trufae avatar Oct 11 '24 09:10 trufae

@trufae if no one is working on it can i work on it? @astralia

abhinavjha0239 avatar Oct 22 '24 21:10 abhinavjha0239

sure

trufae avatar Oct 23 '24 08:10 trufae

@trufae work with environment variable looks very different in every utils...

for example radare2 and r2pm for now

radare -H
R2_VERSION=5.9.9
R2_PREFIX=/usr/local
R2_MAGICPATH=/usr/local/share/radare2/5.9.9/magic
R2_INCDIR=/usr/local/include/libr
R2_BINDIR=/usr/local/bin
R2_RCFILE=/home/user/.radare2rc
R2_LIBDIR=/usr/local/lib
R2_LIBEXT=so
R2_RDATAHOME=/home/user/.local/share
R2_HISTORY=/home/user/.cache/radare2/history
R2_CONFIG_HOME=/home/user/.config
R2_CACHE_HOME=/home/user/.cache
R2_LIBR_PLUGINS=/usr/local/lib/radare2/5.9.9
R2_USER_PLUGINS=/home/user/.local/share/radare2/plugins
R2_ZIGNS_HOME=/home/user/.local/share/radare2/zigns
r2pm -H
R2_LOG_LEVEL=2         # define log.level for r2pm
SUDO=sudo              # path to the SUDO executable
MAKE=make              # path to the GNU MAKE executable
R2PM_OFFLINE=0         # don't git pull
R2PM_LEGACY=0
R2PM_TIME=YYYY-MM-DD
R2PM_PLUGDIR=/home/user/.local/share/radare2/plugins
R2PM_PLUGDIR=/usr/local/lib/radare2/5.9.9 (global)
R2PM_PREFIX=/home/user/.local/share/radare2/prefix
R2PM_BINDIR=/home/user/.local/share/radare2/prefix/bin
R2PM_MANDIR=/home/user/.local/share/radare2/prefix/man
R2PM_LIBDIR=/home/user/.local/share/radare2/prefix/lib
R2PM_DBDIR=/home/user/.local/share/radare2/r2pm/git/radare2-pm/db
R2PM_GITDIR=/home/user/.local/share/radare2/r2pm/git
R2PM_GITURL=https://github.com/radareorg/radare2-pm

maybe it is better to do some common api like

r_lib_setenv
r_lib_getenv
r_lib_printenv

to control env variables and use it in one way for all utils

vbalyasnyy avatar Mar 17 '25 06:03 vbalyasnyy

Thats expected imho. R2 provides the info where the tool is installed. R2pm installs stuff in the home so all paths are different because a user is not suposed to modify the system directories. Maybe good to have a generic way to have all those vars for all the tools but for that case imho thats correct

trufae avatar Mar 17 '25 06:03 trufae