Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,207 of 4,675    |
|    wolfgang kern to rugxulo    |
|    Re: Hex to bin    |
|    31 Dec 17 14:06:01    |
      From: nowhere@never.at              rugxulo wrote:              > Hi,              Hello,              >> when once everyone got such a tiny tool we could share binaries       >> of any size either RM or PM or LM.              > With all due respect, you're already assuming an OS.              of course :) how else could it be read from internet ?              > So who doesn't already have "something" to script/compile/assemble with?              Such TEXT2BIN and BIN2TEXT converters would work with any x86 OS and may       just need an assembler to built it. It doesn't need much, so it could be       inlined as well.              > Debug? QBASIC? REXX? AWK? C? Pascal? Forth? 4DOS?       > MS-DOS/PC-DOS/DR-DOS/etc. should all come with DEBUG by default, IIRC.              whatsoever your favourite is..              > I'm not saying it's a bad idea to do it all by hand, but it's dicey.       > (Can you even redirect binary to stdout and then file if it has       > certain chars, e.g. Ctrl-Z, aka 0x1A? Will that be truncated or not?)              a 5:4 BIN2TEXT encoder takes four bytes from source and make five printable       characters out of it.       ie: (my suggestion)        the binaries are converted into characters 0x23..0x78 only.        character 0x22 can be used as start and as end indicator.        everything else like SPACE,CRLF,TAB,.. can be in there but        will be skipped/ignored by TEXT2BIN.        even I'm not a friend of BigEndian I'd store the TEXT with MSD first.              ie: ffffffff ;/55^4 = 52 ;+23 = 75 ="t" (0x55^4 = 0x031c84b1)        -ff2280b2 ;sub 55^4*52        =00dd7f4d ;/55^3 = 17 ;+23 = 3a =":" (0x55^3 = 0x00095eed)        -00d7874b ;sub 55^3*17        =0005f802 ;/55^2 = 36 ;+23 = 59 ="Y" (0x55^2 = 0x00001c39)        -0005f406 :sub 55^2*36        =000003fc ;/55 = 0c ;+23 = 2f ="/"        -000003fc ;sub 55*0c        =00000000 ; ;+23 = 23 ="#"              the string for this is "t:Y/#"              let's see if ot works the opposite direction as well:       get first character "t", sub 23 and MUL by 55^4        =ff2280b2        +00dd7f4d +next ":", sub 23 and MUL by 55^3        + ..... we already see that this will work as expected :)              So a news-msg may look like:       ______       Hello!       here is my code (no sense at all yet):       "z&zxDH$KJG öH%!JT568/*       YE^T>E\T.DGì Hl;lk;l?"       --       bye       ______              just copy the part between the quote marks to your decoder.              > Seriously, ask some Forth gurus how they bootstrap their machines.       > I'm sure they have tons of good ideas. They've been around the       > block a few times.              I don't know how Forth folks do it, I just searched for anything better       than BASE64.       This code share idea wasn't meant to transfer a whole bootable OS, but it       could be used for it too.       __       wolfgang              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca