Fix null deref in libr_asm and add lang-python r2pm pkg

This commit is contained in:
pancake 2016-06-02 02:29:44 +02:00
parent 7c7d75b3fa
commit 03294af32b
4 changed files with 30 additions and 14 deletions

16
binr/r2pm/d/lang-python Normal file
View File

@ -0,0 +1,16 @@
R2PM_BEGIN
R2PM_GIT "https://github.com/radare/radare2-bindings"
R2PM_DESC "[lang-python] Python r2pipe/RLang plugin"
R2PM_INSTALL() {
./configure --prefix="${R2PM_PREFIX}" || exit 1
${MAKE} -C libr/lang/p python || exit 1
${MAKE} -C libr/lang/p python-install || exit 1
}
R2PM_UNINSTALL() {
${MAKE} -C libr/lang/p python-uninstall
}
R2PM_END

View File

@ -265,20 +265,20 @@ case "$1" in
*|help|-h)
echo "Usage: r2pm [cmd] [...]"
echo "Commands:"
echo " -i,info r2pm -i # pkgs info"
echo " -i,install <pkgname> r2pm -i baleful"
echo " -gi,global-install <pkg> r2pm -gi baleful # install baleful in system"
echo " -gu,global-uninstall <pkg> r2pm -gu baleful # uninstall pkg from systemdir"
echo " -u,uninstall <pkgname> r2pm -u baleful (-uu to force)"
echo " -l,list list installed pkgs"
echo " -lu list uninstalled packages"
echo " -t,test FX,XX,BR BID check in travis regressions"
echo " -s,search [<keyword>] search in database"
echo " -v,version show version"
echo " -h,help show this message"
echo " -c,clean clear source cache"
echo " -i,info pkgs info"
echo " -i,install <pkgname> baleful"
echo " -gi,global-install <pkg> install baleful in system"
echo " -gu,global-uninstall <pkg> uninstall pkg from systemdir"
echo " -u,uninstall <pkgname> r2pm -u baleful (-uu to force)"
echo " -l,list list installed pkgs"
echo " -lu list uninstalled packages"
echo " -t,test FX,XX,BR BID check in travis regressions"
echo " -s,search [<keyword>] search in database"
echo " -v,version show version"
echo " -h,help show this message"
echo " -c,clean clear source cache"
echo "Environment:"
echo "SUDO=sudo use this tool as sudo"
echo "SUDO=sudo use this tool as sudo"
#echo "R2PM_PREFIX=/usr prefix for syspkgs"
echo "R2PM_PLUGDIR=~/.config/radare2/plugins # default value, home-install for plugins"
echo "R2PM_PLUGDIR=/usr/lib/radare2/last/ # for system-wide plugin installs"

View File

@ -251,7 +251,7 @@ R_API int r_asm_use(RAsm *a, const char *name) {
return false;
}
r_list_foreach (a->plugins, iter, h) {
if (!strcmp (h->name, name)) {
if (!strcmp (h->name, name) && h->arch) {
if (!a->cur || (a->cur && strcmp (a->cur->arch, h->arch))) {
//const char *dop = r_config_get (core->config, "dir.opcodes");
// TODO: allow configurable path for sdb files