cssdm_detours.cpp
changeset 53 3c0401873aa6
parent 7 1107793f4b1c
child 184 7ddf645a50d5
     1.1 --- a/cssdm_detours.cpp	Sat Jun 26 13:56:59 2010 -0700
     1.2 +++ b/cssdm_detours.cpp	Sat Jun 26 15:19:42 2010 -0700
     1.3 @@ -77,7 +77,7 @@
     1.4  	 *
     1.5  	 * void OnClientDropWeapons(CBaseEntity *pEntity);
     1.6  	 */
     1.7 -#if defined PLATFORM_LINUX
     1.8 +#if defined PLATFORM_POSIX
     1.9  	IA32_Push_Rm_Disp8_ESP(jit, 4);					//push [esp+4]
    1.10  #elif defined PLATFORM_WINDOWS
    1.11  	IA32_Push_Reg(jit, REG_ECX);					//push ecx
    1.12 @@ -85,7 +85,7 @@
    1.13  	//call <function>
    1.14  	jitoffs_t call = IA32_Call_Imm32(jit, 0);		//call <function>
    1.15  	IA32_Write_Jump32_Abs(jit, call, (void *)OnClientDropWeapons);
    1.16 -#if defined PLATFORM_LINUX
    1.17 +#if defined PLATFORM_POSIX
    1.18  	IA32_Add_Rm_Imm8(jit, REG_ESP, 4, MOD_REG);		//add esp, 4
    1.19  #elif defined PLATFORM_WINDOWS
    1.20  	IA32_Pop_Reg(jit, REG_ECX);
    1.21 @@ -126,7 +126,7 @@
    1.22  	IA32_Mov_Reg_Rm(jit, REG_EBP, REG_ESP, MOD_REG);
    1.23  
    1.24  	/* Re-push everything, but setup our next call beforehand. */
    1.25 -#if defined PLATFORM_LINUX
    1.26 +#if defined PLATFORM_POSIX
    1.27  	IA32_Push_Rm_Disp8(jit, REG_EBP, 12);
    1.28  	IA32_Push_Rm_Disp8(jit, REG_EBP, 8);
    1.29  	/* Linux pushes four things, it seems */
    1.30 @@ -146,7 +146,7 @@
    1.31  	/* Make the ORIGINAL call */
    1.32  	jitoffs_t orig_call = IA32_Call_Imm32(jit, 0);
    1.33  
    1.34 -#if defined PLATFORM_LINUX
    1.35 +#if defined PLATFORM_POSIX
    1.36  	IA32_Add_Rm_Imm8(jit, REG_ESP, 16, MOD_REG);
    1.37  #endif
    1.38  
    1.39 @@ -157,7 +157,7 @@
    1.40  	IA32_Write_Jump32_Abs(jit, call, (void *)OnClientDroppedWeapon);
    1.41  
    1.42  	/* Do cleanup */
    1.43 -#if defined PLATFORM_LINUX
    1.44 +#if defined PLATFORM_POSIX
    1.45  	IA32_Add_Rm_Imm8(jit, REG_ESP, 8, MOD_REG);
    1.46  #elif defined PLATFORM_WINDOWS
    1.47  	//this probably isn't needed at all!
    1.48 @@ -169,7 +169,7 @@
    1.49  	//pop ebp
    1.50  	//ret / retn 12
    1.51  	IA32_Pop_Reg(jit, REG_EBP);
    1.52 -#if defined PLATFORM_LINUX
    1.53 +#if defined PLATFORM_POSIX
    1.54  	IA32_Return(jit);
    1.55  #elif defined PLATFORM_WINDOWS
    1.56  	IA32_Return_Popstack(jit, 0xC);