flat assembler
Message board for the users of flat assembler.
Index
> Windows > callback function resides on dll gives error access denied |
Author |
|
sleepsleep 21 Mar 2007, 03:43
hi there
the idea is like this, i was trying to make a enumwindowsproc in a dll, so that i could resuse it next time. but the problem is, even a simple enumwindowsproc with code mov eax,TRUE ret would give the below error. Code: The instruction at "0x004030bb" referenced memory at "0x0051f238". The memory could not be "written". but if i put the exact enumwindowsproc on the .exe itself, it produces no error... i wonder why? i attached with the dll and the sample test.exe for testing.
|
|||||||||||
21 Mar 2007, 03:43 |
|
sleepsleep 21 Mar 2007, 08:59
thanks LocoDelAssembly.
the [enumTopWindowProc] seems to solve the error. but i don't understand why we need to use [enumTopWindowProc] ? so, if we write mov eax,enumTopWindowProc what address actually we get in eax? the pointer of enumTopWindowProc? the pointer of pointer to enumTopWindowProc? the pointer of pointer of pointer to enumTopWindowProc? |
|||
21 Mar 2007, 08:59 |
|
LocoDelAssembly 21 Mar 2007, 13:55
You get the pointer of pointer to DLL function. Remember that EXE files are not relocated and uses an import table which consists of pointers to functions that Windows must fill on image load. Note that the same happens when calling, you need to use "call dword [function]" instead of "call function" and the reason again is because there is no relocs (and the last one is uncompilable).
DLL also uses import table but are relocatable, and for that you have to add the fixups because if the base address of DLL is occupied already by something else then your DLL will fail. |
|||
21 Mar 2007, 13:55 |
|
sleepsleep 21 Mar 2007, 16:46
sorry for my stupid question, i think i get it now
thanks LocoDelAssembly |
|||
21 Mar 2007, 16:46 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.