News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

making smallest 32-bit "Hello World" application

Started by white scorpion, March 28, 2005, 05:33:25 PM

Previous topic - Next topic

hitchhikr

Quote
I learned a lot about the PE format and about assembler.

Not enough apparently.
Your file doesn't work here under windows xp.

OceanJeff32

DEBUG.EXE is already installed on WIN98 to WINXP, I believe.  And it's free, and a lot of the older programming books mention it, and how to use it.  But it is pretty simple.

You can make .com files with this too. (I think someone else mentioned this earlier).

I've even made graphics .com files recently that were only a couple 100 bytes or so.

Later guy,

Jeff C
:U

P.S. You mentioned mass mailing emails of this small program, don't be making no viruses now...
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

thomasantony

Hi,
I have got bored of everything else. Right now I am working on making a working PE execuatble using a hex editor. Its going pretty well. First I will make a  file with only a RET. Then add an ExitProcess, and then an MessageBox. THe funny thing is I put somedummy value in the linker version field of the PE header and a file analyser program tells me it is packed with Morphine!! :dazzled: I am going to try changing this value to see what happens.

Thomas
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

hitchhikr


thomasantony

No.
At first there is no ExitProcess. Only a RET. Then I add ExitProcess to learn adding Import table. I am still working on it. I have a doubt though. I know that when we call an API function which goes to a jump table with jmp dword ptr[XXXXXXXX]

So what should this XXXXXXX point to? The FirstThunk member of the Import Descriptor?

Thomas
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

hitchhikr

The correct dword located within the IAT.
The jmp isn't necessary either.

roticv

But without an import, the exe will not run on win2k. So you need an import if you want your exe to run in win2k. Usually the best function to call is still ExitProcess.

hitchhikr


But without an import, the exe will not run on win2k. So you need an import if you want your exe to run in win2k. Usually the best function to call is still ExitProcess.


No, PE executables don't require an import table.

EXitProcess only is useful if you forget to close opened files, you've created one more or several threads or if some used dlls you're using need to perform some special operations on DLL_PROCESS_DETACH/DLL_THREAD_DETACH.

Vortex

hitchhikr,

Did you try to run executables without import section on Win2K?

hitchhikr

#24
Did you ?

pbrennick

If this continues to devolve into an argument, I will pull the plug.

Paul

roticv

I am stating a well-known fact. I am very sure about it as I used to own a win2k. There are tools that fix exe that have no import tables so that it would run in win2k. The pe loader for win2k is just different (extremely picky) from the pe loader found on other windows.

And I don't intend this to be an argument.

Quoting f0dder from win32asmcommunity board
QuoteYou must make sure kernel32 is mapped in your process, otherwise your process won't load on all win32 versions (win2k, for instance).

hutch--

Folks,

Plase keep debates !!! OUT !!! of the Campus, its for programmers learning assembler, not an arena for extended argument.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

thomasantony

Quote from: hitchhikr on April 02, 2005, 12:15:04 PM
The correct dword located within the IAT.
The jmp isn't necessary either.
Which is this 'correct DWORD'?

Thomas
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

OceanJeff32

I'll look around this week, and see if I can find any of my DEBUG made .com programs, and upload them here, the Hello World, I think it's like 32 bytes, most of that being the Hello World string statement itself.

.com files are SMALL.

Later,

Jeff C
:bdg

P.S. If you want to see the display, you have to be in command-line also, the programs I made executed in a split second, and then were gone!!!
Any good programmer knows, every large and/or small job, is equally large, to the programmer!