flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 30 Dec 2007, 11:06
The macros are not designed to know whether the function is in your code or in your imports section. The easy way to solve it is not to duplicate such entries, it makes no sense anyway to do that.
|
|||
![]() |
|
kohlrak 30 Dec 2007, 14:08
It's an easy way to steal credit for something if the other person isn't very quick on the draw.
|
|||
![]() |
|
revolution 30 Dec 2007, 14:22
kohlrak wrote: It's an easy way to steal credit for something if the other person isn't very quick on the draw. |
|||
![]() |
|
twgt 30 Dec 2007, 23:20
Quote:
Yes. I casually reamarked that. Quote:
kohlrak, I also can't understand this phrase. |
|||
![]() |
|
f0dder 31 Dec 2007, 00:14
Hm, interesting - you're creating a DLL that imports it's own export? How does the PE loader handle that?
As for Kohlrak's remark, ignore it - he probably doesn't even known about forwarded exports ![]() |
|||
![]() |
|
FrozenKnight 31 Dec 2007, 17:16
Can't this method be used for things like intercepting calls and making dll's that intercept api's?
|
|||
![]() |
|
f0dder 31 Dec 2007, 18:26
FrozenKnight wrote: Can't this method be used for things like intercepting calls and making dll's that intercept api's? Not for intercepting per se., but the ability to have forwarded exports makes it much easier to set up proxy DLLs. And it's very easy to do from VC++, there's some #pragmas for it. _________________ ![]() |
|||
![]() |
|
MHajduk 01 Jan 2008, 14:09
twgt
if I understand correctly, you are going to export all (or only some?) procedures used inside 'test.dll' (and then import them) in order to treat their calls in the same way as calls of procedures placed in the other libraries? I think it could be used to hide calls of internal procedures within general mass of other calls. Am I right? |
|||
![]() |
|
Tomasz Grysztar 01 Jan 2008, 14:42
When you import MyTestFunc, you create MyTestFunc DWORD variable that will hold the imported address. When you export MyTestFunc, you export the address MyTestFunc itself - so in this case you export the address of DWORD variable, which will the be filled with imported address (the address of itself). Thus this code assembles correctly, it just doesn't make much sense. If you really wanted to import your own exported function, you'd have to it like:
Code: ;test.asm format PE GUI 4.0 DLL entry DllMain include '%fasminc%\win32ax.inc' section '.code' code readable executable proc DllMain Instance,Reason,Reserved xor eax,eax inc eax ret endp proc MyTestFunc_implementation ret endp section '.idata' import data readable library test,'test.dll' import test,\ MyTestFunc,'MyTestFunc' section '.edata' export data readable export 'test.dll',\ MyTestFunc_implementation,'MyTestFunc' You'd then be able to call your function in two ways, either: Code: invoke MyTestFunc Code: stdcall MyTestFunc_implementation |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.