Re: Problems posting to CLAX...
- From: "Evenbit" <nbaker2328@xxxxxxxxxxx>
- Date: 4 Feb 2007 13:05:22 -0800
On Feb 4, 3:29 am, Frank Kotler <fbkot...@xxxxxxxxxxx> wrote:
Evenbit wrote:
...
// Usage: txt2com < bomb.hex > bomb.com...
program txt2com;
w.WriteFile( hOUT, Obuf, 1, got, NULL );
Does this work for you? I thought, "I'll show Nathan, I'll knock off a
dos version in a couple dozen bytes!". Sleepy as I was, I went to work
on it. Gave up in total frustration and went to bed. After fixing a
number of stupid errors, it was *almost* right. Finally figured it out.
When I got to "mov ah, 9", for example, the damn TAB was converted to
spaces! Kinda breaks the Sacred OneToOne! This may be a "special
feature" of dosemu - I don't recall encountering the problem - I'm not
sure I've written a binary file to stdout and redirected it to an
executable... Doesn't work with dosemu, in any case. The obvious
solution is to write to a "real file", not stdout, but I was trying to
be lazy...
Nice touch, writing the result to stderr!
Yes, this works... er, seems to anyway. The count reaches 699 bytes
and a DIR shows bomb.com as 699 in size. I can also verify that
running the bomb makes it go KABOOM! If dosemu is expanding TABs in
StdOut, that could be a bug. Or, maybe this is standard behavior for
DOS, and the Windows API changed the nature of the game. Wouldn't
surprise me. Maybe something to do with POSIX compliance??
Openning a _regular_ file calls for parsing arguments ( isn't that the
domain of alt.debate ?? ) .. but, doesn't Herbie always preach that
command-line proggies _should_ be "filter programs" using StdIn/StdOut
redirection, piping, and stuff? [don't catch STD kiddies, practice
safe hex]
I initially was going to code this for DOS .. "I'll show Frank" .. but
decided Hella would be faster (for *me*). Added the 'count' when I
realized that this resembled my suggestion to somebody ( c.l.a.x?? )
about counting words. Kinda 'cheated' there because I should have
stayed consistent with the theme and showed
"w.GetStdHandle( w.STD_ERROR_HANDLE )" and such.
I laughed at myself after posting this and realising what I did. I
mean, I was 'half-way' to the finish-line and then I make a call to
some function (a crutch). Idiot. :)
Nathan.
.
- Follow-Ups:
- Re: Problems posting to CLAX...
- From: //\\\\o//\\\\annabee <Free\"
- Re: Problems posting to CLAX...
- References:
- Re: Problems posting to CLAX...
- From: Evenbit
- Re: Problems posting to CLAX...
- From: Frank Kotler
- Re: Problems posting to CLAX...
- Prev by Date: Re: Problems posting to CLAX...
- Next by Date: Re: Problems posting to CLAX...
- Previous by thread: Re: Problems posting to CLAX...
- Next by thread: Re: Problems posting to CLAX...
- Index(es):
Relevant Pages
|
|