From: CodeMonk on 9 Sep 2007 09:26 hutch-- wrote: > The plot thickens, for Herbert to get his ERRRMAYYYYZING 922 byte exe That might be an overstatement, but it *was* a novel approach. > file he created a dos memory image COM file with a compressed version > of a 1024 byte PE file with a message box and a dos stub with, OK, it's true he might have bent the rules, but did you not find it at least funny on some level? > "Nice to meet somebody who is still using DOS, > but his program requires Win32." > > written in it. It is written to disk with the name ___.com Is that like giving everyone the answer to the test? Anyway, of course you're right. It wasn't a legal PE format and that was the challenge. But if he did it legally, then 1024 is the best you can do. So you kind of boxed him in. > soak Wannabee's hat in schnaps so he can get > half pissed while chewin it. You must surely despise poor WannaBee. Inflicting Schnapps on the flu-ridden and hat-fixated is cruel and unusual punishment. :) - Scott
From: Wolfgang Kern on 9 Sep 2007 10:06 "�a\/b" posted code: > i "come up" with one example of routine (not a _complete_ program) > this is a function that i immage all you have something near. > there are the specifications and the traslation in nasm > **i not want challenge anyone ** i not want eat any hat > only just curious to see others functions of the same kind > :))) Good. I also use a table to convert ASCII2BIN and reverse, but my 256-bit 'semi-log-table' contains decimal digit powered binary equivalents: dec |hex (all entries are equal sized to 256 bits) 0 ... 9 are there even rare needed 10 000a 20 0014 30 001e ... 90 005a 100 0064 200 00c8 ... 900 0384 1000 03e8 .... 9000 2328 .... and so on .. until: 10^77 = dd15fe86_affad912_49ef0eb7_13f39ebe_aa987b6e_6fd2a000_00000000_00000000 even most things need just 32 bits I always use the table from my calculator for conversion. I first scan the string to get its size, a possible decimal point, the sign and also check for valid numbers and if there is an exponent. Now I know the power of the MSD given by the LSD position in the string. ie: (DEC.ASCII to unsigned 32 bits w/o DP and exponent yet) typed it out of my head, and no guaranty for any typos. _______________ ;esi = stringptr ;adjusted to MSD ;ecx = LSDpos ;relative to esi, got from the above scan ;ecx is also the power10 of the MSD xor eax,eax ;clear result register cmp ecx,+0a ;2^32 can't have more than 10 digits jnc err_input L1: ;imul edx,ecx,0a ;edx=current power10*10 (power offset in table) lea edx,[ecx+ecx*4] ;replaced by *5 add edx,edx ; *2 movzx ebx,byte[esi] ;get digit MSD is first and bl,0f ;make it BCD jz L2 ;skip if 0 add edx,ebx ;add digit offset to power offset shl edx,5 ;table entry interval is 32 byte add eax,[edx+LUT] ;add table entry to result jc err_overflow ;too large, needs a 33th bit. L2: inc esi ;next digit dec ecx ;next lesser power10 jns L1 ;include 10^0 yet _______ My 'HEX.ASCII to BIN' doesn't need any calculating for conversion I just subtract the ascii 30/07 and make the bytes to nibbles. I think you can save on many branches it your code, look at CMC, SETcc, CMOVcc __ wolfgang [...] > StrToUns: > push ebx > push ecx > push edx > push esi > %define @string [esp+20] > %define @pos [esp+24] > %define @base [esp+28] > .in: > mov esi, @string > cmp esi, 0 > je .ce > xor ebx, ebx > mov ecx, @base > cmp ecx, 36 > ja .ce > cmp ecx, 1 > jbe .ce > jmp short .c1 > .c0: > inc esi > .c1: > cmp byte[esi], ' ' > je .c0 > cmp byte[esi], 9 > je .c0 > cmp byte[esi], '+' > jne .c2 > inc esi > .c2: > mov bl, [esi] > cmp [tab+4*ebx], ecx > jae .ce > jmp short .c5 > .ce: > mov eax, @pos > mov edx, @string > mov [eax], edx > mov eax, 0 > jmp .ca > .c4: > inc esi > .c5: > cmp byte[esi], '0' > je .c4 > mov eax, 0 > .c6: > mov bl, [esi] > mov edx, [tab+4*ebx] > cmp edx, ecx > jae .c8 > mov ebx, edx > mul ecx ; in ci +/-oo > cmp edx, 0 > jne .c7 > add eax, ebx > jc .c7 > inc esi > jmp short .c6 > .c7: > inc esi > mov bl, [esi] > mov edx, [tab+4*ebx] > cmp edx, ecx > jb .c7 > .ci: > mov edx, 1 > mov eax, 0xFFFFFFFF > jmp short .c9 > .c8: > mov edx, 0 > .c9: > mov ebx, @pos > mov [ebx], esi > cmp edx, 0 > jne .ca > clc > jmp short .cf > .ca: > stc > .cf: > %undef @string > %undef @pos > %undef @base > pop esi > pop edx > pop ecx > pop ebx > ret 12 >
From: �a/b on 9 Sep 2007 12:33 On Sun, 9 Sep 2007 16:06:18 +0200, "Wolfgang Kern" wrote: >"�a\/b" posted code: > >> i "come up" with one example of routine (not a _complete_ program) >> this is a function that i immage all you have something near. >> there are the specifications and the traslation in nasm > >> **i not want challenge anyone ** i not want eat any hat >> only just curious to see others functions of the same kind >> :))) > >Good. > >I also use a table to convert ASCII2BIN and reverse, but my 256-bit >'semi-log-table' contains decimal digit powered binary equivalents: > >dec |hex (all entries are equal sized to 256 bits) >0 >.. >9 are there even rare needed >10 000a >20 0014 >30 001e >.. >90 005a >100 0064 >200 00c8 >.. >900 0384 >1000 03e8 >... >9000 2328 >... >and so on .. until: >10^77 >= dd15fe86_affad912_49ef0eb7_13f39ebe_aa987b6e_6fd2a000_00000000_00000000 > >even most things need just 32 bits I always use the table from my >calculator for conversion. > >I first scan the string to get its size, a possible decimal point, >the sign and also check for valid numbers and if there is an exponent. >Now I know the power of the MSD given by the LSD position in the string. i should follow the specification <spaces><+><digits> eg error for "-3444"; " a"; ".u988"; etc then convert the number in the digits format using the base and the table. it is for that i use mult because the base can be all 2-->36 and i have to mult by the base value if error => i return it in CF so that program should return the number of base 20 from " gh23z" but if some C program would use that function i think it is possible find errors if *pos==string or if eax==-1 (so in this case it should be not possible detect overflow from 0xFFFFFFFF (if carry flag is not seen) ) >ie: >(DEC.ASCII to unsigned 32 bits w/o DP and exponent yet) >typed it out of my head, and no guaranty for any typos. >_______________ >;esi = stringptr ;adjusted to MSD >;ecx = LSDpos ;relative to esi, got from the above scan > ;ecx is also the power10 of the MSD >xor eax,eax ;clear result register >cmp ecx,+0a ;2^32 can't have more than 10 digits >jnc err_input >L1: >;imul edx,ecx,0a ;edx=current power10*10 (power offset in table) >lea edx,[ecx+ecx*4] ;replaced by *5 >add edx,edx ; *2 it seems to me at last 10*10*9*10*8*10*7*10*6*10 etc (because my calculator say shl==(a<<=5)) edx never overflow here? >movzx ebx,byte[esi] ;get digit MSD is first >and bl,0f ;make it BCD who do you say that "bl" is a digit? >jz L2 ;skip if 0 >add edx,ebx ;add digit offset to power offset >shl edx,5 ;table entry interval is 32 byte none of these operations can overflow? >add eax,[edx+LUT] ;add table entry to result >jc err_overflow ;too large, needs a 33th bit. >L2: >inc esi ;next digit >dec ecx ;next lesser power10 >jns L1 ;include 10^0 yet >_______ > >My 'HEX.ASCII to BIN' doesn't need any calculating for conversion >I just subtract the ascii 30/07 and make the bytes to nibbles. >I think you can save on many branches it your code, >look at CMC, SETcc, CMOVcc ok >__ >wolfgang
From: hutch-- on 9 Sep 2007 18:26 Frank, First understand I have no beef with you personally, I am responding to what you have written. Let me remind you again of the content of Wannabee's challenge. =========================================== 7 Feb 2005 06:09:17 -0800 Come up with 10-20 diffrent examples of _complete_ (short) MASM programs, and I will write the RosAsm equivalents. And lets compare them. All called code must be present, except for Win32 API code. If I cannot wrote more the 70% of the examples source code, shorter, and easier to comprehend and read in RosAsm, I do you the favor of eating my hat in public, and leave this NG permanently, and pubilicly applogize for calling you an retarded demented old fagot. Do you take the challenge Hutch ? =========================================== 1. Come up with 10-20 diffrent examples of _complete_ (short) MASM programs .... The MASM32 project at that time has over 100 "(short) MASM programs". 2. and I will write the RosAsm equivalents Wannabee MUST produce what MASM can produce in the SAME format according to his challenge. If it is not the SAME format he loses tha challenge. 3. All called code must be present, except for Win32 API code. All code IS present in the MASM32 Project including the required binary libraries that are created with MASM. 4. Do you take the challenge Hutch ? Yes I did, I posted the URL to the MASM32 project at www.masm32.com Let me remind you again of Wannabee's response to my acceptance of the challenge. ========================================================================= 10 Feb 2005 06:18:05 -0800 until M$ will _go back_ on their word, that the download is illegal, no WAY I am going to even touch that site, ever again. ========================================================================= Wannabee lost the challenge by refusing to conform to the conditions he dictated, item (1.) above and not doing what he claimed he would do under his own challenge in condition (2.) above. Wanabee has a hat to eat, a mouth to shut and the need to puhk off from ALA forever in accordance with his challenge. Let me again remind you of Wannabee's promise. ================================================== If I cannot wrote more the 70% of the examples source code, shorter, and easier to comprehend and read in RosAsm, I do you the favor of eating my hat in public, and leave this NG permanently, and pubilicly applogize for calling you an retarded demented old fagot. ================================================== > As nearly as I can tell, "square zero" would be "minimum.asm". No it isn't, read Wannabee's challenge above, Wannabee must be able to duplicate ANY PIECE OF CODE in the MASM32 project in accordance with his challenge. Instead of the simplest code like "minimum.asm" he needs to be able to reproduce ALL OF MASM's capacity in binary libraries and its pre-processor. If you have ANY DOUBTS ABOUT THIS read his challenge again. > (heh! how "old school", jumpin' over the data! :) Yeah, win32 is like a COM file in that you can embed read only data in the code section as long as you don't want to change your section attributes. > I see a pantload of "include"s, but what would we actually *need* in > terms of "the entire code", to make it assemble. I see "MessageBox", > "ExitProcess", and "MB_OK" (zero - even *I* know that one!). I have never offered to modify or simplify MASM code to suit the limitations of other tools, Wannabee challenged MASM inits existing capacity, I took up his challenge and he tried to abandon his challenge. > I understand there's a bug in Masm - dunno which > version(s) - in which, if passed a byte, "invoke" pushes six bytes. Do > we have to do *that*??? If you have a bug report on a version of MASM, make it to Microsoft, I know of no problem with prototyping a BYTE argument to use with invoke. > No need to post the entire "megas" of include > files and libraries - we'll try to "infer" what the parts that aren't > showing "must" do. You can help us out if we can't "infer" it. I am not interested in yours or anyone elses attempts to apply reductionism to some notion of a lowest common denominator, Wannabee challenged MASM in its capacity and he could not deliver. Now if you still have problems with Wannabee's challenge, to use your own words, "What part of Wannabee's challenge don't you understand ?". :) Regards, hutch at movsd dot com
From: hutch-- on 9 Sep 2007 18:29
HAY Wannabee, Better whip out that hat and start chewin on it, this following pile of crud is using code / macros that you have not published according to your challenge. > [push | push #1 | #+1] > [call | push #L>2 | call #1] > > [DialogTitle: "Minimum RosAsm" 0 > Message: " --- Assembler Pure and Simple --- ", 0] > > [MessageBox | #=4 | push #L>1 | call 'USER32.MessageBoxA'] > > [ExitProcess | Push 0 | call "KERNEL32.ExitProcess" ] > > main: > push &MB_OK | push DialogTitle | push Message | push 0 | call > 'USER32.MessageBoxA' > > push 0 | call "KERNEL32.ExitProcess" > > ;; > The following are the same function calls using a selection of RosAsm > user defined macros. Type checking are not fully implemented > in the currect version of RosAsm, but He is working on it :) > ;; > > MessageBox 0 Message DialogTitle &MB_OK > ExitProcess > ______________________________________________________________________________________ > > DING! DONG. |