Fix #251 - Segmentation fault running "rabin2 -I classes.dex"

This commit is contained in:
pancake 2013-10-14 23:28:17 +02:00
parent 077ab18846
commit de857fa91d
3 changed files with 7 additions and 2 deletions

View File

@ -117,6 +117,10 @@ static RBinInfo *info(RBinArch *arch) {
h->addr = 0x8;
h->from = 12;
h->to = arch->buf->length-h->from;
h = &ret->sum[2];
h->type = 0;
memcpy (h->buf, arch->buf->buf+8, 4);
{
ut32 *fc = (ut32 *)(arch->buf->buf + 8);

View File

@ -214,7 +214,8 @@ static int bin_info (RCore *r, int mode) {
RBinHash *h = &info->sum[i];
ut64 hash = r_hash_name_to_bits (h->type);
RHash *rh = r_hash_new (R_TRUE, hash);
len = r_hash_calculate (rh, hash, (const ut8*)r->bin->cur.buf+h->from, h->to);
len = r_hash_calculate (rh, hash, (const ut8*)
r->bin->cur.buf->buf+h->from, h->to);
//ut8 *p = r->bin->cur.buf+h->addr;
if (len<1) eprintf ("Invaild wtf\n");
r_hash_free (rh);

View File

@ -90,7 +90,7 @@ typedef struct r_bin_info_t {
int has_pi; // pic/pie
int big_endian;
ut64 dbg_info;
RBinHash sum[2];
RBinHash sum[3];
} RBinInfo;
typedef struct r_bin_object_t {