Originally Posted by
Hrap
as I understand it, I need to call ToggleControlBit and pass the flags I need
Is it so?
Yes, almost you also need to pass the CInputControl object & tickcount. The mentioned paste was more a example how the function itself look like. You may call it in the main thread via a delegate or asm/endscene.
C# injected (c++? dunno):
Code:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate IntPtr CGInputControl_GetActiveDelegate();
internal static CGInputControl_GetActiveDelegate CGInputControl_GetActive;
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
internal delegate int CGInputControl_ToggleControlBitDelegate(IntPtr activeCtrl, int type, int enable, int osAsyncTime, int unk0);
internal static CGInputControl_ToggleControlBitDelegate CGInputControl_ToggleControlBit;
public void MoveForward()
{
//delegates need to assigned before calling...
Generic.MainThread.Instance.Invoke(() =>
{
Functions.Client.CGInputControl_ToggleControlBit(Functions.Client.CGInputControl_GetActive(), 0x10, 1, System.Environment.TickCount, 0);
}
}
or in asm
Code:
Memory.WowMemory.Inject(new[]
{
"call " + (uint) 0x5F95D0,
"mov ecx, eax",
"call " + (KernelTickCountAddress),
"push 0",
"push eax",
"mov ebx, [" + enablePtr + "]",
"push ebx",//or push directly if pointer not needed
"mov ebp, [" + flagPtr + "]",
"push ebp",
"call " + (uint) 0x5FBE10,
"ret"
}, out toggleControlBitBase, out toggleControlBitFunc);