[Help]PickUp metin2 dll

09/10/2013 01:29 Dr0p3r96#1
Hello...
I have a problem to create PickUp in metin2.. I Inject the dll and crash the game.

Function asm:
Code:
00403770 - 8B 0D 20E07C00    - mov ecx,[007CE020]
00403776 - E8 25020300       - call 4339A0
Dllmain.cpp:
Code:
#include <windows.h>
DWORD pickup2=0x004339A0;

void pickup()
{
	__asm
	{
			MOV ECX,DWORD PTR DS:[0x7CE020]
			CALL pickup2

	}
}


DWORD WINAPI Watek( LPVOID )
{
		while(true)
		{
			pickup();
			Sleep(300);
		}
        return true;
}
int __stdcall DllMain(_In_ void * _HDllHandle, _In_ unsigned _Reason, _In_opt_ void * _Reserved)
{
        if(DLL_PROCESS_ATTACH== _Reason)
        {
              CreateThread(NULL, NULL, Watek, NULL, NULL, NULL);
        }

        return 1;
}
Crash game after inject :c
09/10/2013 02:28 +Yazzn#2
Maybe a nullptr is being dereferenced. Try to call pickup only when *reinterpret_cast<DWORD *>(0x7CE020) != nullptr.
09/10/2013 11:11 .SkyneT.#3
Better use a Detour at the main function of the game
and execute the pickup function like that:
Code:
PyObject_Call(PyObject_GetAttrString(PyImport_ImportModule("player"), "PickCloseItem"), args, NULL);
09/12/2013 21:05 [uLow]NTX?!#4
from where do you have the code?
*


Updated ASM etc ?

which metin2 version ?