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

Module: Orpheu (v2.6.3)


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-21-2016 , 12:46   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1451

You must create a memory file called "weaponModels". Go to addons/amxmodx/configs/orpheu/memory and create a file called "weaponModels". Copy inside it:
PHP Code:
{
    
"name"        "weaponModels",
    
"library"     "mod",
    
"type"        "string",
    
"memoryType"  "data"

Quote:
Also, I am doing this though orpheu because (as I was told) it is a lot faster/more efficient for the server to handle. I would like to change a huge amount of resources, (well I'd think they're huge) including sprites & all models.
Orpheu only allows direct interaction with the server. When you use orpheu to replace strings(yes, it can replace any string from the game, not only resources) it directly change the value into the code.

Imagine memory like this:

Code:
---------------------------------
And let's say you want to replace the red block with a blue one. Using orpheu you will change it completly.
Code:
---------------------------------
The only advantage here is that replacing with orpheu does not increase precache list(since you remove the old block and insert yours). The limit is 512 resources, this is why it is important to avoid increasing precache list.

Since you are beginner, I honestly don't know how to explain it simpler and clearer.

Quote:
If that plugin can do it as efficient as orpheu functions/swaps then I shall swiftly change to this. In the meantime and for learning purposes, what does that error require to fix?
The plugin I gave you is basically using orpheu to replace string in memory, but does it in a sane way, with proper checks. It also take care of unpatching.
It can also replace player models, in dynamic replacement mode.
__________________

Last edited by HamletEagle; 04-21-2016 at 12:50.
HamletEagle is offline
axfalcon
Junior Member
Join Date: Apr 2016
Old 04-21-2016 , 21:44   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1452

Ah this makes sense, thanks I understood the memory thing, just hazy on the terms and how to execute such.

So I used that plugin and it's working like a charm!

And thanks for the code btw Was looking for this for some time. I plan on replacing all weapons and player models if I can.

I'm now looking for a way to intercept the HUD color string/function/parameter from the client.dll.

I'm guessing this file is client-side only, and I'm unable in any way to change the color of the HUD to white (and remove the yellow color that is pre-set in the client.dll file).

1. Can orpheu allow me to intercept this string/function/parameter also from the client.dll?

2. Will the plugin provided have the same size precache list when compared to doing it "natively" in orpheu as I have begun in above posts?
axfalcon is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-22-2016 , 07:12   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1453

1.You can't control client side things from the server.
2.If you use complete replacement mode, your precache list won't increase(it's using orpheu to patch memory) because old models are not precached. The reason why patch code is different is because it handle situations like:
Code:
model1 model
model2 model
So when you replace different models with same string. With your code, you won't be able to unpatch later. What I did asw to save the address of each string, so I'll know what to do later.

If you use dynamic replacement mode(and you must use it for player models) precache list will be increased. I don't think you have reasons to worry if you are replacing few player models.
__________________

Last edited by HamletEagle; 04-22-2016 at 07:14.
HamletEagle is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 04-22-2016 , 20:16   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1454

Is type edict_t * supported?
__________________
youtube:
@holla16

Last edited by 11922911; 04-22-2016 at 22:53.
11922911 is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 04-22-2016 , 22:52   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1455

Quote:
Originally Posted by 11922911 View Post
Is type edict_t * supported?
It should be edict_s * in Orpheu? Am I right?
__________________
youtube:
@holla16

Last edited by 11922911; 04-22-2016 at 23:39.
11922911 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-23-2016 , 04:28   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1456

Quote:
Originally Posted by 11922911 View Post
It should be edict_s * in Orpheu? Am I right?
Yes.
__________________
HamletEagle is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-23-2016 , 06:56   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1457

Just detected a little bug.

This happens when HOOKING the function "packPlayerItem"

Quote:
L 07/23/2016 - 07:50:29: "PM32<1><STEAM_0:0:22345XXX><CT>" committed suicide with "trigger_hurt" (world)
L 07/23/2016 - 07:50:29: World triggered "Round_Draw" (CT "0") (T "0")
L 07/23/2016 - 07:50:29: World triggered "Round_End"

