AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Module: Okapi (https://forums.alliedmods.net/showthread.php?t=234986)

joaquimandrade 02-07-2014 02:51

Module: Okapi
 
2 Attachment(s)
Hello. I've spent the last weeks working a new module built around a new idea to avoid using signatures.
I've also took the chance to add it features based on the experience with the making of orpheu.
So this module should be more funnier to use but more powerful than orpheu.

The new idea, is about to identify a function, in an easy manner, hopefully resistant to game updates.
It consists on the following notions:

Half-Life functions are an interconnected tree around a core of engine and dll functions.
Each function has a great chance of being connected to the core functions, and for each connection,
there is a minimal length path between the points.
The idea is to identify a function, based on a group of minimal path length between that function and the core functions.
The tree is built with simple parsing of the assembly call instructions (for example, indirect calls are not parsed)
in the libraries, but the results are solid, from my testing. Trees vary a great deal between mod's and operative systems but
for the main purpose of providing a way of identifying a function in a manner resistant to game updates, they seem quite ok.

So let's see an example. Remember that the purpose of this kind of identifier is to resist to game updates, so I will use and old version
of half life dedicated server, against the latest version. This is to see if identifiers for one of them, find the same function on the other and vice-versa.
I don't know if there is a legal way of testing this for an old cs server, but if you know I would like you to tell me.

I had to pick a name for this identifier and I chose "treemap". From now on I will use this name to refer to them.

hlds versions used:
Code:

Protocol version 46, Exe version 4.1.1.1, Exe build: 10:25:33 Apr 30 2003 (2379)
Protocol version 48, Exe version 1.1.2.2 (valve), Exe build: 13:13:29 Aug 29 2013 (6153)

Now I will take a "random" function and use it to exemplify how treemaps work.

This is a function present in the engine library of the old HLDS server:

http://oi59.tinypic.com/2vci89f.jpg

Below, it has this portion that will make easy to identify it, in the other HLDS, to verify that we are dealing with the same function.


http://oi58.tinypic.com/in63o4.jpg


The first step now is to get it's treemap. This is done executing in the console the command:

Code:

okapi desc 0x550F0
http://oi60.tinypic.com/dzcpu.jpg

This part:

Code:

Map values {4,4,4,4,4,5,5,4,4,5,6,4,6,6,4,4,4,4,4,5,4,0,4,2,4,6,5,5,5,3,4,5,5,5,5,5,4,3,5,4,0,4,5,5,5,6,3,3,3,3,3,3,3,3,3,3,0,6,5,5,5,3,4,5,0,4,0,6,0,0,0,3,4,0,4,0,0,4,4,4,4,4,5,4,4,4,4,4,0,4,4,4,4,5,4,4,4,4,6,5,0,4,4,4,4,0,4,6,3,5,5,5,4,0,4,5,5,0,5,4,4,4,4,4,4,4,0,5,5,5,0,4,4,0,0,0,0,5,4,4,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0}
is the group of minimal distances that our function 0x550F0, takes to each of engine library core functions.

This:

Code:

"jp='.BU*&.B8u{.N#,#.Q'Z$.z=F'.uYU{.#dJ$. 2I$.T\F'.-)V{.Mp/$.RXS{.00}&.;WU{.!eu{.u~V{.UP_(.c:B.+5 &. 8u{.7,V{.*+w&.j+w&...&~3"
It's the same information, compressed in a string. That is what we will use in plugins.
This string is what I refer to as "treemap".

Now, we will use try to use it as identifier to search it in the new hlds.

Code:

okapi search "jp='.BU*&.B8u{.N#,#.Q'Z$.z=F'.uYU{.#dJ$. 2I$.T\F'.-)V{.Mp/$.RXS{.00}&.;WU{.!eu{.u~V{.UP_(.c:B.+5 &. 8u{.7,V{.*+w&.j+w&...&~3"
http://oi59.tinypic.com/2ibnc6r.jpg

In this image we can see a order list of the function that best match the given treemap.
The wanted case is that the first one is the same function in this hlds version as 0x550F0 is in the old one.

We can verify that it is the case in IDA:


http://oi60.tinypic.com/29qocv5.jpg


Now we can do the inverse:

http://oi61.tinypic.com/aayele.jpg


Now I will exemplify the use of a treemap in CS, with the InstallGameRules functions.
This would be the code to use the treemap, and create and hook the function.

PHP Code:

public OnInstallGameRules()
{
         new 
obj okapi_get_orig_return()
}

public 
plugin_precache()
{
             new 
install_gamerules_ptr okapi_mod_get_symbol_ptr("_Z16InstallGameRulesv"
    
              if(!
install_gamerules_ptr)
                           
install_gamerules_ptr okapi_get_treemap_ptr("[TG.;nC'.pbG.sXQ.J=g(.;OS'.ueA.1/.*K}.`/F'. 8u{.s9s{.Ohi(.,lm{.s9s{.2/#&.*0J.lE>'.1`}&.-]}&.vMa(.zp='.<cN'.=j12")
     
              new 
okapi_func:install_game_rules okapi_build_function(install_gamerules_ptr,arg_int)
     
              
okapi_add_hook(install_game_rules,"OnInstallGameRules",1)


Note that calls to okapi_get_treemap_ptr can take like 1 to 2 seconds, because many calculations are involved but, the results are then cached so
it just takes that time when the server is put on.

I will extend the talk about treemaps on a later ocasion.

Now, to show more of the module, I will continue from the previous code to show how to generically hook virtual functions.

PHP Code:

public OnAllowFlashlight()
{
             
okapi_set_return(1)
             return 
okapi_ret_supercede
}

public 
OnInstallGameRules()
{
             new 
obj okapi_get_orig_return()
    
             new 
okapi_func:allow_flashlight okapi_build_vfunc_ptr(obj,3,arg_int)
    
             
okapi_add_hook(allow_flashlight,"OnAllowFlashlight")


Note that 3 is the offset of the function CHalfLifeMultiplay::FAllowFlashlight in the CHalfLifeMultiplay vtable.

The module supports also searching for signatures with the functions

PHP Code:

okapi_mod_find_sig(const sig[],count)
okapi_engine_find_sig(const sig[],count

You can read about those functions and many others in the includes. Everything is sufficiently documented and I believe it's easy to use.

The signatures should look like this:

Code:

{0x51,0x56,"𐌻","𐌻",0x8B,0x86}
{0x51,0x56,0xDEF,0xDEF,0x8B,0x86}

using the symbol "𐌻", or any value above 0xFF, means that the particular bit is to be skipped from comparisons.

You can hook any function that uses a combination of these types:

PHP Code:

enum okapi_arg
{
             
arg_void,
             
arg_int,
             
arg_cbase,
             
arg_float,
             
arg_vec,
             
arg_entvars,
             
arg_string,
             
arg_edict,
             
arg_vec_ptr


that represent: int,CBaseEntity*,float,Vector,entvars_s*,char *,edict_t*,Vector*

The only exceptions is that when the function return a Vector. That is because when the function returns a Vector, a pointer is passed
in the beginning of the stack, so to handle that situation I would have to make a messy code so I prefered to ignore it.
Still, if you really need to hook or use a function that returns a Vector, it can be made with some lines of code using some tricks.

use "int" for long or for any value that you want to ignore.

Other thing present in the module are natives to handle memory directly.
You can use them to change any value in memory and for example to use structures not exposed via an API like playermove_s.

Example of replacing a string that was painful to do with orpheu, now takes one line:

PHP Code:

public plugin_init()
{
             
okapi_engine_replace_string("#      name userid uniqueid frag time ping loss adr^n","stuff^n")


This will change the max value of money a player can hold (note that this is probably not safe to use since there can be values replaced not related to the money)

PHP Code:

public plugin_init()
{
             
okapi_mod_replace_int(16000,1337000)


The module ended up a little big so I will show more stuff about it later.

Notes:

I tested the module alone since I wanted to make it a surprise so I expect it to need some enhancements or have some bugs.
When you use signatures to use functions, after you attach the module to a function, it modifies the bytes of the functions.
That means that if you use the same signature twice, the second will fail. This means that if you use the same signature in two
plugins, it will fail in one. To avoid this you can as an example, just to signature search in plugin_precache and hooking in plugin_init.

Again, I invite you to check the include files, I'm sure you will find there information that you will put to good use.
Also check the server console commands available, within the command okapi.

:twisted:



Arkshine 02-07-2014 07:50

Re: Module: Okapi
 
God, this name sucks. So weird I was hesitating to continue to read. :twisted:

The idea is interesting, but I'm rather skeptical on the reliability, as I remember depending binaries version, calls order are not always the same ; though this should be ok for most of things (probably!).

I'm not sure to like having a plugin more verbose, hardcoded and less readable. Also, even if dealing with config files is a pain, you can easily share them and build references index ; losing this might not a good point. I think it would be worth to add a parser for those whom want to use a config file ; something where we could use specify an alias for a treemap for example. Same for virtual functions offsets ; that's really not something which should be hardcoded.

Another thing, in your example with InstallGameRules, you're using "_Z16InstallGameRulesv", but that's not going to work for older binaries. So either you need to check x symbols name, or you need to use a treemap like you do ; but for the latter is it going to work properly for windows/linux/osx ?

Oh, where is the OSX support ? :twisted:

Except that, I guess it could be useful ; I like the idea to have something more 'universal' but I hate it will be stucked like Orpheu to some structures. Well, I guess there is Rage for that.

It's promising, and I would wish you improve usability in a more friendly way to have plugin more easy to maintain and more readable.

Well, good job, anyway, eheh. :)

meTaLiCroSS 02-07-2014 16:55

Re: Module: Okapi
 
Just, amazing.

I think that we would need to see some examples of many natives (I've read them :mrgreen:) with some kind of explanations, I'm just impressed :D

yokomo 02-08-2014 05:52

Re: Module: Okapi
 
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

joaquimandrade 02-08-2014 06:48

Re: Module: Okapi
 
Quote:

Originally Posted by yokomo (Post 2097174)

//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
}
[/PHP]

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.

ConnorMcLeod 02-08-2014 08:52

Re: Module: Okapi
 
Another userfriendly module.

bibu 02-08-2014 12:52

Re: Module: Okapi
 
Doesn't this work in listen server?

Quote:

] version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 13:14:12 Aug 29 2013 (6153)

I keep getting a bad load somehow.

DruGzOG 02-08-2014 13:08

Re: Module: Okapi
 
You mf, I like it. :twisted:

JusTGo 02-08-2014 16:18

Re: Module: Okapi
 
nice module; too bad i can use it or undrestand it.

joaquimandrade 02-08-2014 20:49

Re: Module: Okapi
 
Quote:

Originally Posted by bibu (Post 2097368)
Doesn't this work in listen server?

It should work, in my PC it does. The only reason for that to be that im seeing is the compilation. In which windows you are testing? I will compile it later with a lower visual studio version and in windows XP 32 bits. I will also test with metamod-p. Thanks for reporting


Quote:

Originally Posted by DruGzOG (Post 2097379)
You mf, I like it. :twisted:

:D thanks MF

Quote:

Originally Posted by JusTGo (Post 2097526)
nice module; too bad i can use it or undrestand it.

Thanks :twisted:

yokomo 02-09-2014 00:19

Re: Module: Okapi
 
Quote:

Originally Posted by joaquimandrade (Post 2097206)
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)



Bos93 02-09-2014 00:50

Re: Module: Okapi
 
yokomo, add support for Linux :fox: And update your build :crab:

Arkshine 02-09-2014 04:26

Re: Module: Okapi
 
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.

bibu 02-09-2014 12:10

Re: Module: Okapi
 
Quote:

Originally Posted by Arkshine (Post 2097772)
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...

Arkshine 02-09-2014 13:01

Re: Module: Okapi
 
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.

bibu 02-09-2014 15:00

Re: Module: Okapi
 
Outdated signatures also needs new files, where's the problem?

Arkshine 02-09-2014 15:18

Re: Module: Okapi
 
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.

yokomo 02-09-2014 15:27

Re: Module: Okapi
 
Quote:

Originally Posted by Arkshine (Post 2097772)
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.

Arkshine 02-09-2014 16:19

Re: Module: Okapi
 
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 :P), just depending the context, it won't be a recommended way.

Emp` 02-09-2014 17:24

Re: Module: Okapi
 
O-kapi or Ok-api?

joaquimandrade 02-10-2014 02:15

Re: Module: Okapi
 
The reason I decided not to use configuration files is that changing an sma and compiling is very easy and actually makes it faster for someone to: notice that a plugin was updated, updating by replacing files (you just have one file to update), see signatures that are being used in a plugin just by looking at a sma.

But what Arkshine said about centralizing signatures makes sense. And it can be added to okapi without changing it's way of working just like an extra feature. I may make it one day. :twisted:

Emp, it's just the animal name :twisted:

Anyone already have tried to work with treemaps?

Arkshine 02-10-2014 07:56

Re: Module: Okapi
 
Quote:

Anyone already have tried to work with treemaps?
http://endangeredliving.files.wordpr...pg?w=523&h=391

joropito 02-17-2014 09:30

Re: Module: Okapi
 
Quote:

Originally Posted by joaquimandrade (Post 2098196)
The reason I decided not to use configuration files is that changing an sma and compiling is very easy and actually makes it faster for someone to: notice that a plugin was updated, updating by replacing files (you just have one file to update), see signatures that are being used in a plugin just by looking at a sma.

The problem with that is you can't recompile every plugin published at each mod update.

Quote:

Originally Posted by joaquimandrade (Post 2098196)
But what Arkshine said about centralizing signatures makes sense. And it can be added to okapi without changing it's way of working just like an extra feature. I may make it one day.

Go ahead :)



Win / Linux / OSX cross treemaps compatibility should be awesome (I know, it's impossible but...)

meTaLiCroSS 03-31-2014 17:50

Re: Module: Okapi
 
1 Attachment(s)
Anyone knows about this error? (if traduction needed, tell me)

Arkshine 03-31-2014 18:56

Re: Module: Okapi
 
You can put the translation, but I think it says basically it doesn't found such function in Kernel32.dll, right ?

Do you have win XP or 2003 ?

meTaLiCroSS 03-31-2014 19:04

Re: Module: Okapi
 
Quote:

Originally Posted by Arkshine (Post 2118572)
You can put the translation, but I think it says basically it doesn't found such function in Kernel32.dll, right ?

Do you have win XP or 2003 ?

Right, and I have XP :crab: I should format this cr*p..

Arkshine 03-31-2014 19:19

Re: Module: Okapi
 
1 Attachment(s)
What about this.

meTaLiCroSS 03-31-2014 20:00

Re: Module: Okapi
 
Quote:

Originally Posted by Arkshine (Post 2118583)
What about this.

Works like a charm :crab: thanks you! What was the problem?

Arkshine 03-31-2014 20:52

Re: Module: Okapi
 
In s_library.cpp, where it uses GetModuleInformation, I've added :

#pragma comment(lib, "Psapi.lib")
#pragma comment(lib, "Kernel32.lib")

#define PSAPI_VERSION 1

So, it will use Psapi.lib instead. With windows 7, some changes have been done around this function and to keep compatibility with XP, you need to laod Psapi and define PSAPI version to 1.

meTaLiCroSS 03-31-2014 21:42

Re: Module: Okapi
 
Quote:

Originally Posted by Arkshine (Post 2118610)
In s_library.cpp, where it uses GetModuleInformation, I've added :

#pragma comment(lib, "Psapi.lib")
#pragma comment(lib, "Kernel32.lib")

#define PSAPI_VERSION 1

So, it will use Psapi.lib instead. With windows 7, some changes have been done around this function and to keep compatibility with XP, you need to laod Psapi and define PSAPI version to 1.

What a god, thanks buddy :3

EXteRmiNaToR 04-23-2014 20:20

Re: Module: Okapi
 
Quote:

Originally Posted by Arkshine (Post 2098053)

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.

This is what i found from here and there... http://www.sendspace.com/file/4bq3nn

meTaLiCroSS 06-20-2014 19:22

Re: Module: Okapi
 
Any way to reproduce OrpheuSetParamStructMember? By some way orpheu no longer works on my linux machine, and I don't wanna keep arguing with it and I changed to okapi.

meTaLiCroSS 06-23-2014 02:47

Re: Module: Okapi
 
Does it is wrong? It just crashes

PHP Code:

stock ModCall_PackPlayerItem(iIdiWeaponEntbool:bAllAmmo)
{
    static 
okapi_func:hPackPlayerItem;

    if(!
hPackPlayerItem)
    {
        new 
iSig[] = { 0x83,0xDEF,0xDEF,0x85,0xDEF,0x89,0xDEF,0xDEF,0xDEF,0x89,0xDEF,0x89,0xDEF,0xDEF,0xDEF,0x89,0xDEF,0x89,0xDEF,0xDEF,0xDEF,0x89 }
        
hPackPlayerItem okapi_build_function(okapi_mod_find_sig(iSigsizeof iSig), /*ret*/arg_voidarg_cbasearg_cbasearg_int)
    }

    
okapi_call_ex(hPackPlayerItemiIdiWeaponEntbAllAmmo 0)


okapi_mod_find_sig returned 0 as from I see

HamletEagle 10-23-2014 14:58

Re: Module: Okapi
 
Why it show nothing when trying to get a treemap ?

Code:


] okapi desc mod 0x550F0

######### OKAPI #########


#########################

And also:
Code:

] okapi search "[TG.;nC'.pbG.sXQ.J=g(.;OS'.ueA.1/.*K}.`/F'. 8u{.s9s{.Ohi(.,lm{.s9s{.2/#&.*0J.lE>'.1`}&.-]}&.vMa(.zp='.<cN'.=j12"

######### OKAPI #########


#########################


Bos93 10-24-2014 10:38

Re: Module: Okapi
 
meTaLiCroSS, i don't found your signature.

Try:

PHP Code:

0x83,0xEC,0x0C,0x53,0x57,0x8B,0x7C,0x24,0x1C,0x33,0xDB,0x3B,0xFB 


meTaLiCroSS 10-27-2014 19:21

Re: Module: Okapi
 
Quote:

Originally Posted by Bos93 (Post 2215202)
meTaLiCroSS, i don't found your signature.

Try:

PHP Code:

0x83,0xEC,0x0C,0x53,0x57,0x8B,0x7C,0x24,0x1C,0x33,0xDB,0x3B,0xFB 


Linux or Windows?

EDIT: It's strange. https://forums.alliedmods.net/showpo...postcount=1267

Arkshine 10-28-2014 05:48

Re: Module: Okapi
 
Quote:

Originally Posted by meTaLiCroSS (Post 2155965)
Does it is wrong? It just crashes

PHP Code:

stock ModCall_PackPlayerItem(iIdiWeaponEntbool:bAllAmmo)
{
    static 
okapi_func:hPackPlayerItem;

    if(!
hPackPlayerItem)
    {
        new 
iSig[] = { 0x83,0xDEF,0xDEF,0x85,0xDEF,0x89,0xDEF,0xDEF,0xDEF,0x89,0xDEF,0x89,0xDEF,0xDEF,0xDEF,0x89,0xDEF,0x89,0xDEF,0xDEF,0xDEF,0x89 }
        
hPackPlayerItem okapi_build_function(okapi_mod_find_sig(iSigsizeof iSig), /*ret*/arg_voidarg_cbasearg_cbasearg_int)
    }

    
okapi_call_ex(hPackPlayerItemiIdiWeaponEntbAllAmmo 0)


okapi_mod_find_sig returned 0 as from I see

I can't find your signature in mp.dll.
I don't know what build you're using but for me, signature of packPlayerItem is more:

Code:

83 ? ? 53 57 8B ? ? ? 33 ? 3B

Arkshine 10-28-2014 12:11

Re: Module: Okapi
 
Quote:

Originally Posted by meTaLiCroSS (Post 2154844)
Any way to reproduce OrpheuSetParamStructMember? By some way orpheu no longer works on my linux machine, and I don't wanna keep arguing with it and I changed to okapi.

Don't remember exactly how this native is used, but it's just basically having a base address and using offset to be positioned to the member you want to get/set.

meTaLiCroSS 10-28-2014 23:11

Re: Module: Okapi
 
Quote:

Originally Posted by Arkshine (Post 2216864)
I can't find your signature in mp.dll.
I don't know what build you're using but for me, signature of packPlayerItem is more:

Code:

83 ? ? 53 57 8B ? ? ? 33 ? 3B

I was searching on Linux libraries, also the sig that I posted was given by you :p because the symbolic name of the packPlayerItem function doesn't works on updated libraries, same as outdated libraries. But when executing that code, just crashes, maybe there's something wrong with the signature of bytes, because I got the same values that you gave me when I did it by myself :s

Jhob94 10-29-2014 06:37

Re: Module: Okapi
 
Arkshine you must wait 14 days to bump, read rules :mrgreen:
Btw I know that Quim quited amxx coding, but does he still supporting his plugins/modules?


All times are GMT -4. The time now is 16:27.

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