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(RoundtimeMaxCheck, 32400) //max check 0x94163
okapi_set_ptr_int(RoundtimeMaxCvarSet, 540) //max cvar set 0x9416A
okapi_set_ptr_int(RoundtimeMaxSet, 32400) //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
Code:
] meta version
Metamod v1.19p32 2007/08/12 (5:13)
by Will Day
http://www.metamod.org/
Patch: Metamod-P (mm-p) v32
by Jussi Kivilinna
http://metamod-p.sourceforge.net/
compiled: Jan 21 2013, 20:26:41 EET (default)
] meta list
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.8.2-d ini Start ANY
[ 2] Noob4Dead RUN - n4d_amxx.dll v0.0.2 pl1 ANY ANY
[ 3] FakeMeta RUN - fakemeta_amxx.dl v1.8.2-d pl1 ANY ANY
[ 4] okapi RUN - okapi_amxx.dll v1.0 pl1 ANY ANY
4 plugins, 4 running
] amxx version
AMX Mod X 1.8.2-dev (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "Damaged Soul" Ehlert
Compiled: Jul 1 2011, 11:51:18
Build ID: 1.8.2-dev 24:5c45e45c22cf
Core mode: JIT+ASM32
] amxx plugins
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.8.2 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.8.2 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.8.2 AMXX Dev Team adminhelp.amxx running
[ 4] Multi-Lingual System 1.8.2 AMXX Dev Team multilingual.am running
[ 5] Menus Front-End 1.8.2 AMXX Dev Team menufront.amxx running
[ 6] Commands Menu 1.8.2 AMXX Dev Team cmdmenu.amxx running
[ 7] Players Menu 1.8.2 AMXX Dev Team plmenu.amxx running
[ 8] Admin Votes 1.8.2 AMXX Dev Team adminvote.amxx running
[ 9] CSBot Init 0.0.1 wbyokomo CSBotInit.amxx running
[ 10] Okapi Test 0.0.1 wbyokomo ab.amxx debug
10 plugins, 10 running
] version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 13:14:12 Aug 29 2013 (6153)
] status
hostname: Counter-Strike
version : 48/1.1.2.7/Stdio 6153 secure (10)
tcp/ip : 192.168.1.37:27015
map : de_dust2 at: -735 x, -703 y, 181 z
players : 10 active (32 max)
# name userid uniqueid frag time ping loss adr
# 1 "[NOOB]gojila" 1 STEAM_0:0:28539861 0 00:47 0 0
# 2 ". g i n" 2 BOT 0 00:52 0 0
# 3 "EvilPlatipus" 3 BOT 0 00:52 0 0
# 4 "L.U.C.K.Y shot" 4 BOT 0 00:52 0 0
# 5 "LOL | PRO DODGE" 5 BOT 0 00:52 0 0
# 6 "v0ljIn.-wD !!" 6 BOT 0 00:52 0 0
# 7 "Mammon" 7 BOT 0 00:52 0 0
# 8 "[B]anaNa" 8 BOT 0 00:52 0 0
# 9 "Hidden~Ninpo" 9 BOT 0 00:52 0 0
#10 "VIP-Numb." 10 BOT 0 00:52 0 0
10 users
__________________