Raised This Month: $ Target: $400
 0% 

any difference between the Orpheu and chooker ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 06-06-2013 , 09:08   any difference between the Orpheu and chooker ?
Reply With Quote #1

As the title,
Orpheu code and the signature:

Code:
#include <amxmodx> #include <orpheu> #define PLUGIN_NAME "NewPlugin" #define PLUGIN_VERSION  "0.1" #define PLUGIN_AUTHOR   "LittleKu-Lv" public plugin_precache() {     OrpheuRegisterHook(OrpheuGetFunction("SetProgressBarTime", "CBasePlayer"), "OnSetProgressBarTime"); } public plugin_init() {     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR) } public OrpheuHookReturn:OnSetProgressBarTime(id, iTime) {     return OrpheuSupercede; }

Code:
{
	"name" : "SetProgressBarTime",
	"class" : "CBasePlayer",
	"library" : "mod",
	"arguments" : 
	[
		{
			"type" : "int"
		}
	],
	"identifiers":
	[
		{
			"os"    : "windows",
			"mod"   : "cstrike",
			"value" : [0x51,0x53,0x55,0x56,0x57,0x8B,"*","*","*",0x33,"*",0x3B,"*",0x8B,"*",0x74],
		},
		{
			"os"    : "linux",
			"mod"   : "cstrike",
			"value" : "_ZN11CBasePlayer18SetProgressBarTimeEi"
		}
	]
}
chooker code:
Code:
#include "amxxmodule.h" #include "chooker.h" CHooker     HookerClass; CHooker*    Hooker = &HookerClass; #ifdef _WIN32     #define DUMMY_VAL 0     typedef int DUMMY;     typedef void    ( __fastcall *FuncSetProgressBarTime )  ( void*, DUMMY, int );     void __fastcall FuncSetProgressBarTime_Hook( void* pvPlayer, DUMMY, int iTime ); #else     typedef void    ( *FuncSetProgressBarTime ) ( void*, int );     void FuncSetProgressBarTime_Hook( void* pvPlayer, int iTime ); #endif CFunc*              FuncSetProgressBarTimeHook = NULL; FuncSetProgressBarTime  FuncSetProgressBarTimeOrig = NULL; #ifdef _WIN32     void __fastcall FuncSetProgressBarTime_Hook( void* pvPlayer, DUMMY, int iTime ) #else     void FuncSetProgressBarTime_Hook( void* pvPlayer, int iTime ) #endif     {             if( FuncSetProgressBarTimeHook->Restore() )             {                 FuncSetProgressBarTimeOrig( pvPlayer, DUMMY_VAL, iTime );                 FuncSetProgressBarTimeHook->Patch();             }             printf("\n\t\tSet Progress Bar Time .iTime is %i\n", iTime);     }     void OnMetaAttach() {     #ifdef _WIN32         FuncSetProgressBarTimeOrig = Hooker->MemorySearch< FuncSetProgressBarTime >( "0x51,0x53,0x55,0x56,0x57,0x8B,*,*,*,0x33,*,0x3B,*,0x8B,*,0x74", ( void* )MDLL_Spawn, FALSE );     #else         FuncSetProgressBarTimeOrig = Hooker->MemorySearch< FuncSetProgressBarTime>( "_ZN11CBasePlayer18SetProgressBarTimeEi", ( void* )MDLL_Spawn, TRUE );     #endif     FuncSetProgressBarTimeHook = Hooker->CreateHook( ( void* )FuncSetProgressBarTimeOrig, ( void* )FuncSetProgressBarTime_Hook, TRUE );     printf( "\n %s v%s - by %s.\n -\n", MODULE_NAME, MODULE_VERSION, MODULE_AUTHOR );     if( !FuncSetProgressBarTimeOrig )         printf( " Signature/symbol could not be found.\n\n" );     else if( !FuncSetProgressBarTimeHook )         printf( " Hook creation failed.\n\n" );     else         printf( " Loaded with success.\n\n" ); }

and the problem is chooker can find the function, but the Orpheu log a error message .
anything did I wrong ?
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
 



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 16:23.


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