flat assembler
Message board for the users of flat assembler.
Index
> Windows > Imports tool revised |
Author |
|
pelaillo 17 Feb 2004, 15:07
Hi all,
The following is an entire rewritten version of "imports" program. The program builds imports table from sources going through included files as well. I have done exhaustive tests and optimizations and I will be glad to receive your comments and bug reports. My hope is that this program will get a place in the tools section Features: 1. Full fasm source code. 2. Loads the needed dlls as resource files to save time. 3. Skips strings, comments and macro definition lines. 4. Goes recursively through included files. 5. Path syntax full compatible with fasm. 6. Selectable Unicode and ASCII functions. 7. Prepares following import tables: fasm alink golink 8. Works with following macros: api invoke cinvoke thiscall fastcall
Last edited by pelaillo on 25 Feb 2004, 13:32; edited 2 times in total |
|||||||||||
17 Feb 2004, 15:07 |
|
pelaillo 21 Feb 2004, 13:06
Hi Vortex,
Could you give me more information? I have tested it on win95 and xp and it works. I am using it on a daily basis directly from RadAsm to copy from the output window. I find a bug on memory management when I've tried with fresh.asm. I'm working on fixing it. But for smaller projects is working Thanks, pelaillo |
|||
21 Feb 2004, 13:06 |
|
Vortex 21 Feb 2004, 13:11
I tried your tool on Win Xp Home Sp1 (my computer), Win2000 and Win98,it doesn't function.
Even trying to run the program without any cmdlineparam,no any result. Code: c:\imports>imports.exe c:\imports> _________________ Code it... That's all... |
|||
21 Feb 2004, 13:11 |
|
pelaillo 21 Feb 2004, 13:51
I'm puzzled
From commandline it didn't function as you properly said. Launching it by a program as commandline tool does. (following test with xplore2, works also from RadAsm and OllyDbg) Code: imports imports.asm import kernel32,\ CloseHandle,'CloseHandle',\ CreateFile,'CreateFileA',\ ExitProcess,'ExitProcess',\ GetCommandLine,'GetCommandLineA',\ GetEnvironmentVariable,'GetEnvironmentVariableA',\ GetFileSize,'GetFileSize',\ GetProcessHeap,'GetProcessHeap',\ GetStdHandle,'GetStdHandle',\ HeapAlloc,'HeapAlloc',\ HeapFree,'HeapFree',\ LoadLibraryEx,'LoadLibraryExA',\ ReadFile,'ReadFileA',\ VirtualAlloc,'VirtualAllocA',\ VirtualFree,'VirtualFreeA',\ WriteFile,'WriteFile' Code: imports imports 0.0.4 - Fasm imports table builder This is freeware - flatassembler.net imports source.asm [output][char] output options: -f: Fasm (Default) -g: GoLink -a: Alink char options: -a: ASCII char (Default) -w: Unicode (Wide) char |
|||
21 Feb 2004, 13:51 |
|
Vortex 21 Feb 2004, 16:25
Hi Pelaillo,
It looks like that you adopted a different method of programming. Can you explain with full detail how to run your tool? _________________ Code it... That's all... |
|||
21 Feb 2004, 16:25 |
|
Vortex 21 Feb 2004, 22:17
Hi Pelaillo, There is nothing to be puzzled. I found the bug. Your code with the statement: Code:
format PE GUI 4.0
will not function at all. This is why the tool doesn't output any text. I think, you should use this one: Code:
format PE CONSOLE 4.0
With LordPE, I modified the subsystem of imports.exe to console. Now, the tool is running just as you mentioned, but you need to fix a bug (maybe, it's about memory management) , it crashed for me on another trial with different Fasm source code. Nice tool, keep going on. Best regards, Vortex
_________________ Code it... That's all... |
|||||||||||
21 Feb 2004, 22:17 |
|
pelaillo 23 Feb 2004, 04:20
Thank you very much !
I'm catching the bugs |
|||
23 Feb 2004, 04:20 |
|
pelaillo 24 Feb 2004, 20:44
Vortex wrote: There is nothing to be puzzled. Windows craziness The console is unable to catch stdout if the program is specified as GUI I wonder how they call it "standard" output ¿!?!? New upload at top. Some bugs fixed. Please help me testing. |
|||
24 Feb 2004, 20:44 |
|
Vortex 25 Feb 2004, 19:36
Pelaillo,
If I remember well, the terms stdout and stdin are associated mainly with console applications. I downloaded the new version. Trial with Privalov's Opengl demo from the Fasmw package: Code: import kernel,\ ExitProcess,'ExitProcess',\ GetModuleHandle,'GetModuleHandleA' import user,\ CreateWindowEx,'CreateWindowExA',\ DefWindowProc,'DefWindowProcA',\ DispatchMessage,'DispatchMessageA',\ GetClientRect,'GetClientRect',\ GetDC,'GetDC',\ GetMessage,'GetMessageA',\ InvalidateRect,'InvalidateRect',\ LoadCursor,'LoadCursorA',\ LoadIcon,'LoadIconA',\ PostQuitMessage,'PostQuitMessage',\ RegisterClass,'RegisterClassA',\ ReleaseDC,'ReleaseDC',\ TranslateMessage,'TranslateMessage' import gdi,\ ChoosePixelFormat,'ChoosePixelFormat',\ SetPixelFormat,'SetPixelFormat',\ SwapBuffers,'SwapBuffers' import opengl,\ glBegin,'glBegin',\ glClear,'glClear',\ glColor3f,'glColor3f',\ glEnd,'glEnd',\ glRotatef,'glRotatef',\ glVertex3f,'glVertex3f',\ glViewport,'glViewport',\ wglCreateContext,'wglCreateContext',\ wglDeleteContext,'wglDeleteContext',\ wglMakeCurrent,'wglMakeCurrent' import glu <--- ??? The source file doesn't import functions from glu32.dll How can I specify the required DLLs to be scanned for the external functions? Also, the tool can't handle source files specified with relative paths. An example: Code: include '..\Fasm+MS Link Indirect call\Dlgproc.asm' _________________ Code it... That's all... |
|||
25 Feb 2004, 19:36 |
|
pelaillo 25 Feb 2004, 23:29
Vortex, thanks for your help I will follow to fix them.
About the stdout, the problem is not that GUI applications don't use it. The problem is that console don't catch it properly. In fact, many GUI programs such as fasmw, radasm and so on catch them properly. Regards, |
|||
25 Feb 2004, 23:29 |
|
f0dder 26 Feb 2004, 15:35
Quote:
It's called "standard output" because it isn't the "error output" - old unix (and perhaps even older?) terminology. Btw there *is* no console if your PE is specified as GUI... even if you're run from a console mode app like cmd.exe or command.com. But you can of course always AllocConsole or AttachConsole from a GUI app - so nothing crazy here |
|||
26 Feb 2004, 15:35 |
|
pelaillo 26 Feb 2004, 15:49
Older but still actual.
The following are valid virtual filesystem services: stdin stdout stderr You can get a valid handle for all of them and then read from first or write to the other two and it does not concern to GUI or not GUI (at least on Unix) so windows have copied this in a *not so good way* or otherwise it will function. The craziness is that a GUI program reads and writes properly from stdin/stdout but a console does not catch stdout if the app. is not defined as a console. |
|||
26 Feb 2004, 15:49 |
|
JohnFound 26 Feb 2004, 15:58
pelaillo wrote: The craziness is that a GUI program reads and writes properly from stdin/stdout but a console does not catch stdout if the app. is not defined as a console. What console? In Windows you may have many consoles, not only one. Actually every console application have it's own console. And every GUI application have no any console created, so stdin and stdout are directed to NULL. It is absolutely normal behaviour IMHO. It is easy to create console in your GUI application and to attach it to stdin and stdout. (btw: console interface is very stupid thing, the problem is that the people are used to it and IMHO, this stops them to invent something better.) Regards. |
|||
26 Feb 2004, 15:58 |
|
pelaillo 26 Feb 2004, 17:46
But please look at these facts:
1. Compiling with format PE GUI 4.0: Works as expected when launched by RadAsm Shows nothing when launched by command line 2. Compiling with format PE CONSOLE Works as expected when launched by RadAsm Works as expected when launched by command line |
|||
26 Feb 2004, 17:46 |
|
f0dder 26 Feb 2004, 17:53
When launched by radasm, it inhereits stdin,stdout and such from the parent process. When invoked otherwise, no console is created nor attached, so there's no default file handles (or well... on win2k GetStdHandle and such does return file handles, but they probably go to something equivalent to /dev/null on unix)
|
|||
26 Feb 2004, 17:53 |
|
pelaillo 26 Feb 2004, 18:14
Thank you, now I understand.
I didn't see it because both apps are different processes. |
|||
26 Feb 2004, 18:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.