flat assembler
Message board for the users of flat assembler.

Index > Main > Executable examples for each supported format would be nice

Author
Thread Post new topic Reply to topic
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder 28 May 2004, 14:29
First off, I had some time deliberating whether I should place this in Main or Heap but then I read description of Heap which said "Everything not related to assembly programming should be posted here." Well, this is definitely related to assembly language programming so here it goes.

What I think would be nice is if there were some working examples (in hexadecimal) of each type of executable and object format which fasm supports, along with PLENTY of comments to the side of each line.

There should be no unexplained byte(s).

These could serve as sort-of tutorials for learning each of the various executable formats (PE, ELF, etc..)

The problem I have with the specs for the various formats is that they are difficult to follow without a functional example. The problem I have with the only example PE file example I have seen done this way is, quite simply, IT DOESN'T WORK! Windows complains that it is an invalid executable. It doesn't work on Windows98 and it doesn't work on WindowsXP. Supposedly it works on some flavor of WindowsNT but bleh...if it can't even run on the "standard" versions of Windows then it's not a very good example.

Specifically, I am interested in seeing functional examples for an ELF executable which runs under Linux, a PE executable which runs under any arbitrary Win32 OS, and quite possibly a COFF object file which then could be linked in with others via a linker to create a finished executable which runs under any arbitrary Win32 OS.

I think this could really help out those of us who wish to "hack it together" by hand a few times (a few programs) as a learning experience.

By functional I mean just that---the examples have to be complete and they have to WORK on the designated OS. They don't have to be complicated (and probably should be as simple as possible) but just having a few well-documented examples like this would be nice, don't you think?
Post 28 May 2004, 14:29
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 28 May 2004, 17:06
Well, AFAIK, there are such examples in every package of FASM. For example in FASMW - there are examples about Windows PE, DLL's.
In FASMC are more simple examples about console applications and so on.
If you want to collect all examples in one place, you simply have to download all FASM packages (they are small in size, so it is not a problem.)

Regards.
Post 28 May 2004, 17:06
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder 28 May 2004, 18:01
No, I don't think we are talking about the same thing. I have looked (just now) and I cannot find anything like what you are talking about.

Yes there are example applications for making PE and ELF executables in assembly language using fasm and directives but that is not what I am asking at all.

I want (basically) a hex dump of very simple PE and ELF programs (and COFF as well) with each hex byte explained so that no byte(s) in the file are left over as "mystery".

I have read over the ELF and PE TIS specifications and looked over some PE tutorials but I don't think this is enough without a viable sample/example (at least one of each type). Yes there was something like this for PE files but it wasn't a viable example because the resulting program doesn't work under either of Windows98 or WindowsXP so then how can I know that anything written in the tut is valid? Obviously there are some major errors in there or I would think it would work on at least one of either Windows98 or WindowsXP wouldn't you think?

I would like to try some flat assembling of assembly code and then, using such an example (well-commented and fully functional) then I can use that to guide me in using a hex editor to piece together a few trial applications in this way. Then I will have an excellent understanding at the lowest level possible for both current Windows and Linux programs if I can get my own code to work, using such tutorials.

The specifications are good, I think, but difficult to follow without sufficient examples.

Am I the only one who wants this?
Post 28 May 2004, 18:01
View user's profile Send private message Reply with quote
khanh



Joined: 25 Jul 2003
Posts: 27
khanh 01 Jun 2004, 11:06
May be a good idea!
But will require a lot of time? Considering each of byte in the source code you have to comment in 5 or 6 words at least? Who can be patient to do that.
Post 01 Jun 2004, 11:06
View user's profile Send private message Reply with quote
polygon7



Joined: 14 Aug 2003
Posts: 62
Location: Poznan, Poland
polygon7 01 Jun 2004, 12:17
ShortCoder wrote:

I want (basically) a hex dump of very simple PE and ELF programs (and COFF as well) with each hex byte explained so that no byte(s) in the file are left over as "mystery".


Hi, look at:

http://board.flatassembler.net/topic.php?t=1309
http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
http://asmjournal.freeservers.com/issues/apj_2.txt
http://www.google.com

_________________
best regards
p7
Post 01 Jun 2004, 12:17
View user's profile Send private message Visit poster's website Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9 01 Jun 2004, 12:52
i don't get any clue,

it seems to me, "we need X we need Y we need Z".

as a newbie, to tell you all, simply we don't need it. ;) actually don't need it.

IT is already there. something different thing we need.

--
too smoking crack? maybe.
Post 01 Jun 2004, 12:52
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 01 Jun 2004, 13:02
fasm9, look at this tutorial and tell me if this is of some help for you.
Post 01 Jun 2004, 13:02
View user's profile Send private message Yahoo Messenger Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder 01 Jun 2004, 18:11
polygon7 wrote:
ShortCoder wrote:

I want (basically) a hex dump of very simple PE and ELF programs (and COFF as well) with each hex byte explained so that no byte(s) in the file are left over as "mystery".


Hi, look at:

http://board.flatassembler.net/topic.php?t=1309
http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
http://asmjournal.freeservers.com/issues/apj_2.txt
http://www.google.com


The first two were mighty helpful. Thank you.Smile
The third doesn't allow direct linking but I think I'll just go and read all those articles now anyway (couldn't hurt right?)

The last one---yeah, I use that a lot;)

_________________
Boycott Symantec/Norton/PowerQuest whenever possible
Post 01 Jun 2004, 18:11
View user's profile Send private message Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder 01 Jun 2004, 20:27
Posthoc:

The first resource--VERY good and works as it should (at least under WindowsXP)

second resource--haven't had a chance to test it yet (probably won't for a while) but I'm thinking probably good as well

Third resource (yes, I found the text you wanted me to see and the appropriate section at the bottom of it), not so good. WindowsXP says it is not a valid executable and terminates the application. This is a problem I had with another PE-from-hex example I had in the past (which, to me, says "discard"). Again, if you're going to make a Win32 PE file from hex it at LEAST should work on one of Windows95, Windows98, or WindowsXP. This example doesn't. However, aside, I did find the XLib via inline assembly to gcc to be instructional/educational but I only wish the entire thing was in asm (rather than only inlined).

Fourth resource--good but doesn't have nearly the filtering options it should (someone should really build a search engine which has regular expression entry abilities, which IS fully case-sensitive, and which allows you to search for literal strings) If you want to see an example of such frustration, try any search with a '.' '-' '_' or '$' character in google. You will find that, even if you quote the entire thing in a string, it STILL ignores those characters, even if you only wanted results with those EXACT characters in them. I have emailed them about this a long time ago but they seem to delusionally think it already does this so if someone else wants to try emailing them, go ahead.

I'm really hoping someone will design a better search engine than google one of these days though (or at least if google would improve). Just because google is the most popular search engine and arguably the best at present day does not mean that it cannot be improved dramatically. Any of my suggestions above would make for a better search engine if implemented.

_________________
Boycott Symantec/Norton/PowerQuest whenever possible
Post 01 Jun 2004, 20:27
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.