Thread: Module: Okapi
View Single Post
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 02-08-2014 , 05:52   Re: Module: Okapi
Reply With Quote #4

Hi, can you write a tutorial how to patch value in mod dll using this module?

Ok i try to patch max roundtime:
PHP Code:
#include <amxmodx>
#include <okapi>

//Offset from mp.dll build 4382 by IDA PRO.
#define RoundtimeMaxCheck 0x94163
#define RoundtimeMaxCvarSet 0x9416A
#define RoundtimeMaxSet 0x9417D

//new const SignA[] = {0x3D,0x1C,0xDEF,0xDEF,0xDEF,0x7E,0x1C,0x68}
//new const SignB[] = {0x68,0xDEF,0xDEF,0xDEF,0x41,0x68,0x84,0xE9}
//new const SignC[] = {0xC7,0x46,0x3C,0x1C,0xDEF,0xDEF,0xDEF,0xEB}

public plugin_init()
{
    
register_plugin("Okapi Test""0.0.1""wbyokomo")
    
    
//Just testing searching signature, found and no crash.
    //server_print("SignA: %s", okapi_mod_find_sig(SignA,8) ? "Found":"Not Found")
    //server_print("SignB: %s", okapi_mod_find_sig(SignB,8) ? "Found":"Not Found")
    //server_print("SignC: %s", okapi_mod_find_sig(SignC,8) ? "Found":"Not Found")
    
    //Patch roundtime, game crash here.
    
okapi_set_ptr_int(RoundtimeMaxCheck32400//max check 0x94163
    
okapi_set_ptr_int(RoundtimeMaxCvarSet540//max cvar set 0x9416A
    
okapi_set_ptr_int(RoundtimeMaxSet32400//max set 0x9417D

I wonder why my game always crash? (running amxmodx on localserver). I bet my offsets are not correct, i'm using mp.dll from build 4382. Yes i know it is outdated but i still prefer to use this. My client is up to date according to Steam, but i just replace the mp.dll.

Server/client details
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline