asm/asm.h
author Ruben Gonzalez <drifter01620@gmail.com>
Wed Nov 12 08:29:24 2014 -0500 (2014-11-12)
changeset 197 fd967f09ab68
parent 184 7ddf645a50d5
permissions -rw-r--r--
Update CSGO Gamedata
     1 #ifndef __ASM_H__
     2 #define __ASM_H__
     3 
     4 #define OP_JMP				0xE9
     5 #define OP_JMP_SIZE			5
     6 
     7 #define OP_NOP				0x90
     8 #define OP_NOP_SIZE			1
     9 
    10 #define OP_PREFIX			0xFF
    11 #define OP_JMP_SEG			0x25
    12 
    13 #define OP_JMP_BYTE			0xEB
    14 #define OP_JMP_BYTE_SIZE	2
    15 
    16 #ifdef __cplusplus
    17 extern "C" {
    18 #endif
    19 
    20 void check_thunks(unsigned char *dest, unsigned char *pc);
    21 
    22 //if dest is NULL, returns minimum number of bytes needed to be copied
    23 //if dest is not NULL, it will copy the bytes to dest as well as fix CALLs and JMPs
    24 //http://www.devmaster.net/forums/showthread.php?t=2311
    25 int copy_bytes(unsigned char *func, unsigned char* dest, int required_len);
    26 
    27 //insert a specific JMP instruction at the given location
    28 void inject_jmp(void* src, void* dest);
    29 
    30 //fill a given block with NOPs
    31 void fill_nop(void* src, unsigned int len);
    32 
    33 //evaluate a JMP at the target
    34 void* eval_jump(void* src);
    35 
    36 #ifdef __cplusplus
    37 }
    38 #endif
    39 
    40 #endif //__ASM_H__