flat assembler
Message board for the users of flat assembler.
Index
> DOS > DPMIST32.BIN |
Author |
|
DOS386 18 Feb 2008, 05:07
EDIT : deleted , was crap, is a shared problem of PESTUB and NT/XP's PE loader , see below
Last edited by DOS386 on 02 Mar 2008, 08:26; edited 2 times in total |
|||
18 Feb 2008, 05:07 |
|
Japheth 19 Feb 2008, 08:22
DOS386 wrote: [code] "size reduction" (32 bytes), "reduced compiling cost" and "added date" are no critical improvements, they are pretty irrelevant. The "reduced assumptions about DOS behaving nicely" is something which I don't understand. What's good is the "made code more flat", indeed there's ways too much segment register changing in this old stuff. What you apparently didn't improve, although it IS a fault, is the max. path size. It's just 70 (46h) bytes in the original source, but a full short path can be up to 80 bytes (3+64+1+12). |
|||
19 Feb 2008, 08:22 |
|
revolution 19 Feb 2008, 08:44
DOS386 wrote: Regrettably my size reduction by 32 bytes will not help over crappy PE loader implementation in NT/XP - such patched apps will no longer work there if total size of ALL headers (MZ header, MZ code, PE header, NT optional header, sectional header, ...) is > then file align ... this means for file align of $200 the stub would have to be cca < $C0 bytes ... no space for any useful code ... and with existing $200/$1E0 stubs, file align of $400 is the minimum The bugginess is very random, from "Not a valid Win32 application", through "Failure to initialize at 43987373984" up to silent abort. Original quality from M$ I can understand if the header goes over the page alignment (0x1000), then you would have much trouble with relocating the following code and data, but as long as the total header size stays under 0x1000 then what is the cause of the problem? |
|||
19 Feb 2008, 08:44 |
|
Tomasz Grysztar 19 Feb 2008, 10:49
revolution wrote: I'm wondering why you can't just extend the header by 0x200 bytes and shift down the rest of the data. Is there some basic flaw in the loader? I have seen many PE files with lots of sections that make the header large. I have never met such problem - with fasm's "format PE on 'stub.exe'" feature I was able to combine even quite large DOS programs with Win32 ones - some of the early releases of fasm were comibining the DOS version with Win32 version into a single executable this way. |
|||
19 Feb 2008, 10:49 |
|
revolution 19 Feb 2008, 11:09
This works perfectly on my XP box.
Code: ;filename BigStub-Stub.asm format MZ segment zz entry zz:0 stack 128 heap 0 push cs pop ds mov ah,9 mov dx,message int 21h mov ax,4cffh int 21h message: db 'Windows 95 or higher required for this program!',0dh,0ah,'$' db 63 shl 10 dup 0xaa Code: ;filename BigStub-App.asm format PE GUI 4.0 on 'BigStub-Stub.exe' include 'win32ax.inc' .code start: invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!","Win32 Assembly",MB_OK invoke ExitProcess,0 .end start |
|||
19 Feb 2008, 11:09 |
|
DOS386 20 Feb 2008, 00:57
EDIT : deleted , was crap
Last edited by DOS386 on 20 Feb 2008, 23:47; edited 1 time in total |
|||
20 Feb 2008, 00:57 |
|
DOS386 20 Feb 2008, 01:05
> "size reduction" (32 bytes), "reduced compiling cost" and
> "added date" are no critical improvements, they are pretty irrelevant. > What you apparently didn't improve, although it IS a fault, is the max. path > size. It's just 70 (46h) bytes in the original source, but a full short path > can be up to 80 bytes (3+64+1+12). OK ... but who said it can't be even more ? C:\ - 3 blah\blah\...\foo\foo\ - 64 ??? "\" at begin doesn't count ? ZERO at end, not here ??? - 1 ABCDEFGH.BUG - 12 _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
20 Feb 2008, 01:05 |
|
revolution 20 Feb 2008, 02:21
DOS386: You are blaming Windows for something that is your own fault. You didn't properly set the field SizeOfHeaders (offset 0x54) in the PE header. You should take more time to examine why things don't work rather than simply blame the OS.
|
|||
20 Feb 2008, 02:21 |
|
DOS386 20 Feb 2008, 03:05
EDIT : deleted crap, bee below
Last edited by DOS386 on 21 Feb 2008, 00:02; edited 2 times in total |
|||
20 Feb 2008, 03:05 |
|
revolution 20 Feb 2008, 03:24
In your example, just change offset 0x254 (PE header + 0x54) to 0x400 and the program will run fine on XP.
|
|||
20 Feb 2008, 03:24 |
|
DOS386 20 Feb 2008, 23:46
> DOS386: You are blaming Windows for something that is your own fault.
Thanks for the crucial hint > You didn't properly set the field SizeOfHeaders (offset 0x54) in the PE header. Thanks for the crucial hint ... YES and NO I did set it correctly, RTFS: http://board.flatassembler.net/topic.php?t=6735 > You should take more time to examine why things don't work Thanks for the crucial hint ... but I did ... just did not examine in the correct direction > In your example, just change offset 0x254 (PE header + 0x54) to 0x400 and the program will run fine on XP. Thanks for the crucial hint ... you're right ... it runs ... veni, vidi, vanishing virii ... or criminal bugs at least Download now: http://board.flatassembler.net/download.php?id=3627 But "this" BUG had been confirmed by Japheth and other people also ... and finally it seems to be at least partially his BUG in PESTUB PESTUB.TXT wrote: Quote:
EDIT : removed some false assumptions Last edited by DOS386 on 22 Feb 2008, 00:17; edited 1 time in total |
|||
20 Feb 2008, 23:46 |
|
Japheth 21 Feb 2008, 04:18
DOS386 wrote: No expert is safe from criminal bugs, and you shouldn't trust anybody You tend to be a bit "fast" in your assumptions. Don't blame other people for your bugs, that's not the way a brave man should act. There's nothing wrong with what I wrote. |
|||
21 Feb 2008, 04:18 |
|
DOS386 22 Feb 2008, 00:41
.
Japheth wrote: > supply a list of at least 2 bugs ASAP, now I was busy with PESTUB > You tend to be a bit "fast" in your assumptions. Maybe > Don't blame other people for your bugs It's not "my bug" - RTFS - or if you see a bug in, please point me to it > that's not the way a brave man should act. Maybe ... but the world indeed is full of such brave man's > There's nothing wrong with what I wrote. Not really wrong ... it seems pretty correct, it's just not the full truth, and somewhat "misleading" ... I was at least partially correct with my both "blamings" - NT/XP's PE loader indeed has a bug (or "stupid restriction" at least) - about (header size)<(lowest RVA size) as you wrote, and, PESTUB has bug with not increasing SizeOfHeaders (Commented out ? Not default ?) - it "trashes" my executable as well as all (most) executables coming from FASM (file align=$200). Tomasz wrote: Quote: I have never met such problem - with fasm's "format PE on 'stub.exe'" feature I was able to combine even quite large DOS programs with Win32 ones YES. Very true and very well done ... FASM indeed increases both SizeOfHeaders and the RVA's if necessary, and the result works. Now, we have following PESTUB issues: - Doesn't adjust SizeOfHeaders. Why ? - Doesn't increase the RVA's. Impossible (?) with "ordinary" Win32 executables because (?) of no fixups, possible but not worth the effort (?) if fixups present ? - Doesn't warn about too big stub breaking the (header size)<(lowest RVA size) criteria - Documentation: > This should be no issue with DPMIST32.BIN, which just is 200h bytes long except we have absurdly many sections ? > but may be a problem if the new stub is to be DPMILD32.BIN. This seems to be somewhat confusing / "wrong", and soon obsolete : - For DOS PE/PX, there is no problem - NP/XP never has to load it - For dual-mode PE, there is no point to patch-in more than DPMIST32.BIN (returning to original topic ) So I assume/suggest, that DPMILD32.BIN will get deleted in favor of the new DLL-hell-disabled PELOAD32.BIN anyway Write a bit more about increasing vs non-increasing SizeOfHeaders, and about the (header size)<(lowest RVA size) criteria - PESTUB is not suitable to create a dual-mode executable because of this - result will be "buggy" and run in DOS, on ME, but not on NT/XP |
|||
22 Feb 2008, 00:41 |
|
Japheth 22 Feb 2008, 07:48
DOS386 wrote: . This has been implemented optionally (see -s option for PESTUB) because there is or at least was a problem with WinXP. |
|||
22 Feb 2008, 07:48 |
|
DOS386 23 Feb 2008, 13:53
Download now: http://board.flatassembler.net/download.php?id=3631 (2008-02-22)
Japheth wrote: > This has been implemented optionally (see -s option for PESTUB) > because there is or at least was a problem with WinXP. Could you write a bit more about this (historical ? ) problem, please ? I have always a problem with XP if I don't adjust this, no problem if I do Example: http://board.flatassembler.net/download.php?id=3628 -- ----------------------------------------------------------------------- Well, the long awaited list with at least 2 bugs I've fixed, not in the version from Feb-18 (deleted, immature, most critical bug was NOT fixed there), but in the one from Feb-22: - Increased PATH limit from 70 to 80 byes (BUG, but doesn't count as point for me, of course ) - Using non-8086 compatible instructions without testing before (BUG, minor, 1/2 point for me) - In your "HEX8" routine, you use "10h", but should be a decimal 10 (BUG, 1 point for me) - Useless calculations with constants (BUG, minor, 1/2 point for me) - "Looping-BUG", "RC from overlay" is almost dead code and doesn't really work, accepts happily broken DPMILD32.EXE (BUG, critical, at least 2 points for me ) The looping bug was NOT fixed in my Feb-18 version, even worse, the symptoms were even more malicious in most cases DOS is stupid and won't reject a broken EXE (size=0, size=infinity, no MZ at all, truncated file, ...) ... loads (in some cases) nothing but still reports "success" and thus your stub doesn't start DPMILD32.EXE, but itself again, raising various random bugginess ... from "invalid optcode" ... through garbage output (see shot) ... up to "rc 2 from overlay" (bad, not informative for an average user, would be "file not found" - still wrong). Actually a failure in this call is almost impossible: previous search excludes file/path not found, anything else seems not be be possible with loading overlay anyway ... dead code ). Added some check for DPMILD32.EXE intactness - ruined my size reduction, much better now, but still not perfect - would have to increase size above $200 bytes, or completely remove the "RC from overlay" code ... |
|||
23 Feb 2008, 13:53 |
|
Japheth 23 Feb 2008, 19:52
DOS386 wrote:
Using "non-8086 compatible instructions" is not a bug. The test for 8086 cpu is intentionally missing. It is documented - and a matter of course - that hx - a DOS extender - won't run on a 8086 system. I don't accept the "useless calculations" fix, since it is at best an optimization, not a bug fix. I also don't accept the "looping bug". First, it's not included in your 02/19 version, for which you claimed to have fixed "many bugs" and second, it works with a valid DPMILD32.EXE and relies on DOS to return errors. Implementing additional security checks is possible of course, but this doesn't make the current implementation "buggy". So just 1 fixed bug remains. "One" is NOT "many"! Even worse, in your 19/02 version (which you - wisely! - deleted in the meantime), there is: Code: and al,$0F cmp al,$10 sbb al,$69 das ; Digital Attack System stosb ; [ES:DI] ret which makes me doubt that the one bug which is acceptable was indeed fixed in THAT version already. |
|||
23 Feb 2008, 19:52 |
|
DOS386 24 Feb 2008, 01:03
Quote: Using "non-8086 compatible instructions" is not a bug. The test for 8086 cpu is intentionally missing. It is documented - and a matter of course - that hx - a DOS extender - won't run on a 8086 system. Quote: ; Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details Bug or not bug Quote: don't accept the "useless calculations" fix, since it is at best an optimization YES. Quote: don't accept the "looping bug". First, it's not included in your 02/19 version Preliminary and experimental version ... Quote: it works with a valid DPMILD32.EXE YES. Quote: and relies on DOS to return errors. Something that seems not to happen ... Quote: but this doesn't make the current implementation "buggy" Code that doesn't do what it probably was supposed to ... Quote: Even worse, in your 19/02 version (which you - wisely! - deleted in the meantime), there is Quote: which makes me doubt that the one bug which is acceptable was indeed fixed in THAT version already. YES, I deleted "wisely" the version ... because it was buggy ... and it's no secret that that those bugs were not yet fixed there ... _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
24 Feb 2008, 01:03 |
|
Japheth 26 Feb 2008, 08:28
DOS386 wrote: Bug or not bug You seem to have a rather vague idea of what a bug is. Just citing some text which supports your believes is not the way to go ... it will not intimidate me. Quote: Code that doesn't do what it probably was supposed to ... It is supposed to run with an unmodified DPMILD32.EXE. Isn't this a matter of course? Quote: YES, I deleted "wisely" the version ... because it was buggy ... and it's no secret that that those bugs were not yet fixed there ... IMO deleting posts after other people did respond to it is not very polite, because it makes the responses incomprehensible. |
|||
26 Feb 2008, 08:28 |
|
DOS386 02 Mar 2008, 08:24
Japheth wrote: it will not intimidate me. Was not my goal ... Quote: IMO deleting posts after other people did respond to it is not very polite, because it makes the responses incomprehensible. I see the problem ... but keeping wrong conclusions is bad also, and I placed bold warnings about my edits _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
02 Mar 2008, 08:24 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.