sourcemod/public/asm/asm.h
Scott Ehlert ecec7dbef3 Deduplicate a number of files used by extensions by moving them to the public directory (bug 5341, r=psychonic).
These files include smsdk_ext.cpp, smsdk_ext.h, sm_memtable.h, CDetour/*, and asm/*.
The smsdk_config.h file for each extension has also been moved out of the 'sdk' directory into its parent.

--HG--
rename : extensions/bintools/sdk/smsdk_config.h => extensions/bintools/smsdk_config.h
rename : extensions/clientprefs/sdk/smsdk_config.h => extensions/clientprefs/smsdk_config.h
rename : extensions/cstrike/sdk/smsdk_config.h => extensions/cstrike/smsdk_config.h
rename : extensions/curl/sdk/smsdk_config.h => extensions/curl/smsdk_config.h
rename : extensions/geoip/sdk/smsdk_config.h => extensions/geoip/smsdk_config.h
rename : extensions/mysql/sdk/smsdk_config.h => extensions/mysql/smsdk_config.h
rename : extensions/regex/sdk/smsdk_config.h => extensions/regex/smsdk_config.h
rename : extensions/sdkhooks/sdk/smsdk_config.h => extensions/sdkhooks/smsdk_config.h
rename : extensions/sdktools/sdk/smsdk_config.h => extensions/sdktools/smsdk_config.h
rename : extensions/sqlite/sdk/smsdk_config.h => extensions/sqlite/smsdk_config.h
rename : extensions/structs/sdk/smsdk_config.h => extensions/structs/smsdk_config.h
rename : extensions/tf2/sdk/smsdk_config.h => extensions/tf2/smsdk_config.h
rename : extensions/topmenus/sdk/smsdk_config.h => extensions/topmenus/smsdk_config.h
rename : extensions/updater/sdk/smsdk_config.h => extensions/updater/smsdk_config.h
rename : extensions/sdktools/CDetour/detourhelpers.h => public/CDetour/detourhelpers.h
rename : extensions/sdktools/CDetour/detours.cpp => public/CDetour/detours.cpp
rename : extensions/sdktools/CDetour/detours.h => public/CDetour/detours.h
rename : extensions/sdktools/asm/asm.c => public/asm/asm.c
rename : extensions/sdktools/asm/asm.h => public/asm/asm.h
rename : public/sample_ext/sdk/smsdk_config.h => public/sample_ext/smsdk_config.h
rename : core/logic/sm_memtable.h => public/sm_memtable.h
rename : public/sample_ext/sdk/smsdk_ext.cpp => public/smsdk_ext.cpp
rename : public/sample_ext/sdk/smsdk_ext.h => public/smsdk_ext.h
2014-04-23 21:19:28 -05:00

41 lines
951 B
C

#ifndef __ASM_H__
#define __ASM_H__
#define OP_JMP 0xE9
#define OP_JMP_SIZE 5
#define OP_NOP 0x90
#define OP_NOP_SIZE 1
#define OP_PREFIX 0xFF
#define OP_JMP_SEG 0x25
#define OP_JMP_BYTE 0xEB
#define OP_JMP_BYTE_SIZE 2
#ifdef __cplusplus
extern "C" {
#endif
void check_thunks(unsigned char *dest, unsigned char *pc);
//if dest is NULL, returns minimum number of bytes needed to be copied
//if dest is not NULL, it will copy the bytes to dest as well as fix CALLs and JMPs
//http://www.devmaster.net/forums/showthread.php?t=2311
int copy_bytes(unsigned char *func, unsigned char* dest, int required_len);
//insert a specific JMP instruction at the given location
void inject_jmp(void* src, void* dest);
//fill a given block with NOPs
void fill_nop(void* src, unsigned int len);
//evaluate a JMP at the target
void* eval_jump(void* src);
#ifdef __cplusplus
}
#endif
#endif //__ASM_H__