- Add helpers for info->dbg_info
* vapis
  - Add r_hex_* stuff to r_util.vapi under RHex
  - Update r_bin.vapi
* bindings
  - Add target "install-lua" to Makefile
This commit is contained in:
Nibble 2010-03-13 20:25:03 +01:00
parent 400cc2f2d3
commit ed94bdcb14
5 changed files with 55 additions and 4 deletions

View File

@ -216,6 +216,31 @@ R_API RList* r_bin_get_symbols(RBin *bin) {
return bin->symbols;
}
R_API int r_bin_is_big_endian (RBin *bin) {
return bin->info->big_endian;
}
R_API int r_bin_is_stripped (RBin *bin) {
return R_BIN_DBG_STRIPPED (bin->info->dbg_info);
}
R_API int r_bin_is_static (RBin *bin) {
return R_BIN_DBG_STATIC (bin->info->dbg_info);
}
/* XXX Implement in r_bin_meta and deprecate? */
R_API int r_bin_has_dbg_linenums (RBin *bin) {
return R_BIN_DBG_LINENUMS (bin->info->dbg_info);
}
R_API int r_bin_has_dbg_syms (RBin *bin) {
return R_BIN_DBG_SYMS (bin->info->dbg_info);
}
R_API int r_bin_has_dbg_relocs (RBin *bin) {
return R_BIN_DBG_RELOCS (bin->info->dbg_info);
}
R_API RBin* r_bin_new() {
RBin *bin;
if (!(bin = R_NEW (RBin)))

View File

@ -152,6 +152,12 @@ R_API RList* r_bin_get_sections(RBin *bin);
R_API RBinSection* r_bin_get_section_at(RBin *bin, ut64 off, int va);
R_API RList* r_bin_get_strings(RBin *bin);
R_API RList* r_bin_get_symbols(RBin *bin);
R_API int r_bin_is_big_endian (RBin *bin);
R_API int r_bin_is_stripped (RBin *bin);
R_API int r_bin_is_static (RBin *bin);
R_API int r_bin_has_dbg_linenums (RBin *bin);
R_API int r_bin_has_dbg_syms (RBin *bin);
R_API int r_bin_has_dbg_relocs (RBin *bin);
R_API RBin* r_bin_new();
R_API void r_bin_set_user_ptr(RBin *bin, void *user);

View File

@ -21,6 +21,12 @@ namespace Radare {
public RList<RBin.String> get_strings();
public RList<RBin.Symbol> get_symbols();
public RBin.Info get_info();
public int is_big_endian();
public int is_stripped();
public int is_static();
public int has_dbg_linenums();
public int has_dbg_syms();
public int has_dbg_relocs();
[CCode (cname="RBinEntry", free_function="", ref_function="", unref_function="")]
public class Entry {

View File

@ -31,6 +31,13 @@ namespace Radare {
}
#endif
[CCode (cheader_filename="r_util.h", cprefix="r_hex_", free_function="")]
public static class RHex {
public static int str2bin (string input, uint8 *buf);
public static int bin2str (uint8 *buf, int len, out string str);
public static string bin2strdup (uint8 *buf, int len);
}
[CCode (cheader_filename="r_util.h", cprefix="r_sys_", free_function="")]
public static class RSystem {
//public static const weak string OS;

View File

@ -38,7 +38,14 @@ install-python:
fi
install-lua:
@echo TODO: install-lua
@if [ "`grep lua supported.langs`" ]; then \
for a in 5.1; do \
mkdir -p ${DESTDIR}${PREFIX}/lib/lua/$$a/r2 ; \
echo "Installing lua$$a r2 modules..." ; \
cp -rf lua/* ${DESTDIR}${PREFIX}/lib/lua/$$a/r2 ; \
cp -rf lua/*libr* ${DESTDIR}${PREFIX}/lib/lua/$$a ; \
done ; \
fi
install-ruby:
@if [ "`grep ruby supported.langs`" ]; then \
@ -55,12 +62,12 @@ install-perl:
target=${DESTDIR}`perl -e 'print $$INC[0]'` ; \
mkdir -p $$target/r2 ; \
echo "Installing perl r2 modules..." ; \
cp -rf perl/*.so $$target/ ; \
cp -rf perl/*.so $$target/r2 ; \
cp -rf perl/*.pm $$target/r2 ; \
cp -rf perl/*libr* $$target/r2 ; \
cp -rf perl/*libr* $$target/ ; \
fi
install: install-python install-ruby install-perl
install: install-python install-ruby install-perl install-lua
oldtest:
sh do-swig.sh r_bp