Program received signal SIGSEGV, Segmentation fault.
0xb38cf733 in CBaseEntityHandler::convertToAmx(int&, long, ConvertMode) () from cstrike/addons/amxmodx/modules/orpheu_amxx_i386.so
(gdb) bt
#0 0xb38cf733 in CBaseEntityHandler::convertToAmx(int&, long, ConvertMode) () from cstrike/addons/amxmodx/modules/orpheu_amxx_i386.so
#1 0xb38b2749 in Function::convertArgumentsToAmx() () from cstrike/addons/amxmodx/modules/orpheu_amxx_i386.so
#2 0xb38b3aa3 in Function::hook() () from cstrike/addons/amxmodx/modules/orpheu_amxx_i386.so
#3 0xb38b3bde in Hook(long, ...) () from cstrike/addons/amxmodx/modules/orpheu_amxx_i386.so
#4 0xb3ad5270 in CBasePlayer:ackDeadPlayerItems (this=0x8e4ec30) at ../cstrike/dlls/player.cpp:1822
#5 0xb3ad5570 in CBasePlayer:layerDeathThink (this=0x8e4ec30) at ../cstrike/dlls/player.cpp:4062
#6 0xb3ad5da5 in CBasePlayer:layerDeathThink (this=0x8e4ec30) at ../cstrike/dlls/player.cpp:4044
#7 CBasePlayer:reThink (this=0x8e4ec30) at ../cstrike/dlls/player.cpp:4826
#8 CBasePlayer:reThink (this=0x8e4ec30) at ../cstrike/dlls/player.cpp:4717
#9 0xb3d2cbca in ?? () from /home/server/test/./cstrike/addons/metamod/dlls/metamod.so
#10 0xb78ac02f in SV_PlayerRunPreThink (ucmd=0xbfffeb20, random_seed=1551) at ../engine/sv_user.c:761
#11 SV_RunCmd (ucmd=0xbfffeb20, random_seed=1551) at ../engine/sv_user.c:1001
#12 0xb78acfc0 in SV_ParseMove (pSenderClient=<value optimized out>) at ../engine/sv_user.c:1998
#13 0xb78ad3f5 in SV_ExecuteClientMessage (cl=0xb3fc4f0 at ../engine/sv_user.c:2221
#14 0xb789f723 in SV_ReadPackets () at ../engine/sv_main.c:4871
#15 0xb789f99e in SV_Frame () at ../engine/sv_main.c:9231
#16 0xb7867e92 in _Host_Frame (time=0.00151373097) at ../engine/host.c:1404
#17 0xb7868252 in Host_Frame (time=0.00151373097, iState=1, stateInfo=0xbffffa4c) at ../engine/host.c:1522
#18 0xb788c8dc in CEngine::Frame (this=0xb79236a0) at ../engine/sys_engine.cpp:245
#19 0xb7889c43 in CDedicatedServerAPI::RunFrame (this=0xb791ed00) at ../engine/sys_dll2.cpp:1235
#20 CDedicatedServerAPI::RunFrame (this=0xb791ed00) at ../engine/sys_dll2.cpp:1226
#21 0x08049c65 in RunServer () at ../dedicated/sys_ded.cpp:766
#22 0x08049472 in main (argc=14, argv=0xbffffc94) at ../dedicated/sys_ded.cpp:1146
Using 1.8.2, fresh installation, updated,

Signature supposes to be without troubles:

Code:
		Parsing file "packPlayerItem" started
				Argument type "CBasePlayer *" validated
				Argument type "CBasePlayerItem *" validated
				Argument type "bool" validated
				Searching for signature "[0x83][*][*][0x85][*](...)" ... FOUND
		Parsing file "packPlayerItem" ended
Taken from https://forums.alliedmods.net/showpo...postcount=1267 , double checked on IDA Pro.

Code:
{
    "name"      : "packPlayerItem",
    "library"   : "mod",
    "arguments" :
    [
        {
            "type" : "CBasePlayer *"
        },
        {
            "type" : "CBasePlayerItem *"
        },
        {
            "type" : "bool"
        }
    ],
    "identifiers" :
    [
        {
            "os"    : "linux",
            "mod"   : "cstrike",
			"value" : [0x83,"*","*",0x85,"*",0x89,"*","*","*",0x89,"*",0x89,"*","*","*",0x89,"*",0x89,"*","*","*",0x89]
        }
    ]
}
Anything else needed?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross

Last edited by meTaLiCroSS; 07-23-2016 at 06:57.
meTaLiCroSS is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-23-2016 , 07:27   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1458

Are you doing anything else or just hooking the function?
__________________
HamletEagle is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-23-2016 , 07:45   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1459

Quote:
Originally Posted by HamletEagle View Post
Are you doing anything else or just hooking the function?
It's a simple callback

PHP Code:
public OnPackPlayerItem(idwidfullserver_print("OnPackPlayerItem called id %d wid %d ammo %d"idwidfull
Output isn't shown, because I guess forward isn't called since it stopped converting their params

EDIT: If I remember well, I had problems with this function when calling it with Okapi. It might be a problem of the function I guess.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross

Last edited by meTaLiCroSS; 07-23-2016 at 07:47.
meTaLiCroSS is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-23-2016 , 09:47   Re: Module: Orpheu (v2.6.3)
Reply With Quote #1460

Using such signature on windows hlds, it works ok:
Code:
{
	"name"      : "packPlayerItem",
	"library"   : "mod",
	"arguments" :
	[
		{
			"type" : "CBasePlayer *"
		},
		{
			"type" : "CBasePlayerItem *"
		},
		{
			"type" : "bool"
		}
	],
	"identifiers" :
	[
		{
			"os"    : "windows",
			"mod"   : "cstrike",
			"value" : [0x83,"*","*",0x53,0x57,0x8B,"*","*","*",0x33,0xDB,0x3B,"*",0x0F]
		},
		{
			"os"    : "linux",
			"mod"   : "cstrike",
			"value" : "_ZL14packPlayerItemP11CBasePlayerP15CBasePlayerItemb"
		},
		{
			"os"    : "linux",
			"mod"   : "cstrike",
			"value" : "packPlayerItem__FP11CBasePlayerP15CBasePlayerItemb"
		}
	]
}
Output:
Code:
OnPackPlayerItem called id 1 wid 437 ammo 1
Can't test on linux. Btw, why are you using sign for linux? Just provide the symbol.
__________________

Last edited by HamletEagle; 07-23-2016 at 09:48.
HamletEagle is offline
Reply



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 18:40.


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