charoriginalBytes_V0[]="\x8B\x45\x0c\x57\x8B\x7D\x08\x3D\x76\xC4\x06\x00";//original assembly code of steamclient.dll that we want to hook (V0)
std::stringoriginalBytes_V0="\x8B\x45\x0c\x57\x8B\x7D\x08\x3D\x76\xC4\x06\x00";//original assembly code of steamclient.dll that we want to hook (V0)
/* ==
moveax,dwordptrss:[ebp+0xc]//appId of bindings to be switched gets moved into eax register
pushedi//part of original steam code
movedi,dwordptrss:[ebp+0x8]//part of original steam code
cmpeax,0x6C476//part of original steam code - checks if bindings to be set are steamchord bindings
*/
charmask_V0[]="xxxxxxxxxxxx";//mask for searching
int32_tsigLen_V0=12;
std::stringmask_V0="xxxxxxxxxxxx";//mask for searching
charoriginalBytes_V1[]="\x8B\x45\x0C\x3D\x76\xC4\x06\x00";//original assembly code of steamclient.dll that we want to hook (V1)
std::stringoriginalBytes_V1="\x8B\x45\x0C\x3D\x76\xC4\x06\x00";//original assembly code of steamclient.dll that we want to hook (V1)
/* ==
moveax,dwordptrss:[ebp+0xC]//appId of bindings to be switched gets moved into eax register
cmpeax,6C476//part of original steam code - checks if bindings to be set are steamchord bindings
*/
charmask_V1[]="xxxxxxxx";//mask for searching
int32_tsigLen_V1=8;
std::stringmask_V1="xxxxxxxx";//mask for searching
charoriginalBytes_V2[]="\x8B\x4D\x0C\x53\x8D\x9f\x2a\x03\x00\x00\x8D\x1C\x9E\x81\xF9\x76\xc4\x06\x00";//original assembly code of steamclient.dll that we want to hook (V2)
std::stringoriginalBytes_V2="\x8B\x4D\x0C\x53\x8D\x9f\x2a\x03\x00\x00\x8D\x1C\x9E\x81\xF9\x76\xc4\x06\x00";//original assembly code of steamclient.dll that we want to hook (V2)
/* ==
movecx,dwordptrss:[ebp+C]//appId of bindings to be switched gets moved into ecx register
pushebx//part of original steam code
@ -56,24 +55,46 @@ lea ebx,dword ptr ds:[edi+32A] //part of original steam code
leaebx,dwordptrds:[esi+ebx*4]//part of original steam code
cmpecx,6C476//part of original steam code - checks if bindings to be set are steamchord bindings
*/
charmask_V2[]="xxxxxxxxxxxxxxxxxxx";//mask for searching
std::stringmask_V2="xxxxxxxxxxxxxxxxxxx";//mask for searching
int32_tsigLen_V2=19;
charoriginalBytes_V3[]="\x8D\x8e\x38\x0c\x00\x00\x8B\x45\x0C";//original assembly code of steamclient.dll that we want to hook (V2)
std::stringoriginalBytes_V3="\x8D\x8e\x38\x0c\x00\x00\x8B\x45\x0C";//original assembly code of steamclient.dll that we want to hook (V2)
/* ==
leaecx,dwordptrds:[esi+C38]//part of original steam code
moveax,dwordptrss:[ebp+C]//appId of bindings to be switched gets moved into ecx register
*/
charmask_V3[]="xxxxxxxxx";//mask for searching
int32_tsigLen_V3=9;
std::stringmask_V3="xxxxxxxxx";//mask for searching
std::stringoriginalBytes_V4="\x8B\x45\x0C\x89\x45\xF4\x8D\x45\xF0\x50\x89\x7D\xF0";//original assembly code of steamclient.dll that we want to hook (V2)
/* ==
moveax,dwordptrss:[ebp+C]//appId of bindings to be switched gets moved into eax register
movdwordptrss:[ebp-C],eax
leaeax,dwordptrss:[ebp-10]
pusheax
movdwordptrss:[ebp-10],edi
*/
std::stringmask_V4="xxxxxxxxxxxxx";//mask for searching
moveax,dwordptrss:[ebp+0xC]//appId of bindings to be switched gets moved into ecx register
movcurrentBindings,eax//move into "currentBindings" variable
}
if(currentBindings!=desktopBindingsID//if the current bindings aren't desktop, big picture, or steam-chord bindings
&¤tBindings!=bigPictureBindingsID//they have to be our game bindings
&¤tBindings!=steamChordBindingsID)//we can grab them here, because bindings switch right after we have injected and the target changes focused window
{
enforceBindingsID=currentBindings;
}
if(currentBindings==desktopBindingsID)//if steam wants to set desktop-bindings
{
__asm
{
JMPBack=address+sigLen_V1;//8 size of pattern/mask == patched instructions