What's new

xam hook

C

Cocks

Newbie
Messages
11
Reaction score
0
Code:
4852492


__int64 __declspec( n***d ) XamInputGetStateAsm(__int64 r3, __int64 r4, __int64 r5)
{
__asm
{
lis r11,-32401
addi r11,r11,2336
mtctr r11
bctr
}
}
__int64 XamInputGetStateHook(__int64 r3, __int64 r4, __int64 r5)
{
if(Dvar_GetBool("cl_ingame"))
{

}
return XamInputGetStateAsm(r3,r4,r5);
}
usage : PatchInJump((DWORD*)0x823B64A4,(DWORD)XamInputGetStateHook,false);


//Sent to me by hexsorce, used for stability in c++ menus.
//As far as I know it is used in iKonroi v5 and hexsorce's ghosts menu.

//Peace fellas.

Would like to add that where it says ****d  that should actually be nake* without the *. The site is seeing is as cussing.
 
Last edited:
X

Xx jAmes t xX

Getting There
Messages
427
Reaction score
675
And guess where they got it from :tongue:.
Also you can reduce the code by using this instead
Code:
DWORD XamInputGetStateHook(DWORD r3, int r4, PXINPUT_STATE r5)
{
    return XInputGetState(r3, r5);
}
 
C

CraigChrist8239

VIP
VIP
Messages
2,644
Reaction score
3,922
And guess where they got it from :tongue:.
Also you can reduce the code by using this instead
Code:
DWORD XamInputGetStateHook(DWORD r3, int r4, PXINPUT_STATE r5)
{
    return XInputGetState(r3, r5);
}
This. You shouldn't have to hook anything, this is how I do it... (Also @OP, it seems like you don't really know how to work it. Kinda just seems like someone just now sent it to you so you immediately posted online...)
Code:
XINPUT_STATE currentState;
if(XInputGetState(0, &currentState) == ERROR_SUCCESS)
    if(currentState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP)
    {
        isNoclipOn = !isNoclipOn;
        WriteMemory((LPVOID)0x83728704, 1, (LPCVOID)&isNoclipOn);
        Sleep(75);
    }
 
Last edited:
C

Cocks

Newbie
Messages
11
Reaction score
0
This. You shouldn't have to hook anything, this is how I do it... (Also, it seems like you don't really know how to work it. Kinda just seems like someone just now sent it to you so you immediately posted online...)
Code:
XINPUT_STATE currentState;
if(XInputGetState(0, &currentState) == ERROR_SUCCESS)
    if(currentState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP)
    {
        isNoclipOn = !isNoclipOn;
        WriteMemory((LPVOID)0x83728704, 1, (LPCVOID)&isNoclipOn);
        Sleep(75);
    }

Ive had this a few months, I just thought since not many people where releasing free menus with it that it would be nice to see what people can come up with. If they even know how to use it lmao....
 
X

Xx jAmes t xX

Getting There
Messages
427
Reaction score
675
This. You shouldn't have to hook anything, this is how I do it... (Also, it seems like you don't really know how to work it. Kinda just seems like someone just now sent it to you so you immediately posted online...)
Code:
XINPUT_STATE currentState;
if(XInputGetState(0, &currentState) == ERROR_SUCCESS)
    if(currentState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP)
    {
        isNoclipOn = !isNoclipOn;
        WriteMemory((LPVOID)0x83728704, 1, (LPCVOID)&isNoclipOn);
        Sleep(75);
    }
I'm not hooking it for the XInput I'm using it instead of a for loop because it is called every couple of milliseconds. (EDIT: I miss read that the brackets was directed at OP.
I've been using it with a gamemode hacksorce and I are making, I've been using it for monitoring the positions of clients for teleporters/doors)
 
Last edited:
H

Hacksorce

Enthusiast
Messages
585
Reaction score
401
The funny thing is, if you were the person who I sent this to, it is for mw2, so it has no use being in the ghost section.
 
Last edited:
C

CraigChrist8239

VIP
VIP
Messages
2,644
Reaction score
3,922
I'm not hooking it for the XInput I'm using it instead of a for loop because it is called every couple of milliseconds. (I've been using it with a gamemode hacksorce and I are making, I've been using it for monitoring the positions of clients for teleporters/doors)
Well then let me zoom out a little bit. You always want to be as least intrusive as possible.
Code:
DWORD WINAPI SkyrimTitleUpdate8Loop(LPVOID)
{
    bool isNoclipOn = false;
    for(;;)
    {
        Sleep(0);

        XINPUT_STATE currentState;
        if(XInputGetState(0, &currentState) == ERROR_SUCCESS)
            if(currentState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP)
            {
                isNoclipOn = !isNoclipOn;
                WriteMemory((LPVOID)0x83728704, 1, (LPCVOID)&isNoclipOn);
                Sleep(75);
            }
    }
}
Just saying, theres ways to detect input every frame without hooking.
 
N

nicholasbroo

Knowledge maybe Power, but Respect matters.
Premium
Messages
3,161
Reaction score
1,909
Yeah, that about solves it.
 
C

Const

