Originally Posted by
DennyPow
No one knows? :confused:
Create e delegate (I choosed stdcall so .net handles the stack for me)...
Code:
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate int UserPowerWrapperDelegate(uint cmdPacket,uint ptrHero, uint one, uint zero, uint address);
private static UserPowerWrapperDelegate UsePowerInternal;
private static IntPtr UsePowerWrapper = IntPtr.Zero;
Create your wrapper.
Code:
Byte[] asm = new Byte[]
{
0x55, //Push EBP
0x8B, 0xEC, //Mov EBP, ESP
0x8B, 0x5D, 0x18, //mov ebx, [ebp+18]
0x8B, 0x45, 0x14, //mov eax, [ebp+14]
0x50, //Push EAX
0x8B, 0x45, 0x10, //mov eax, [ebp+10]
0x50, //Push EAX
0x8B, 0x45, 0x0C, //mov eax, [ebp+0C] //Hero
0x50, //Push EAX
0x8B, 0x45, 0x08, //mov eax, [ebp+08] //Cmdpacket
0xFF, 0xD3, //Call ebx
0x8B, 0XE5, //Mov ESP, EBP
0x5D, //Pop ebp
0xC3 //Return
};
Allocate some memory, copy our asm there and register our delegate.
Code:
UsePowerWrapper = Marshal.AllocCoTaskMem(asm.Length);
Marshal.Copy(asm, 0, UsePowerWrapper, asm.Length);
UsePowerInternal = Marshal.GetDelegateForFunctionPointer(ptr, typeof(UserPowerWrapperDelegate))
And now we can call it with our UsePowerInternal.
Edit: This is the "outer" usepower, you can only use this on actors.. Not on vectors.. for that you will have to reverse a bit 
good luck