Raised This Month: $12 Target: $400
 3% 

Module: Okapi


Post New Thread Reply   
 
Thread Tools Display Modes
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 02-09-2014 , 00:19   Re: Module: Okapi
Reply With Quote #11

Quote:
Originally Posted by joaquimandrade View Post
This step is incorrect

PHP Code:
okapi_set_ptr_int(RoundtimeMaxCheck32400//max check 0x94163 
That's because you are passing an offset, not the actual address you want.
You would do

PHP Code:
okapi_set_ptr_int(okapi_mod_get_offset_ptr(RoundtimeMaxCheck), 32400
To check if the signature is being searched correctly do:

PHP Code:
new offset okapi_mod_get_ptr_offset(okapi_mod_find_sig(SignA,8))
server_print("offset %x^n",offset
(Notice the name of this function is "the inverse" of the one used before)

After you patch the value by using a signature, remember that after map restart, the signature will be searched again, but now will not be found in the same memory location since it was altered. So be sure to check if the result from okapi_mod_find sig is not null, and be sure to confirm that your signature is unique.
Thanks for your info, now i can patch max roundtime. This is simple compare to Orpheu, just need 1 plugin, no extra files.

PHP Code:
#include <amxmodx>
#include <okapi>

//Offset from mp.dll build 4382 by IDA PRO. 
#define RoundtimeMaxCheck 0x94164
#define RoundtimeMaxCvarSet 0x9416D
#define RoundtimeMaxSet 0x94180

public plugin_init()
{
    
register_plugin("Okapi MaxRoundtime""0.0.1""wbyokomo")
    
    
okapi_set_ptr_int(okapi_mod_get_offset_ptr(RoundtimeMaxCheck), 32400)
    
okapi_set_ptr_int(okapi_mod_get_offset_ptr(RoundtimeMaxCvarSet), 540)
    
okapi_set_ptr_int(okapi_mod_get_offset_ptr(RoundtimeMaxSet), 32400)

__________________
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
Bos93
Veteran Member
Join Date: Jul 2010
Old 02-09-2014 , 00:50   Re: Module: Okapi
Reply With Quote #12

yokomo, add support for Linux And update your build
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-09-2014 , 04:26   Re: Module: Okapi
Reply With Quote #13

There is nothing wrong having extra files, and this is wrong to hardcode things in a plugin. Config file allows to organize and group together static data. Way more easy to maintain and to share.
Working with offset directly could be fine if you know you will never update your server, which is probably only for non-steam server. Otherwise it will break most likely at each update, so it may appear more simple but it's just an horrible way.
__________________

Last edited by Arkshine; 02-09-2014 at 06:23.
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 02-09-2014 , 12:10   Re: Module: Okapi
Reply With Quote #14

Quote:
Originally Posted by Arkshine View Post
Otherwise it will break most likely at each update..
Doubt there will be any update anymore. And if so, like 1-2 times in a year, if at all...
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Old 02-09-2014, 12:15
bibu
This message has been deleted by ConnorMcLeod. Reason: you are not new here, you know rules
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-09-2014 , 13:01   Re: Module: Okapi
Reply With Quote #15

Quote:
Doubt there will be any update anymore
What a solid argument, eh.

You can hardcode thing for yourself if it makes you happy, but when a community is involved, it should be avoid as much as possible (for reasons said above).
Instead of trying the easy way, using a smart one would be more appropriate. It's quite some common sense here.
__________________

Last edited by Arkshine; 02-09-2014 at 13:02.
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 02-09-2014 , 15:00   Re: Module: Okapi
Reply With Quote #16

Outdated signatures also needs new files, where's the problem?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-09-2014 , 15:18   Re: Module: Okapi
Reply With Quote #17

Signatures are more reliable than offsets, for your information.
Offsets change at each update. Signatures are based on bytes, and won't change by magic unless code has been changed in this area.

If the current known signatures have changed, it's because Valve has updated their compiling tools recently and because the jump was big (gcc v2 -> v4), a lot of changes have happened. That's something which happens one time.

Offsets are generally for testing purpose only.
__________________

Last edited by Arkshine; 02-09-2014 at 15:36.
Arkshine is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 02-09-2014 , 15:27   Re: Module: Okapi
Reply With Quote #18

Quote:
Originally Posted by Arkshine View Post
There is nothing wrong having extra files, and this is wrong to hardcode things in a plugin. Config file allows to organize and group together static data. Way more easy to maintain and to share.
Working with offset directly could be fine if you know you will never update your server, which is probably only for non-steam server. Otherwise it will break most likely at each update, so it may appear more simple but it's just an horrible way.
As far as i know HLDS always update server engine (swds.dll for windows), mod library (mp.dll for windows) update so less, once / 1-2 years. I don't want to argue, but as bibu said signature files also need to update. So it just the same as edit .sma file and compile. Sometimes people (newbie) got problem with Orpheu because of replacing wrong signature files.

**Edit**
Okapi also support signature scan, the only different is it located in .sma file.
__________________
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

Last edited by yokomo; 02-09-2014 at 15:30.
yokomo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-09-2014 , 16:19   Re: Module: Okapi
Reply With Quote #19

I'm thinking community, you're thinking for yourself or the easiest way. If you don't understand, well, I can do nothing about it. Trying to argue based on Valve "possible" update is irrelevant. The point is to decide intelligently whether hardcoding is necessary from the context. Well, could you imagine how would be AMXX without configuration files ? It would be hell to maintain and to configure. Generally, like you would want to separate CSS from HTML, you would want to separate static datas/customization from AMXX code for the sake of flexibility, shareability, and maintainability. At least for AMXX plugins, it's really useful, and even if you need to deal with files, at the end it will be become helpful. Also it's more easy for an user to modify a configuration file than recompiling a plugin.

About orpheu signatures, we need someone to create a thread regrouping all known signatures; then it would be more easy to deal with updates and having a more consistent use. But, the problem is all people are lazy or/and busy as hell, ahah.

Anyway you do what you want, it's fine (but don't use offset, tree and signatures are fine ), just depending the context, it won't be a recommended way.
__________________

Last edited by Arkshine; 02-09-2014 at 16:22.
Arkshine is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-09-2014 , 17:24   Re: Module: Okapi
Reply With Quote #20

O-kapi or Ok-api?
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode