flat assembler
Message board for the users of flat assembler.

Index > Windows > create .flat section

Author
Thread Post new topic Reply to topic
Ali.Z



Joined: 08 Jan 2018
Posts: 732
Ali.Z 22 May 2024, 13:11
any body remembers how to create .fas section? do not be confused with .fas debugging symbols file.

iirc, there was a way to force fasm to stuff all data and imports along with code into one flat section named .fas or .flat i dont remember.

p.s. please change title to reflect correct section name {.fas|.flat}
pps. i really need this to test some nt loader specific bugs.

_________________
Asm For Wise Humans


Last edited by Ali.Z on 22 May 2024, 15:23; edited 1 time in total
Post 22 May 2024, 13:11
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4073
Location: vpcmpistri
bitRAKE 22 May 2024, 15:16
IIRC, '.flat' is the default section. The trick is to not use a "section" statement. Wink

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 22 May 2024, 15:16
View user's profile Send private message Visit poster's website Reply with quote
MatQuasar



Joined: 25 Oct 2023
Posts: 105
MatQuasar 22 May 2024, 15:16
It is .flat section.

I asked similar question before:
https://board.flatassembler.net/topic.php?t=21848
Post 22 May 2024, 15:16
View user's profile Send private message Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 732
Ali.Z 22 May 2024, 15:24
thanks, i was about to manually calc import section size and rva and then patch the exe's optional header. too much work obv.

_________________
Asm For Wise Humans
Post 22 May 2024, 15:24
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 23 May 2024, 02:14
Ali.Z wrote:
iirc, there was a way to force fasm to stuff all data and imports along with code into one flat section named .fas or .flat i dont remember.
There is no need to force anything. Place your section with any name you choose (you can also choose to name it ".flat") and put all your code, imports, exports, data, etc. in there.
Code:
format pe

section '.flat' readable writeable executable

entry $
        call $

data import
        dd 0x01234567
end data

data export
        dd 0x76543210
end data

my_data dd 0xdeadbeef
my_string db 'Hello, world!',13,10,0    
Post 23 May 2024, 02:14
View user's profile Send private message Visit poster's website Reply with quote
Hrstka



Joined: 05 May 2008
Posts: 61
Location: Czech republic
Hrstka 23 May 2024, 09:04
Btw. it's not necessary to call the section '.flat'. You can choose any name, as long as it fits into 8 characters.
Post 23 May 2024, 09:04
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.