mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-22 05:37:06 +00:00
renamed gum_read_sleb128 to r_sleb128
this API has been borrowed from the awesome Frida project
This commit is contained in:
parent
f2dc07b17a
commit
d6d453b4a1
@ -371,7 +371,7 @@ static void dex_parse_debug_item(RBinFile *binfile, RBinDexObj *bin, RBinDexClas
|
||||
p4 = r_uleb128 (p4, p4_end - p4, &addr_diff);
|
||||
address += addr_diff;
|
||||
} else if (opcode == 0x2) { // DBG_ADVANCE_LINE
|
||||
st64 line_diff = gum_read_sleb128 (&p4, p4_end);
|
||||
st64 line_diff = r_sleb128 (&p4, p4_end);
|
||||
line += line_diff;
|
||||
} else if (opcode == 0x3) { // DBG_START_LOCAL
|
||||
ut64 register_num;
|
||||
@ -983,7 +983,7 @@ static const ut8* parse_dex_class_method(RBinFile *binfile, RBinDexObj *bin, RBi
|
||||
int off = MC + t + tries_size*8 + handler_off;
|
||||
p3 = r_buf_get_at (binfile->buf, off, NULL);
|
||||
p3_end = p3 + binfile->buf->length - off;
|
||||
st64 size = gum_read_sleb128 (&p3, p3_end);
|
||||
st64 size = r_sleb128 (&p3, p3_end);
|
||||
//eprintf("handler_off=0x%x handlers_size=0x%x offset=0x%x\n", handler_off, size, off);
|
||||
|
||||
|
||||
@ -1616,4 +1616,4 @@ RLibStruct radare_plugin = {
|
||||
.data = &r_bin_plugin_dex,
|
||||
.version = R2_VERSION
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
@ -9,5 +9,5 @@ R_API const ut8 *r_uleb128(const ut8 *data, int datalen, ut64 *v);
|
||||
R_API const ut8 *r_uleb128_decode(const ut8 *data, int *datalen, ut64 *v);
|
||||
R_API const ut8 *r_uleb128_encode(const ut64 s, int *len);
|
||||
R_API const ut8 *r_leb128(const ut8 *data, st64 *v);
|
||||
R_API st64 gum_read_sleb128(const ut8 **data, const ut8 *end);
|
||||
R_API st64 r_sleb128(const ut8 **data, const ut8 *end);
|
||||
#endif // R_ULEB128_H
|
||||
|
@ -92,9 +92,11 @@ R_API const ut8 *r_leb128(const ut8 *data, st64 *v) {
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
//API borrowed from frida
|
||||
#define G_GINT64_CONSTANT(val) (val##L)
|
||||
|
||||
R_API st64 gum_read_sleb128(const ut8 **data, const ut8 *end) {
|
||||
R_API st64 r_sleb128(const ut8 **data, const ut8 *end) {
|
||||
const ut8 *p = *data;
|
||||
st64 result = 0;
|
||||
int offset = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user