flat assembler
Message board for the users of flat assembler.

Index > Main > How to keep the name of the labels at the compilation?

Author
Thread Post new topic Reply to topic
Mino



Joined: 14 Jan 2018
Posts: 163
Mino 27 May 2020, 13:54
Hello Smile

I would like to profile the executables generated by fasm, and it would be nice to see what part of the code (so function / label) am I looking at, as you can see on the picture there are `unknown`s. So I wonder if there was a way to keep the label name information at compile time?

Here is the tested code:

Code:
format PE64 console
entry entry_

section '.text' code readable executable

fac:
    cmp     edi, 1
    jle     .L4
    mov     eax, 1

.L3:
    mov     edx, edi
    sub     edi, 1
    imul    eax, edx
    cmp     edi, 1
    jne     .L3
    ret

.L4:
    mov     eax, edi
    ret

entry_:
    mov     edi, 3
    call    fac
    ret

    


Thank you in advance Smile


Description:
Filesize: 71.63 KB
Viewed: 5106 Time(s)

iojdfdfjodf.PNG



_________________
The best way to predict the future is to invent it.
Post 27 May 2020, 13:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20454
Location: In your JS exploiting you and your system
revolution 28 May 2020, 12:13
fasm can generate a .fas file, which contains all the assembly data.

From the .fas file you can create a debug file suitable for your debugger.
Post 28 May 2020, 12:13
View user's profile Send private message Visit poster's website Reply with quote
Mino



Joined: 14 Jan 2018
Posts: 163
Mino 28 May 2020, 23:36
Thank you for your answer, that seems to be what I'm looking for. I can't figure out how to generate such a file however outside of fasmw?, do I need to specify a particular format or compilation option? I tried format FAS, but it doesn't compile.
Post 28 May 2020, 23:36
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20454
Location: In your JS exploiting you and your system
revolution 28 May 2020, 23:59
You specify the filename on the command line.
Code:
usage: fasm <source> [output]
optional settings:
 -m <limit>         set the limit in kilobytes for the available memory
 -p <limit>         set the maximum allowed number of passes
 -d <name>=<value>  define symbolic variable
 -s <file>          dump symbolic information for debugging    
Use the -s option.
Post 28 May 2020, 23:59
View user's profile Send private message Visit poster's website Reply with quote
Mino



Joined: 14 Jan 2018
Posts: 163
Mino 29 May 2020, 09:54
Oh nice, thank you very much!
Post 29 May 2020, 09:54
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.