flat assembler
Message board for the users of flat assembler.

Index > Windows > Debug Symbols for Fasmw programs

Author
Thread Post new topic Reply to topic
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
Edit: new version here that I hope will run for everyone. see posts below.

Here is a lil' ol' program that may be of help to some of you in creating debugging symbols for Ollydbg when debugging Fasmw programs. It is still a bit crude around the edges, but should be usable.

Be sure to read the "readme.txt" file first since this program needs a bit of setup to make it fully functional.

The basic premise is to create an export file containing as many exportable symbol names from a program as possible (within the current flbls.exe limitations). Then add the export file to the program with an include and recompile. Course if you delete a symbol be sure to remove it from the export file before compiling again or the compile will error. Best way is to save your source and then run flbls against the source to regenerate the export and then compile.

Ollydbg can use these symbols to make the code and data sections more readable.

If you want to see it what the final result looks like just run this program (flbls.exe) in Ollydbg and widen the Address columns to see the names in the code and data windows.


Description: Unzip this in its own folder and read the readme.txt and follow instructions.
Download
Filename: flbls.zip
Filesize: 53.47 KB
Downloaded: 49 Time(s)



Last edited by handyman on 18 Jan 2008, 17:18; edited 2 times in total
Post 14 Jan 2008, 02:00
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Good work, will try out Smile, you should make (if not already) a little window that shows the current block or function of original code (commented) off to the side while debugging, because I know that every two seconds I'm switching back and forth between windows tracking down the right section of code and trying to understand what I was doing... Good idea for V2

[edit]: Uhh, is this supposed to happen?
[/img]

lol I opened a .asm file, then clicked "list all".


Last edited by AlexP on 14 Jan 2008, 02:52; edited 3 times in total
Post 14 Jan 2008, 02:17
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Nice Very Happy

I see a problem however, labels are exported with the ":" as well, is it intended behaviour?

Example:
Code:
0040A90F  |. E8 70020000    CALL flbls.SetBuff:
0040A914  |. E8 90000000    CALL flbls.Add2Loc:
0040A919  |. E9 89000000    JMP flbls.chk4var.end:    


Also there is two problems with Ctrl+G, one is related to ":", since the label contains it but Olly ignores it for the search it never finds the symbol, and the other problem is with the dot since since the first word before the dot is considered a module name so those labels are unsearchable for this extra condition too. The latter problem doesn't look very fixable though Sad
Post 14 Jan 2008, 02:24
View user's profile Send private message Reply with quote
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
Don't use Ctrl+G for searching for label names, (see my comments in the readme.txt file) instead use Ctrl+N and use the name lookup window.

The naming convention is desired the way it is because it shows you the real name vs the .local name that can be used in the source code, and it is what fasm is really using for a label (except for the ":") when it compiles the code.

And yes the ":" behind the lable names in code is desred because it lets you know in the names lookup window (Ctrl+N) what you are looking at.
Post 14 Jan 2008, 02:35
View user's profile Send private message Reply with quote
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
AlexP:

Well, no, it's not suposed to do that!

I wrote program under Win 98SE, and do not have any other operating systems to try it out on. Runs fine there.

Run program in Ollydbg if you can and see if it tells you where it bombs and let me know what you find out if you can.

Also if you are going to put in screen shot, be sure to reduce the size, cause the last one widened everything up to where this thread is now double the width of my screen, so now I have to scroll left and right.
Post 14 Jan 2008, 02:41
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
wow horrible stuff happened... sry but now I've gotta go 2 sleep but maybe others can help debug... Olly went weird on several occasions after I hit the "list all" button, then it displayed many weird thread-related messages at the status bar of olly. Well, g night.


Last edited by AlexP on 14 Jan 2008, 03:04; edited 3 times in total
Post 14 Jan 2008, 02:50
View user's profile Send private message Visit poster's website Reply with quote
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
AlexP
Something to try, I noticed that is seems you have spaces in the path name. Try a path that does not contain any spaces and see if it works. My win98 version for Fasmw and my program does not like any imbedded spaces in the path.
Post 14 Jan 2008, 02:56
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Still crashed w/o spaces Smile
Post 14 Jan 2008, 03:06
View user's profile Send private message Visit poster's website Reply with quote
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
maybe Olly will give a hint of what happens. If you can run it in Ollydbg, maybe it will stop at the problem area. Just a thought. What operating system are you using?
Post 14 Jan 2008, 03:27
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
You're lucky I couldn't sleep Smile. If u looked at the taskbar, Vista 32-bit. I know, right? Should work perfectly but it keeps screwin' up on me. I'll debug it tomorrow after school(, and homework, and studies) and report back here probably in under 24 hrs. Good night finally..

PS: U should team up w/someone else to make a more visually appealing version of it once u get bugs worked out, good project idea for u
Post 14 Jan 2008, 04:21
View user's profile Send private message Visit poster's website Reply with quote
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
AlexP
download it again, I changed the memory allocation code a bit for better memory allocation matchups. Maybe the way I was handling it a first is what was messing you up. I have heard that Vista is quite a it more picky about some things then 98SE.
Post 14 Jan 2008, 05:31
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
handyman

your program even doesn't start under Windows XP SP2 (both: original '.EXE' and recompiled with FASM 1.67.25.).
Post 14 Jan 2008, 15:56
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
But it starts here and I also have Windows XP SP2 Confused
Post 14 Jan 2008, 16:52
View user's profile Send private message Reply with quote
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
AlexP
Quote:

Good work, will try out , you should make (if not already) a little window that shows the current block or function of original code (commented) off to the side while debugging, because I know that every two seconds I'm switching back and forth between windows tracking down the right section of code and trying to understand what I was doing... Good idea for V2


Not sure what you are wanting here - and this comment was made prior to any attempt to run my program - except that as far as I can understand this particluar request there is no way my program, or any other that I know of that is outside of Olly (or any other debugger) for that matter, could do this. You may be able to make a plugin in Ollydbg that will do this, but you will have to do it yourself since you know what you have in mind for what you want .

The best thing you could probably do is help me figure out why you cannot run my program, cause if you could it would help you place all the labels it can from your source into an export section in you program so that they can be imported into Olly so that when you run the program there you can see exactly where you are. I know it is in intermedate step that then has to be done for this, but until Fasm can put debugging symbols in this could be a way to get some symbol info into the debugger quicker then entering the info in yourself, or having to keep matching disassembled code to the source. If you are not using Ollydbg then this may not work either.
Post 16 Jan 2008, 02:48
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
I don't have time to do anything in the next two days, semester finals in school...

Lol I got an error box this time -
Post 16 Jan 2008, 02:56
View user's profile Send private message Visit poster's website Reply with quote
handyman



Joined: 04 Jun 2007
Posts: 40
Location: USA - KS
handyman
I think I may have found what is causing problem. I was using old InitcommonControls, which I have discovered is defunct and have replaced it with InitCommonControlsEx. I updated the zip file in the first post, so it is the most current version at this time.
Post 18 Jan 2008, 17:24
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.