Originally Posted by
Weekday
You have the wrong offset, it is 0x12DECA0.
Thanks. I found it not long after posting while browsing in IDA.
I tried updating it:
Code:
public static class Functions
{
[DllImport("FastCall.dll", EntryPoint = "EnumerateVisibleObjects")]
static extern void EnumerateVisibleObjects(IntPtr callback, long filter, IntPtr ptr);
internal static void EnumerateVisibleObjects(IntPtr callback, long filter) =>
EnumerateVisibleObjects(
callback,
filter,
System.Diagnostics.Process.GetCurrentProcess().MainModule.BaseAddress + 0x12DECA0
);
}
C++
Code:
void __declspec(dllexport) __stdcall EnumerateVisibleObjects(unsigned int callback, int filter, unsigned int ptr)
{
typedef unsigned int __fastcall func(unsigned int callback, int filter);
func* function = (func*)ptr;
function(callback, filter);
}
C# callback
Code:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
delegate int EnumerateVisibleObjectsCallback(IntPtr guid, long filter);
static EnumerateVisibleObjectsCallback callback;