Übermensch
Messages
575
Reaction score
757
Well then let me zoom out a little bit. You always want to be as least intrusive as possible.
Code:
DWORD WINAPI SkyrimTitleUpdate8Loop(LPVOID)
{
    bool isNoclipOn = false;
    for(;;)
    {
        Sleep(0);

        XINPUT_STATE currentState;
        if(XInputGetState(0, &currentState) == ERROR_SUCCESS)
            if(currentState.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP)
            {
                isNoclipOn = !isNoclipOn;
                WriteMemory((LPVOID)0x83728704, 1, (LPCVOID)&isNoclipOn);
                Sleep(75);
            }
    }
}
Just saying, theres ways to detect input every frame without hooking.
I believe the reason people do it that way is because there is a 'myth' that infinite loops cause a certain level of instability, even though hooking into a XAM function and overwriting a xam function from a something that will eventually be un-allocated from memory will cause issues.

(This next few statements are directed at people who believe this, keep in mind I'm not a professional and I don't know a lot about dynamic linking in ppc most of what I know comes from x86 so sorry if some of this is wrong)

You could easily create stable infinite loops in a dll but, you would have to make sure you don't make sure to prevent memory leaks. I honestly doubt anyone frees any of the memory they use at the end of the loop or do any sort of stack clean up. Dammit people learn the difference between __cdecl and __stdcall!
 
C

CraigChrist8239

VIP
VIP
Messages
2,644
Reaction score
3,922
I believe the reason people do it that way is because there is a 'myth' that infinite loops cause a certain level of instability, even though hooking into a XAM function and overwriting a xam function from a something that will eventually be un-allocated from memory will cause issues.

(This next few statements are directed at people who believe this, keep in mind I'm not a professional and I don't know a lot about dynamic linking in ppc most of what I know comes from x86 so sorry if some of this is wrong)

You could easily create stable infinite loops in a dll but, you would have to make sure you don't make sure to prevent memory leaks. I honestly doubt anyone frees any of the memory they use at the end of the loop or do any sort of stack clean up. Dammit people learn the difference between __cdecl and __stdcall!
Eh, the compiler is pretty smart when it comes to the linking. Pretty much the only time (I know of) it or the stack are going to fail is if you edit them directly, and wrongly. The memory thing I get though, no one ever performs a free statement ever. This isn't C# or Java, an object doesn't just "disappear".

As far as the stability of an infinite loop, I've never heard that, but I mean all games have one:
dRtVW.png
 
Last edited:
R

Ressko

Getting There
Messages
2,026
Reaction score
551
Damn, I thought I was special for having this lmao.. :frown:
 
X

XI T3RAG4TE IX

Newbie
Messages
28
Reaction score
1
Code:
4852492


__int64 __declspec( ****d ) XamInputGetStateAsm(__int64 r3, __int64 r4, __int64 r5)
{
__asm
{
lis r11,-32401
addi r11,r11,2336
mtctr r11
bctr
}
}
__int64 XamInputGetStateHook(__int64 r3, __int64 r4, __int64 r5)
{
if(Dvar_GetBool("cl_ingame"))
{

}
return XamInputGetStateAsm(r3,r4,r5);
}
usage : PatchInJump((DWORD*)0x823B64A4,(DWORD)XamInputGetStateHook,false);


//Sent to me by hexsorce, used for stability in c++ menus.
//As far as I know it is used in iKonroi v5 and hexsorce's ghosts menu.

//Peace fellas.

Would like to add that where it says ****d  that should actually be nake* without the *. The site is seeing is as cussing.


Can u explain how to use this code then please
 
N

nicholasbroo

Knowledge maybe Power, but Respect matters.
Premium
Messages
3,161
Reaction score
1,909
Lol, figure it out.
Exactly! Things like thins shouldn't be released because people don't know what to do with it....
 
S

Sputnik

Enthusiast
Messages
419
Reaction score
82
I have had this hook for a while now. I was told not to release it though
 
R

Ressko

Getting There
Messages
2,026
Reaction score
551
Exactly! Things like thins shouldn't be released because people don't know what to do with it....
Im sure that kid dosent even have a rgh... Anyone who can code a menu in c++ will be able to figure this out.
 
S

Sputnik

Enthusiast
Messages
419
Reaction score
82
When I was given it I had to learn a little. Once you know its not that hard
 
I

IW6MP

Newbie
Messages
3
Reaction score
3
Exactly! Things like thins shouldn't be released because people don't know what to do with it....
Yeah i mean SMC hack should've never been released because most people didnt know how it worked. Stop acting like you actually now anything its quite obvious someone like X Xx jAmes t xX is spoon-feeding you with everything as i saw one post he posted about it... went something like " i see you are sharing everything i told you", but it was deleted i think.
 
X

Xx jAmes t xX

Getting There
Messages
427
Reaction score
675
Yeah i mean SMC hack should've never been released because most people didnt know how it worked. Stop acting like you actually now anything its quite obvious someone like X Xx jAmes t xX is spoon-feeding you with everything as i saw one post he posted about it... went something like " i see you are sharing everything i told you", but it was deleted i think.
In his defence I only helped him with a couple of things.

hooking into a XAM function and overwriting a xam function from a something that will eventually be un-allocated from memory will cause issues.
With this hook you aren't hooking out of game memory so it's fine.
 
Top Bottom