From d3b3c9d36d4793823d99620fd2ee69bf03b91d3f Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Fri, 19 Feb 2010 16:15:25 +0000 Subject: [PATCH] fix some warning in swifi, make it installable --- commands/swifi/Makefile | 3 +++ commands/swifi/db_sym.c | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/commands/swifi/Makefile b/commands/swifi/Makefile index 7197e0dbf..5ddb56c20 100644 --- a/commands/swifi/Makefile +++ b/commands/swifi/Makefile @@ -7,6 +7,9 @@ CFLAGS=$(DEFINES) all: swifi rnd socket +install: swifi + install swifi /usr/bin/swifi + swifi: $(OBJ) $(CC) -o swifi $(OBJ) diff --git a/commands/swifi/db_sym.c b/commands/swifi/db_sym.c index c91528fa1..8d2e2af44 100644 --- a/commands/swifi/db_sym.c +++ b/commands/swifi/db_sym.c @@ -406,7 +406,7 @@ find_faulty_instr(db_expr_t off, int type, int *instr_len) /* 4a) bail out if instruction is leave (0xc9) */ if(cur_value-prev_value == 1) { unsigned char *c; - c=(char *) prev_value; + c=(unsigned char *) prev_value; if(text_read_ub(c)==0xc9) { if(verbose) printk("bailing out as we hit a leave\n"); found=0; @@ -418,7 +418,7 @@ find_faulty_instr(db_expr_t off, int type, int *instr_len) */ if(type==INIT_FAULT) { unsigned char *c; - c=(char *) prev_value; + c=(unsigned char *) prev_value; if(*c==0x66 || *c==0x67) c++; /* override prefix */ @@ -458,7 +458,7 @@ find_faulty_instr(db_expr_t off, int type, int *instr_len) */ unsigned char *c; - c=(char *) prev_value; + c=(unsigned char *) prev_value; /* look for repX prefix */ @@ -492,7 +492,7 @@ find_faulty_instr(db_expr_t off, int type, int *instr_len) */ if(cur_value>off && modAddr) { unsigned char *c; - c=(char *) modAddr; + c=(unsigned char *) modAddr; if( text_read_ub(c)>0x3f && text_read_ub(c)<0xc0 && (text_read_ub(c)&7)!=5 ) { found=1; @@ -505,7 +505,7 @@ find_faulty_instr(db_expr_t off, int type, int *instr_len) * movl=0x8a, movb=0x8b, mod=01XXX101 (disp8[ebp]), disp>0 */ unsigned char *c; - c=(char *) prev_value; + c=(unsigned char *) prev_value; if( text_read_ub(c)==0x8a || text_read_ub(c)==0x8b) { c++; if( ((text_read_ub(c++))&0xc7)==0x45 && (text_read_ub(c)&0x80)==0 ) { @@ -524,7 +524,7 @@ find_faulty_instr(db_expr_t off, int type, int *instr_len) * movl=0x8a, movb=0x8b, mod=01XXX101 (disp8[ebp]), disp>0 */ unsigned char *c; - c=(char *) prev_value; + c=(unsigned char *) prev_value; if (((text_read_ub(c) & 0xf8) == 0x50) || (text_read_ub(c) == 0xff)) { if (text_read_ub(c) == 0xff) { -- 2.44.0