mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 13:19:54 +00:00
Add lang field for classes, symbols and methods, expose it via ic ##bin
This commit is contained in:
parent
ccbd36e885
commit
df32ab437f
@ -1077,11 +1077,14 @@ R_API RBinSymbol *r_bin_file_add_method(RBinFile *bf, const char *klass, const c
|
||||
R_LOG_ERROR ("Cannot allocate class %s", klass);
|
||||
return NULL;
|
||||
}
|
||||
int lang = (strstr (method, "JNI") || strstr (klass, "JNI"))? R_BIN_NM_JNI: R_BIN_NM_CXX;
|
||||
c->lang = lang;
|
||||
RBinSymbol *sym = __getMethod (bf, klass, method);
|
||||
if (!sym) {
|
||||
sym = R_NEW0 (RBinSymbol);
|
||||
if (sym) {
|
||||
sym->name = strdup (method);
|
||||
sym->lang = lang;
|
||||
r_list_append (c->methods, sym);
|
||||
char *name = r_str_newf ("%s::%s", klass, method);
|
||||
ht_pp_insert (bf->o->methods_ht, name, sym);
|
||||
|
@ -267,6 +267,8 @@ R_API const char *r_bin_lang_tostring(int lang) {
|
||||
return "dart";
|
||||
case R_BIN_NM_GROOVY:
|
||||
return "groovy";
|
||||
case R_BIN_NM_JNI:
|
||||
return "jni";
|
||||
case R_BIN_NM_C:
|
||||
return (lang & R_BIN_NM_BLOCKS)? "c with blocks": "c";
|
||||
case R_BIN_NM_CXX:
|
||||
@ -280,6 +282,5 @@ R_API const char *r_bin_lang_tostring(int lang) {
|
||||
case R_BIN_NM_RUST:
|
||||
return "rust";
|
||||
}
|
||||
return NULL;
|
||||
return "?";
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* radare - LGPL - Copyright 2009-2020 - pancake, h4ng3r */
|
||||
/* radare - LGPL - Copyright 2009-2022 - pancake, h4ng3r */
|
||||
|
||||
#include <r_types.h>
|
||||
#include <r_util.h>
|
||||
|
@ -31,7 +31,7 @@ typedef struct {
|
||||
} RTrieState;
|
||||
|
||||
typedef struct {
|
||||
ut8 * imports;
|
||||
ut8 *imports;
|
||||
RSkipList *relocs;
|
||||
} RWalkBindChainsContext;
|
||||
|
||||
@ -2796,6 +2796,9 @@ const RList *MACH0_(get_symbols_list)(struct MACH0_(obj_t) *bin) {
|
||||
}
|
||||
for (i = from; i < to && j < symbols_count; i++, j++) {
|
||||
RBinSymbol *sym = R_NEW0 (RBinSymbol);
|
||||
if (!sym) {
|
||||
break;
|
||||
}
|
||||
sym->vaddr = bin->symtab[i].n_value;
|
||||
sym->paddr = addr_to_offset (bin, sym->vaddr);
|
||||
symbols[j].size = 0; /* TODO: Is it anywhere? */
|
||||
@ -2845,6 +2848,7 @@ const RList *MACH0_(get_symbols_list)(struct MACH0_(obj_t) *bin) {
|
||||
if (!sym) {
|
||||
break;
|
||||
}
|
||||
sym->lang = R_BIN_NM_C;
|
||||
sym->vaddr = symbol.addr;
|
||||
sym->paddr = symbol.offset;
|
||||
sym->name = symbol.name;
|
||||
|
@ -698,7 +698,7 @@ static void get_method_list_t(mach0_ut p, RBinFile *bf, char *class_name, RBinCl
|
||||
method->rtype = strdup (rtype);
|
||||
R_FREE (rtype);
|
||||
}
|
||||
|
||||
method->lang = R_BIN_NM_OBJC;
|
||||
method->vaddr = m.imp;
|
||||
if (!method->vaddr) {
|
||||
R_FREE (method);
|
||||
@ -1463,6 +1463,7 @@ RList *MACH0_(parse_classes)(RBinFile *bf, objc_cache_opt_info *oi) {
|
||||
// retain just for debug
|
||||
goto get_classes_error;
|
||||
}
|
||||
klass->lang = R_BIN_NM_OBJC;
|
||||
if (!(klass->methods = r_list_new ())) {
|
||||
// retain just for debug
|
||||
goto get_classes_error;
|
||||
|
@ -1090,6 +1090,7 @@ static void parse_dex_class_fields(RBinFile *bf, RBinDexClass *c, RBinClass *cls
|
||||
sym->name = r_str_replace (sym->name, "method.", "", 0);
|
||||
r_str_replace_char (sym->name, ';', 0);
|
||||
sym->paddr = sym->vaddr = total;
|
||||
sym->lang = R_BIN_NM_JAVA;
|
||||
sym->ordinal = (*sym_count)++;
|
||||
|
||||
if (dex->dexdump) {
|
||||
@ -1117,8 +1118,7 @@ static void parse_dex_class_fields(RBinFile *bf, RBinDexClass *c, RBinClass *cls
|
||||
|
||||
// TODO: refactor this method
|
||||
// XXX it needs a lot of love!!!
|
||||
static void parse_dex_class_method(RBinFile *bf, RBinDexClass *c, RBinClass *cls,
|
||||
int *sym_count, ut64 DM, int *methods, bool is_direct) {
|
||||
static void parse_dex_class_method(RBinFile *bf, RBinDexClass *c, RBinClass *cls, int *sym_count, ut64 DM, int *methods, bool is_direct) {
|
||||
PrintfCallback cb_printf = bf->rbin->cb_printf;
|
||||
RBinDexObj *dex = bf->o->bin_obj;
|
||||
bool bin_dbginfo = bf->rbin->want_dbginfo;
|
||||
@ -1369,6 +1369,7 @@ static void parse_dex_class_method(RBinFile *bf, RBinDexClass *c, RBinClass *cls
|
||||
sym->vaddr = encoded_method_addr;
|
||||
}
|
||||
dex->code_from = R_MIN (dex->code_from, sym->paddr);
|
||||
sym->lang = R_BIN_NM_JAVA;
|
||||
sym->bind = ((MA & 1) == 1) ? R_BIN_BIND_GLOBAL_STR : R_BIN_BIND_LOCAL_STR;
|
||||
sym->method_flags = get_method_flags (MA);
|
||||
sym->ordinal = (*sym_count)++;
|
||||
@ -1422,6 +1423,7 @@ static void parse_dex_class_method(RBinFile *bf, RBinDexClass *c, RBinClass *cls
|
||||
} else {
|
||||
sym->size = 0;
|
||||
r_list_append (dex->methods_list, sym);
|
||||
sym->lang = R_BIN_NM_JAVA;
|
||||
r_list_append (cls->methods, sym);
|
||||
}
|
||||
if (MC > 0 && debug_info_off > 0 && dex->header.data_offset < debug_info_off &&
|
||||
@ -1456,6 +1458,7 @@ static void parse_class(RBinFile *bf, RBinDexClass *c, int class_index, int *met
|
||||
goto beach;
|
||||
}
|
||||
cls->name = dex_class_name (dex, c);
|
||||
cls->lang = R_BIN_NM_JAVA;
|
||||
if (!cls->name) {
|
||||
goto beach;
|
||||
}
|
||||
@ -1721,6 +1724,7 @@ static bool dex_loadcode(RBinFile *bf) {
|
||||
//XXX use r_buf API!!
|
||||
sym->paddr = sym->vaddr = dex->header.method_offset + (sizeof (struct dex_method_t) * i) ;
|
||||
sym->ordinal = sym_count++;
|
||||
sym->lang = R_BIN_NM_JAVA;
|
||||
r_list_append (dex->methods_list, sym);
|
||||
r_strf_var (mname, 64, "method.%"PFMT64d, (ut64)i);
|
||||
sdb_num_set (dex->mdb, mname, sym->paddr, 0);
|
||||
|
@ -23,11 +23,11 @@ static int init(void *user) {
|
||||
}
|
||||
|
||||
static int fini(void *user) {
|
||||
IFDBG_BIN_JAVA eprintf("Calling plugin fini = %d.\n", DB? 1: 0);
|
||||
IFDBG_BIN_JAVA eprintf ("Calling plugin fini = %d.\n", DB? 1: 0);
|
||||
if (!DB) {
|
||||
IFDBG_BIN_JAVA eprintf("plugin DB already uninited.\n");
|
||||
IFDBG_BIN_JAVA eprintf ("plugin DB already uninited.\n");
|
||||
} else {
|
||||
IFDBG_BIN_JAVA eprintf("plugin DB beeing uninited.\n");
|
||||
IFDBG_BIN_JAVA eprintf ("plugin DB beeing uninited.\n");
|
||||
sdb_free (DB);
|
||||
DB = NULL;
|
||||
}
|
||||
|
@ -27,10 +27,9 @@
|
||||
#define PAIR_WIDTH "9"
|
||||
|
||||
static void pair(const char *key, const char *val) {
|
||||
if (!val || !*val) {
|
||||
return;
|
||||
if (R_STR_ISNOTEMPTY (val)) {
|
||||
r_cons_printf ("%-"PAIR_WIDTH"s%s\n", key, val);
|
||||
}
|
||||
r_cons_printf ("%-"PAIR_WIDTH"s%s\n", key, val);
|
||||
}
|
||||
|
||||
static void pair_bool(PJ *pj, const char *key, bool val) {
|
||||
@ -453,7 +452,7 @@ static void _print_strings(RCore *r, RList *list, PJ *pj, int mode, int va) {
|
||||
}
|
||||
free (str);
|
||||
} else if (IS_MODE_SIMPLE (mode)) {
|
||||
r_cons_printf ("0x%"PFMT64x" %d %d %s\n", vaddr,
|
||||
r_cons_printf ("0x%"PFMT64x" %d %.4d %s\n", vaddr,
|
||||
string->size, string->length, string->string);
|
||||
} else if (IS_MODE_SIMPLEST (mode)) {
|
||||
r_cons_println (string->string);
|
||||
@ -3493,7 +3492,7 @@ static int bin_classes(RCore *r, PJ *pj, int mode) {
|
||||
if (IS_MODE_JSON (mode)) {
|
||||
pj_a (pj);
|
||||
} else if (IS_MODE_SET (mode)) {
|
||||
if (!r_config_get_i (r->config, "bin.classes")) {
|
||||
if (!r_config_get_b (r->config, "bin.classes")) {
|
||||
return false;
|
||||
}
|
||||
r_flag_space_set (r->flags, R_FLAGS_FS_CLASSES);
|
||||
@ -3546,8 +3545,8 @@ static int bin_classes(RCore *r, PJ *pj, int mode) {
|
||||
} else if (IS_MODE_SIMPLEST (mode)) {
|
||||
r_cons_printf ("%s\n", c->name);
|
||||
} else if (IS_MODE_SIMPLE (mode)) {
|
||||
r_cons_printf ("0x%08"PFMT64x" [0x%08"PFMT64x" - 0x%08"PFMT64x"] %s%s%s\n",
|
||||
c->addr, at_min, at_max, c->name, c->super ? " " : "",
|
||||
r_cons_printf ("0x%08"PFMT64x" [0x%08"PFMT64x" - 0x%08"PFMT64x"] %s %s%s%s\n",
|
||||
c->addr, at_min, at_max, r_bin_lang_tostring (c->lang), c->name, c->super ? " " : "",
|
||||
r_str_get (c->super));
|
||||
} else if (IS_MODE_CLASSDUMP (mode)) {
|
||||
if (c) {
|
||||
@ -3626,6 +3625,10 @@ static int bin_classes(RCore *r, PJ *pj, int mode) {
|
||||
pj_o (pj);
|
||||
pj_ks (pj, "classname", c->name);
|
||||
pj_kN (pj, "addr", c->addr);
|
||||
const char *lang = r_bin_lang_tostring (c->lang);
|
||||
if (lang && *lang != '?') {
|
||||
pj_ks (pj, "lang", lang);
|
||||
}
|
||||
pj_ki (pj, "index", c->index);
|
||||
if (c->super) {
|
||||
pj_ks (pj, "visibility", r_str_get (c->visibility_str));
|
||||
@ -3672,8 +3675,9 @@ static int bin_classes(RCore *r, PJ *pj, int mode) {
|
||||
pj_end (pj);
|
||||
} else {
|
||||
int m = 0;
|
||||
r_cons_printf ("0x%08"PFMT64x" [0x%08"PFMT64x" - 0x%08"PFMT64x"] %6"PFMT64d" class %d %s",
|
||||
c->addr, at_min, at_max, (at_max - at_min), c->index, c->name);
|
||||
const char *cl = r_bin_lang_tostring (c->lang);
|
||||
r_cons_printf ("0x%08"PFMT64x" [0x%08"PFMT64x" - 0x%08"PFMT64x"] %6"PFMT64d" %s class %d %s",
|
||||
c->addr, at_min, at_max, (at_max - at_min), cl, c->index, c->name);
|
||||
if (c->super) {
|
||||
r_cons_printf (" :: %s\n", c->super);
|
||||
} else {
|
||||
|
@ -656,7 +656,6 @@ static RDisasmState *ds_init(RCore *core) {
|
||||
ds->show_color_bytes = r_config_get_i (core->config, "scr.color.bytes");
|
||||
ds->show_color_args = r_config_get_i (core->config, "scr.color.args");
|
||||
ds->colorop = r_config_get_b (core->config, "scr.color.ops");
|
||||
R_LOG_TODO ("find a better name for 'scr.color.ops'");
|
||||
ds->show_utf8 = r_config_get_i (core->config, "scr.utf8");
|
||||
ds->acase = r_config_get_i (core->config, "asm.ucase");
|
||||
ds->capitalize = r_config_get_i (core->config, "asm.capitalize");
|
||||
|
@ -148,6 +148,7 @@ typedef enum {
|
||||
R_BIN_NM_PASCAL = 1<<10,
|
||||
R_BIN_NM_DART = 1<<11,
|
||||
R_BIN_NM_GROOVY = 1<<12,
|
||||
R_BIN_NM_JNI = 1U<<13,
|
||||
R_BIN_NM_BLOCKS = 1U<<31,
|
||||
R_BIN_NM_ANY = -1,
|
||||
} RBinNameMangling;
|
||||
@ -269,7 +270,7 @@ typedef struct r_bin_object_t {
|
||||
HtPP *methods_ht;
|
||||
RList/*<RBinDwarfRow>*/ *lines;
|
||||
HtUP *strings_db;
|
||||
RList/*<??>*/ *mem; //RBinMem maybe?
|
||||
RList/*<??>*/ *mem; // RBinMem maybe?
|
||||
RList/*<BinMap*/ *maps;
|
||||
char *regstate;
|
||||
RBinInfo *info;
|
||||
@ -515,6 +516,7 @@ typedef struct r_bin_class_t {
|
||||
RList *fields; // <RBinField>
|
||||
// RList *interfaces; // <char *>
|
||||
int visibility;
|
||||
int lang;
|
||||
} RBinClass;
|
||||
|
||||
#define RBinSectionName r_offsetof(RBinSection, name)
|
||||
@ -551,6 +553,7 @@ typedef struct r_bin_symbol_t {
|
||||
ut32 size;
|
||||
ut32 ordinal;
|
||||
ut32 visibility;
|
||||
int lang;
|
||||
int bits;
|
||||
/* see R_BIN_METH_* constants */
|
||||
ut64 method_flags;
|
||||
@ -685,6 +688,9 @@ R_API bool r_bin_open_io(RBin *bin, RBinFileOptions *opt);
|
||||
R_API bool r_bin_open_buf(RBin *bin, RBuffer *buf, RBinFileOptions *opt);
|
||||
R_API bool r_bin_reload(RBin *bin, ut32 bf_id, ut64 baseaddr);
|
||||
|
||||
R_IPI RBinClass *r_bin_class_new(const char *name, const char *super, int view);
|
||||
R_API void r_bin_class_free(RBinClass *);
|
||||
|
||||
// plugins/bind functions
|
||||
R_API void r_bin_bind(RBin *b, RBinBind *bnd);
|
||||
R_API bool r_bin_add(RBin *bin, RBinPlugin *foo);
|
||||
@ -812,6 +818,8 @@ R_API bool r_bin_wr_rpath_del(RBin *bin);
|
||||
R_API bool r_bin_wr_entry(RBin *bin, ut64 addr);
|
||||
R_API bool r_bin_wr_output(RBin *bin, const char *filename);
|
||||
|
||||
R_API const char *r_bin_lang_tostring(int type);
|
||||
|
||||
R_API RList *r_bin_get_mem(RBin *bin);
|
||||
|
||||
/* filter.c */
|
||||
|
@ -697,6 +697,7 @@ R_API void r_bin_java_get_import_json_definitions(RBinJavaObj *bin, PJ *pj) {
|
||||
return;
|
||||
}
|
||||
|
||||
// XXX this is implemented in rbin already
|
||||
R_API void r_bin_java_get_class_info_json(RBinJavaObj *bin, PJ *pj) {
|
||||
r_return_if_fail (bin && pj);
|
||||
RList *classes = r_bin_java_get_classes (bin);
|
||||
@ -2767,7 +2768,11 @@ R_API RList *r_bin_java_enum_class_methods(RBinJavaObj *bin, ut16 class_idx) {
|
||||
}
|
||||
} else {
|
||||
RBinSymbol *sym = R_NEW0 (RBinSymbol);
|
||||
if (!sym) {
|
||||
break;
|
||||
}
|
||||
sym->name = strdup (field->name);
|
||||
sym->lang = R_BIN_NM_JAVA;
|
||||
// func defintion
|
||||
// sym->paddr = field->file_offset + bin->loadaddr;
|
||||
// code implementation
|
||||
@ -2880,6 +2885,7 @@ R_API RList *r_bin_java_get_classes(RBinJavaObj *bin) {
|
||||
k->name = r_bin_java_get_this_class_name (bin);
|
||||
k->super = r_bin_java_get_name_from_bin_cp_list (bin, bin->cf2.super_class);
|
||||
k->index = (idx++);
|
||||
k->lang = R_BIN_NM_JAVA;
|
||||
r_list_append (classes, k);
|
||||
r_list_foreach (bin->cp_list, iter, cp_obj) {
|
||||
if (cp_obj && cp_obj->tag == R_BIN_JAVA_CP_CLASS
|
||||
|
@ -484,19 +484,19 @@ ic~_JNIEnv
|
||||
ic~FindClass
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
0x00000000 [0x00006060 - 0x0000697c] 2332 class 0 _JNIEnv
|
||||
0x000074f8 method 0 inject(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x0000699c method 1 findBaseDexClassloader(_JNIEnv*, _jobject*)
|
||||
0x00006a2c method 2 getField(_JNIEnv*, _jobject*, _jobject*, _jstring*)
|
||||
0x00006abc method 3 getPathList(_JNIEnv*, _jobject*)
|
||||
0x00006af4 method 4 getDexElements(_JNIEnv*, _jobject*)
|
||||
0x00006b1c method 5 setField(_JNIEnv*, _jobject*, _jobject*, _jstring*, _jobject*)
|
||||
0x00006bb0 method 6 combineArray(_JNIEnv*, _jobject*, _jobject*)
|
||||
0x00006d00 method 7 injectAboveEqualApiLevel14(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x00006e5c method 8 appendArray(_JNIEnv*, _jobject*, _jobject*)
|
||||
0x00006f68 method 9 injectInAliyunOs(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x0000720c method 10 injectBelowApiLevel14(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x00006060 method 0 FindClass(char const*)
|
||||
0x00000000 [0x00006060 - 0x0000697c] 2332 jni class 0 _JNIEnv
|
||||
0x000074f8 jni method 0 inject(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x0000699c jni method 1 findBaseDexClassloader(_JNIEnv*, _jobject*)
|
||||
0x00006a2c jni method 2 getField(_JNIEnv*, _jobject*, _jobject*, _jstring*)
|
||||
0x00006abc jni method 3 getPathList(_JNIEnv*, _jobject*)
|
||||
0x00006af4 jni method 4 getDexElements(_JNIEnv*, _jobject*)
|
||||
0x00006b1c jni method 5 setField(_JNIEnv*, _jobject*, _jobject*, _jstring*, _jobject*)
|
||||
0x00006bb0 jni method 6 combineArray(_JNIEnv*, _jobject*, _jobject*)
|
||||
0x00006d00 jni method 7 injectAboveEqualApiLevel14(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x00006e5c jni method 8 appendArray(_JNIEnv*, _jobject*, _jobject*)
|
||||
0x00006f68 jni method 9 injectInAliyunOs(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x0000720c jni method 10 injectBelowApiLevel14(_JNIEnv*, _jobject*, _jstring*, _jstring*)
|
||||
0x00006060 jni method 0 FindClass(char const*)
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -581,6 +581,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "_JNIEnv",
|
||||
"addr": 0,
|
||||
"lang": "jni",
|
||||
"index": 0,
|
||||
"methods": [
|
||||
{
|
||||
@ -657,6 +658,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "SystemClassLoaderInjector",
|
||||
"addr": 0,
|
||||
"lang": "jni",
|
||||
"index": 1,
|
||||
"methods": [
|
||||
{
|
||||
@ -733,6 +735,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "std",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 2,
|
||||
"methods": [
|
||||
{
|
||||
@ -773,6 +776,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "std::exception",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 3,
|
||||
"methods": [
|
||||
{
|
||||
@ -795,6 +799,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "std::bad_exception",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 4,
|
||||
"methods": [
|
||||
{
|
||||
@ -817,6 +822,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1::__forced_unwind",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 5,
|
||||
"methods": [
|
||||
{
|
||||
@ -833,6 +839,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1::__foreign_exception",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 6,
|
||||
"methods": [
|
||||
{
|
||||
@ -849,6 +856,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__eh_globals_init",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 7,
|
||||
"methods": [
|
||||
{
|
||||
@ -865,6 +873,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 8,
|
||||
"methods": [
|
||||
{
|
||||
@ -887,6 +896,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1::__fundamental_type_info",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 9,
|
||||
"methods": [
|
||||
{
|
||||
@ -903,6 +913,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "std::type_info",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 10,
|
||||
"methods": [
|
||||
{
|
||||
@ -949,6 +960,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1::__pointer_type_info",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 11,
|
||||
"methods": [
|
||||
{
|
||||
@ -977,6 +989,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1::__pbase_type_info",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 12,
|
||||
"methods": [
|
||||
{
|
||||
@ -1005,6 +1018,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1::__si_class_type_info",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 13,
|
||||
"methods": [
|
||||
{
|
||||
@ -1039,6 +1053,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__cxxabiv1::__class_type_info",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 14,
|
||||
"methods": [
|
||||
{
|
||||
@ -1085,6 +1100,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__gnu_cxx",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 15,
|
||||
"methods": [
|
||||
{
|
||||
@ -1113,6 +1129,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__gnu_cxx::__concurrence_lock_error",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 16,
|
||||
"methods": [
|
||||
{
|
||||
@ -1135,6 +1152,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "__gnu_cxx::__concurrence_unlock_error",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 17,
|
||||
"methods": [
|
||||
{
|
||||
@ -1157,6 +1175,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "std::bad_cast",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 18,
|
||||
"methods": [
|
||||
{
|
||||
@ -1179,6 +1198,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"classname": "std::bad_typeid",
|
||||
"addr": 0,
|
||||
"lang": "c++",
|
||||
"index": 19,
|
||||
"methods": [
|
||||
{
|
||||
@ -4238,10 +4258,10 @@ NAME=ic (file Java)
|
||||
FILE=bins/java/Hello.class
|
||||
CMDS=ic
|
||||
EXPECT=<<EOF
|
||||
0x00000000 [0x0000022b - 0x000002aa] 127 class 0 Hello :: java/lang/Object
|
||||
0x0000022b method 0 <init>
|
||||
0x00000263 method 1 say
|
||||
0x000002aa method 2 main
|
||||
0x00000000 [0x0000022b - 0x000002aa] 127 java class 0 Hello :: java/lang/Object
|
||||
0x0000022b java method 0 <init>
|
||||
0x00000263 java method 1 say
|
||||
0x000002aa java method 2 main
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -4264,7 +4284,7 @@ NAME=icq (file Java)
|
||||
FILE=bins/java/Hello.class
|
||||
CMDS=icq
|
||||
EXPECT=<<EOF
|
||||
0x00000000 [0x0000022b - 0x000002aa] Hello java/lang/Object
|
||||
0x00000000 [0x0000022b - 0x000002aa] java Hello java/lang/Object
|
||||
EOF
|
||||
RUN
|
||||
|
||||
|
2348
test/db/formats/dex
2348
test/db/formats/dex
File diff suppressed because it is too large
Load Diff
@ -2,10 +2,13 @@ NAME=objc hello-objc not encrypted
|
||||
FILE=bins/mach0/hello-objc
|
||||
CMDS=ic
|
||||
EXPECT=<<EOF
|
||||
0x100001180 [0x100000da0 - 0x100000e20] 128 class 0 Person :: NSObject
|
||||
0x100000da0 method 0 sayHello
|
||||
0x100000df0 method 1 name
|
||||
0x100000e20 method 2 setName:
|
||||
0x100001180 [0x100000da0 - 0x100000e20] 128 objc class 0 Person :: NSObject
|
||||
0x100000da0 objc method 0 sayHello
|
||||
0x100000df0 objc method 1 name
|
||||
0x100000e20 objc method 2 setName:
|
||||
0x00000000 objc field 0 isa
|
||||
0x100001178 objc field 1 Person::(ivar)name
|
||||
0x00000000 objc field 2 Person::(property)name
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -13,8 +16,8 @@ NAME=objc generics-objc
|
||||
FILE=bins/mach0/generics-objc
|
||||
CMDS=ic
|
||||
EXPECT=<<EOF
|
||||
0x100001120 [0x100000e70 - 0x100000e70] 0 class 0 MyCustomClass :: NSObject
|
||||
0x100000e70 method 0 doSomethingWithGeneric:
|
||||
0x100001120 [0x100000e70 - 0x100000e70] 0 objc class 0 MyCustomClass :: NSObject
|
||||
0x100000e70 objc method 0 doSomethingWithGeneric:
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -64,8 +67,9 @@ NAME=objc categories (swift)
|
||||
FILE=bins/mach0/TestSwiftObjc
|
||||
CMDS=ic~ class
|
||||
EXPECT=<<EOF
|
||||
0x100003078 [0x100001ad0 - 0x100001ad0] 0 class 0 TestSwiftObjc.ThisIsASwiftClass(TEST)
|
||||
0x1000031e8 [0x100001d80 - 0x100001d80] 0 class 0 TestSwiftObjc.ThisIsASwiftClass :: NSObject
|
||||
0x100003078 [0x100001ad0 - 0x100001ad0] 0 ? class 0 TestSwiftObjc.ThisIsASwiftClass(TEST)
|
||||
0x00001f34 [0x00001f34 - 0x00001f34] 0 swift class 0 ThisIsASwiftClass
|
||||
0x1000031e8 [0x100001d80 - 0x100001d80] 0 objc class 0 TestSwiftObjc.ThisIsASwiftClass :: NSObject
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -112,7 +116,8 @@ class Test
|
||||
0x100003b68 method Test methodWithTwoArgs:secondArg:
|
||||
0x100003be0 method Test methodWithReturn
|
||||
0x100003aa0 method Test c someStaticMethod
|
||||
0x1000080f8 [0x100003a7c - 0x100003be0] 356 class 0 Test :: NSObject
|
||||
0x1000080f8 [0x100003a7c - 0x100003be0] 356 objc class 0 Test :: NSObject
|
||||
0x1000080f0 objc field 1 Test::(ivar)someField
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -123,13 +128,15 @@ aao
|
||||
ic
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
0x100001098 [0x100000c47 - 0x100000d1d] 214 class 0 Test :: NSObject
|
||||
0x100000d1d method 0 sayHello2
|
||||
0x100000cf7 method 1 sayHello:
|
||||
0x100000cce method 2 sayHello3::
|
||||
0x100000ca7 method 3 sayLong:
|
||||
0x100000c6a method 4 init
|
||||
0x100000c47 method 5 c callMeNot
|
||||
0x100001098 [0x100000c47 - 0x100000d1d] 214 objc class 0 Test :: NSObject
|
||||
0x100000d1d objc method 0 sayHello2
|
||||
0x100000cf7 objc method 1 sayHello:
|
||||
0x100000cce objc method 2 sayHello3::
|
||||
0x100000ca7 objc method 3 sayLong:
|
||||
0x100000c6a objc method 4 init
|
||||
0x100000c47 objc method 5 c callMeNot
|
||||
0x00000000 objc field 0 isa
|
||||
0x100001270 objc field 1 Test::(ivar)num
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -143,7 +150,11 @@ EXPECT=<<EOF
|
||||
0x100003238 method AppDelegate applicationDidFinishLaunching:
|
||||
0x100003288 method AppDelegate applicationWillTerminate:
|
||||
0x1000032d8 method AppDelegate applicationSupportsSecureRestorableState:
|
||||
0x100008a70 [0x10000313c - 0x100003184] 72 class 0 ViewController :: NSViewController
|
||||
0x100008a98 [0x100003238 - 0x1000032d8] 160 class 0 AppDelegate :: NSObject
|
||||
0x100008a70 [0x10000313c - 0x100003184] 72 objc class 0 ViewController :: NSViewController
|
||||
0x100008a98 [0x100003238 - 0x1000032d8] 160 objc class 0 AppDelegate :: NSObject
|
||||
0x00000000 objc field 0 AppDelegate::(property)hash
|
||||
0x00000000 objc field 1 AppDelegate::(property)superclass
|
||||
0x00000000 objc field 2 AppDelegate::(property)description
|
||||
0x00000000 objc field 3 AppDelegate::(property)debugDescription
|
||||
EOF
|
||||
RUN
|
||||
|
@ -19,13 +19,13 @@ EXPECT=<<EOF
|
||||
- 2 5 dalvik-32 ba:0x0004fb90 sz:230068 ?
|
||||
- 3 6 dalvik-32 ba:0x0008c0f8 sz:213928 ?
|
||||
* 4 7 dalvik-32 ba:0x000c4848 sz:286000 ?
|
||||
1383
|
||||
2652
|
||||
* 0 3 dalvik-64 ba:0x00000000 sz:2736 ?
|
||||
* 1 4 dalvik-32 ba:0x00005560 sz:285464 ?
|
||||
* 2 5 dalvik-32 ba:0x0004fb90 sz:230068 ?
|
||||
* 3 6 dalvik-32 ba:0x0008c0f8 sz:213928 ?
|
||||
* 4 7 dalvik-32 ba:0x000c4848 sz:286000 ?
|
||||
5363
|
||||
9784
|
||||
EOF
|
||||
RUN
|
||||
|
||||
@ -50,13 +50,13 @@ EXPECT=<<EOF
|
||||
- 2 5 dalvik-32 ba:0x0004fb90 sz:230068 ?
|
||||
- 3 6 dalvik-32 ba:0x0008c0f8 sz:213928 ?
|
||||
* 4 7 dalvik-32 ba:0x000c4848 sz:286000 ?
|
||||
1383
|
||||
2652
|
||||
* 0 3 dalvik-64 ba:0x00000000 sz:2736 ?
|
||||
* 1 4 dalvik-32 ba:0x00005560 sz:285464 ?
|
||||
* 2 5 dalvik-32 ba:0x0004fb90 sz:230068 ?
|
||||
* 3 6 dalvik-32 ba:0x0008c0f8 sz:213928 ?
|
||||
* 4 7 dalvik-32 ba:0x000c4848 sz:286000 ?
|
||||
5363
|
||||
9784
|
||||
EOF
|
||||
RUN
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user