home bbs files messages ]

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 2,762 of 4,675   
   Kerr Mudd-John to wolfgang kern   
   Re: BASE64 again   
   29 Jun 17 16:03:31   
   
   From: admin@nospicedham.127.0.0.1   
      
   On Thu, 29 Jun 2017 15:06:40 +0100, wolfgang kern  wrote:   
      
   > Kerr Mudd-John wrote:   
   >   
   >>>> Yup; a whole heap of mods to the first line to make it a b64 decoder.   
   >   
   >>> I may have reached the end of this story (or at least for now),   
   >>> tried on:   
   >   
   >> Darn! I was hoping for more inspiration! My attempt at a SMC 1st line   
   >> B64 decoder is wallowing in fixup constant clashes.   
   >   
   > I'm still here...even a bit lost in a dead end road.   
   >   
   > First thing my variant does is to move the unmodified string to 044.   
   >   
   I move mine after fixups (do I still need a jmp to reload the cache? I doubt   
   I'll be putting this on a 486), your way is probably shorter.   
      
   > I need three bytes for one single or paired modify to produce 00..20   
   > and A7..FF by one SUB, but it needs two bytes more to create 7B..A6.   
   >   
   > ie:   
   >  PUSH 0x7761         ;could have used 0x7a61   
   >  POP AX              ;(4 byte)   
   >  SUB [bp+..],AL      ;21->C0 66->FB   
   >  SUB [bp+..],AH      ;21->AA   
   >  SUB [bp+..],AX      ;two at once   
   >  ...                 ;(+3 each)   
   > ;but for 80..        ;(+2 more)   
   >  SUB AL,0x7a         ;ie: 5B -61-7a = 80   
   >  SUB [bp+..],AL      ;AX is possible too   
      
   I'm putting fixup values in cx too. Mostly xor's still.   
      
   >   
   >>> your short 50 byte:(can't pair 83,86 with one 3byte sub) 50+33+18+4+2=107   
   >>> [string +11 pairs +6 single +push imm16 pop ax +sub AL,7A]   
   >   
   >> I'm using direct code for some ; e.g.   
   >>   
   >>           ; sub al,'a'-'A'-26   ; a-z ; sub al,6   
   >>           sub al,0x5A   
   >>           sub al,0x5A   
   >>           sub al,0x52          ; whew! -6!   
   >   
   > me too replaced a MOV CL,4 with four INC CX (was zero anyway) and   
      
   Oops, I forgot to set cx. That's another 8 bytes gone!   
      
   > the larger variant used 8 bytes on two word XOR-clear instead of a   
   > four byte 'AND dword [DI],0' (coz this need three bytes to modify).   
   >   
   > would six DEC AX alter your AH ?   
      
   No, nice spot, but it's still 6 bytes!   
      
   >   
   > I had an ADD AL,06 in my code and replaced it with SUB AL,0xFA.   
   > This FA is a 5B in the original but modified by SUB 61.   
   > So only 2+3 bytes instead of 6.   
   >   
   > I create FA (-6) with single sub by either "["-"a" or "q"-"w"   
   >   
   >> as there's some room for expanding from 50 and 64; I dropped trying to   
   >> keep it to pure B64.   
   >   
   > Yeah, SMC with pure B64 seems impossible or at least heavy detouring.   
   > ...   
   >>> So when I look back to the xor-sub-sub 2:1 and your 50 byte variant   
   >>> and compare what's required for direct modify with the 2:1 algo, we   
   >>> may not gain too much :)   
   >   
   > wasn't "shorter than this" our previous target ? :)   
      
   Yes. Just getting this thing working is my current ambition!   
      
   > __   
   > wolfgang   
   >   
      
      
   --   
   Bah, and indeed, Humbug   
      
   --- 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