flat assembler
Message board for the users of flat assembler.
Index
> Windows > Problem with WinAPI |
Author |
|
MUFOS 12 Jun 2016, 20:32
Hard to call the stack.
Last edited by MUFOS on 08 May 2017, 20:39; edited 1 time in total |
|||
12 Jun 2016, 20:32 |
|
revolution 12 Jun 2016, 23:19
Show your code. We can't help without it. Post a minimal source that shows the problem.
|
|||
12 Jun 2016, 23:19 |
|
revolution 15 Jun 2016, 01:31
Clearly the relocation was not successful.
If you don't want to, or can't, post the code then use a debugger and see what is happening. |
|||
15 Jun 2016, 01:31 |
|
MUFOS 15 Jun 2016, 16:12
revolution wrote: Clearly the relocation was not successful. If the relocation was not successful, why do other APIs work. I tried to use the GetProcAddress and LoadLibrary functions within the DLL, and it produced the broken MessageBox as well. And those APIs did indeed work as they resolved the right address of the module as well as proc address when they were called. I have the executable available, so I can grab a debugger and explain what is happening in the relocation part, but I still do not understand why other WinAPIs like LoadLibrary, FreeConsole, and GetProcAddress still work. |
|||
15 Jun 2016, 16:12 |
|
revolution 16 Jun 2016, 01:17
Perhaps your text pointers are incorrect? The API calls appear to be good, but there are other things that need relocating also.
|
|||
16 Jun 2016, 01:17 |
|
Grom PE 16 Jun 2016, 05:34
I remember I was getting weirdly shaped message boxes when I didn't keep the stack aligned to 16 bytes on a 64-bit machine.
|
|||
16 Jun 2016, 05:34 |
|
MUFOS 16 Jun 2016, 05:45
revolution wrote: Perhaps your text pointers are incorrect? The API calls appear to be good, but there are other things that need relocating also. The thing is I use NULL for all the variables when calling the MessageBox (just for simplicity), however if I provide text pointers instead, nothing changes. Besides, the text pointers are working as I successfully use LoadLibrary and GetProcAddress with said arguments. In addition, there is no text in the diøog button either, which has nothing to fo with text pointers. |
|||
16 Jun 2016, 05:45 |
|
MUFOS 16 Jun 2016, 05:49
Grom PE wrote: I remember I was getting weirdly shaped message boxes when I didn't keep the stack aligned to 16 bytes on a 64-bit machine. The DLL as well as the loader is 32 bit. How do I align the stack to said bytes? The C++ version of the pe loader has no isssues. |
|||
16 Jun 2016, 05:49 |
|
MUFOS 19 Jun 2016, 01:46
Still struggling with this. Any suggestions?
|
|||
19 Jun 2016, 01:46 |
|
revolution 19 Jun 2016, 02:31
MUFOS wrote: Any suggestions? |
|||
19 Jun 2016, 02:31 |
|
Hrstka 21 Jun 2016, 14:48
On Windows XP it would probably work OK, but with each version of Windows, more and more libraries are loaded in process address space. So if you load only User32.dll, it's not enough.
|
|||
21 Jun 2016, 14:48 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.