flat assembler
Message board for the users of flat assembler.

Index > Windows > First step for fasm linker

Author
Thread Post new topic Reply to topic
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
imports.exe (finally Vortex Wink )

What is this: This script will look for all external calls building the import table after searching for the functions in the respective imported executable module (dll, exe...) The source is self-explained.

Things to do:
1. Build the import table without need for library and import macros.
2. Speed up the search.
3. Testing.
4. Link COFF files
4. Incorporate to fasm (?)

Requirements: This script will work only for fasmw with JohnFound's script directive.

How to use:

file: test.asm
----------------------------------

format PE GUI 4.0
entry start

include '%include%\win32a.inc'

macro consider [names] { }

consider 'kernel32.dll',consider 'user32.dll'

section '.code' code readable executable

start:
.
; some stuff...


section '.idata' import data readable writeable

library kernel32,'KERNEL32.DLL',\
user32,'USER32.DLL'

script '%include%\imports test.asm'

-----------------------------------

Attachment deleted to save space.
Please see latest release here http://board.flatassembler.net/topic.php?t=1068


Last edited by pelaillo on 17 May 2004, 13:07; edited 1 time in total
Post 20 Aug 2003, 15:59
View user's profile Send private message Yahoo Messenger Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Say goodbye to the api includes Smile

There are some examples to produce include section directly from DLLs.
Import them as script or statically. It saves compile time.

Static alternative (to avoid parsing the source each time you compile)
Launch from command line:
imports minipad.asm>minipad.imp

There is also the modified fasmw IDE updated to fasm 1.49 and is script capable.

Attachment deleted to save space.
Please see my homepage for this project.


Last edited by pelaillo on 17 May 2004, 13:09; edited 1 time in total
Post 02 Sep 2003, 19:25
View user's profile Send private message Yahoo Messenger Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
There is just one thing, the APIs for included files, I've pointed out this matter to Vortex (it's rather hard work, as I realized when proposing an algo).

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 02 Sep 2003, 22:10
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Yes, I have avoided to parse and load all included files before parsing the whole, solution that means multiple parsing and a lot of memory.
Also because this is a repetitive task, so the approach I have taken is to proceed after fasm preprocessor avoiding an extra pass (if possible). Also because it permits to collect all api calls and unresolved references. (second step to linker)

The workarround I'm doing is:
copy src1+src2+src3+src4 allsrc
imports allsrc>all.imp
Post 03 Sep 2003, 09:02
View user's profile Send private message Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.