This commit is contained in:
pancake 2014-05-07 16:32:53 +02:00
commit b1349f8b14
5 changed files with 12 additions and 2 deletions

View File

@ -527,6 +527,7 @@ my_sprintf (struct arcDisState *state, char *buf, const char*format, ...)
break;
}
}
va_end (ap);
DOCOMM: *bp = 0;

View File

@ -208,7 +208,7 @@ st8 *get_AR_regs_class2(ut32 ins_bits, ut32 *ret_len, ut32 ins_pos, ut32 idx) {
case 30:
idx = get_ins_part(ins_pos, 3);
if(*ret_len)
if(ret_len)
*ret_len = 3;
if(type == 28) {

View File

@ -1394,6 +1394,7 @@ static int assemble (const char *str, unsigned char *_obuf) {
break;
case Z80_SEEK:
fprintf (stderr, "seek error\n");
break;
default:
printerr (1, "command or comment expected (was %s)\n", ptr);
return 0;

View File

@ -13,6 +13,13 @@ static int check(RBinFile *arch) {
extern struct r_bin_dbginfo_t r_bin_dbginfo_elf64;
extern struct r_bin_write_t r_bin_write_elf64;
static ut64 get_elf_vaddr64 (RBinFile *arch, ut64 baddr, ut64 paddr, ut64 vaddr) {
//NOTE(aaSSfxxx): since RVA is vaddr - "official" image base, we just need to add imagebase to vaddr
struct Elf_(r_bin_elf_obj_t)* obj = arch->o->bin_obj;
return obj->baddr - obj->boffset + vaddr;
}
static RBuffer* create(RBin* bin, const ut8 *code, int codelen, const ut8 *data, int datalen) {
ut32 p_start, p_phoff, p_phdr;
ut32 p_vaddr, p_paddr, p_fs, p_fs2;
@ -119,6 +126,7 @@ RBinPlugin r_bin_plugin_elf64 = {
.dbginfo = &r_bin_dbginfo_elf64,
.create = &create,
.write = &r_bin_write_elf64,
.get_vaddr = &get_elf_vaddr64,
};
#ifndef CORELIB

View File

@ -14,7 +14,7 @@ static int bitnum(int bit) {
/* TODO: do it more beautiful with structs and not spaguetis */
/* TODO: find a better method name */
R_API int r_hash_calculate(RHash *ctx, int algobit, const ut8 *buf, int len) {
if (len<0)
if (len <= 0)
return 0;
if (algobit & R_HASH_MD4) {
r_hash_do_md4 (ctx, buf, len);