ticktick wrote:void wrote:ok, i get the error too.
but you know what, the dll works to some extent. why? -- because if i go into dllmain.cpp and put an error message and a return statement in front of everything else there, it will show the message when the dll is injected into d2

so pls if you have any motivation pls keep trying too
btw do you have any idea what the assembly code actually does?
the assembly code is hotpatched into a d2 function to make it call DROPFILTER_Main, then checks the return value of DROPFILTER_Main, if false it goes to the end of that d2 function, if true it continues at the start of that d2 function (maybe reversed, i forget how cmp works). Similar to how a rootkit works except then you're patching the kernel.
msvc adds 2 or 4 noop bytes at the begging of all functions so they can be hotpatched by overwriting them with a jmp (unless you supply some compiler argument).
ty for explanation, i think that this doenst explain everything but most of it helps.
i noticed that it actually goes to the point that it "enters" the file with the assembly code, because i put message boxes directly before and after the __asm () thing, and the first box actually pops up. what doesnt pop up is the box after the code, so supposedly there is a problem directly connected to the stuff between the __asm brackets
/e: so even if the asm is corrected (idk how to correct it), it will still crash after the asm file code has been run for the first time. i tried to only call the item filter conditions from the .cpp file, and it actually makes the message box from there pop up followed by a msg after the edited __asm() part
so basically it looks like this
Code: Select all
MessageBox(NULL, "hello", "D2Template", MB_OK | MB_ICONERROR);
__asm volatile(
"call %0 \n"
:: "r" (DROPFILTER_Main) // <--- this contains msg box with "test"
);
MessageBox(NULL, "mooooo", "D2Template", MB_OK | MB_ICONERROR);
all three boxes showed up before it crashed
/e: ok wtf putting this for test
Code: Select all
__asm volatile(
"call %0 \n"
:: "r" (DROPFILTER_Main)
);
MessageBox(NULL, "mooooo", "D2Template", MB_OK | MB_ICONERROR);
MessageBox(NULL, "mooooo2", "D2Template", MB_OK | MB_ICONERROR);
MessageBox(NULL, "mooooo3", "D2Template", MB_OK | MB_ICONERROR);
__asm volatile("jmp [%0] \n"
:: "r" (D2CLIENT_6FB09087)
);
MessageBox(NULL, "kamehamemoo", "D2Template", MB_OK | MB_ICONERROR);
output is: msg:test msg:moo
not moo2
not moo3
it gets the error right there
