flat assembler
Message board for the users of flat assembler.
Index
> Windows > win 32-64 combo-exe |
Author |
|
MazeGen 29 Apr 2010, 08:41
You can't execute any code located in 64-bit PE file in 32-bit Windows at all because 32-bit PE loader don't find valid PE header (PE signature is different).
|
|||
29 Apr 2010, 08:41 |
|
Feryno 29 Apr 2010, 12:09
Syrasia, keep your creative thinking. Sometimes it is possible to implement things looking impossible. Don't be frustrated after reading my reply to your post further.
You cannot implement your idea about using 16 bit code of exe header under win64 because: - first reason: win64 abandoned DOS emulation, win64 is not capable to run native 16 bit code, the 16 bit code included in common exe header (PE32+) is useless under win64. No one user is able to pass this limitation. - second reason: default win64 installation usually turns on noexecute option so header loaded undew win64 is marked as non executable page (it is possible to manually change that and reboot) - so most common users would be unable to run such app. Some win 32 executables packed / protected with packers / protectors using 32 bit win header tricks fail to run under win64 because of non executable header (protectors / packers which used antidebug trick by putting part of their code into win32 executable header) something out of topic: when I produce win64 executable I prefer header without 16 bit code which saves few bytes of final executable if your executable has 4 sections (PE signature then starts at offset 40h and last fourth section ends at offset 1E7h file hdr.asm: Code: format MZ compile it to produce hdr.exe of size 32 = 20h bytes 64 bit executable sample: Code: format PE64 console at 100000000h on 'hdr.exe' ... |
|||
29 Apr 2010, 12:09 |
|
Tomasz Grysztar 29 Apr 2010, 13:06
Continuing offtopic: I've seen a much simpler trick used to do the similar thing:
Code: format PE on "nul" This utilizes the fact that fasm does com2exe conversion when provided with .com file as a stub; and if the input is an empty file, it just converts an empty .com into minimal .exe. |
|||
29 Apr 2010, 13:06 |
|
Feryno 30 Apr 2010, 08:13
great trick with "nul"
it is almost always possible to further improve things looking already improved enough |
|||
30 Apr 2010, 08:13 |
|
Syrasia 03 May 2010, 09:46
on topic:
I found a very esayway to get it how I like it: I didn't wanted to have the resurces and other data double, so it should be an cobo exe. Solution: write a 32 bit exe with a 64 bit exe included and if 64 is suprted, the 32 gives the data from itselve to the 64 bit exe and ends. also thx for the ansers PS: I will try to write even an 32 bit exe, witch will use a 64 bit cpu with 32 bit os. It is posible. If anyone has some ideas, wirte them plz. |
|||
03 May 2010, 09:46 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.