These are chat archives for EasyHook/EasyHook

30th
Sep 2018
MechanicalPen
@MechanicalPen
Sep 30 2018 02:46
@suncodeer If you are hooking into a c++ method of an object, the first memory location is a pointer to the object.
not sure if that is your actual problem but it's what I had to do to get mine working. It looks like:
    [UnmanagedFunctionPointer(CallingConvention.ThisCall, SetLastError = true, CharSet = CharSet.Unicode)]
    [return: MarshalAs(UnmanagedType.Bool)]
    delegate bool SmflAudio2_SoundBuffer_loadFromFile(IntPtr self, IntPtr filename);

on the c++ side the code looks like;

sf::SoundBuffer buffer; buffer.loadFromFile("sound.wav");