MASM Junk Code

;//Junk  & SEH
 junkxx_01  db 0E8h, 24h, 0, 0  ; DATA XREF: FillJunkXX+2Ct
     db 0, 8Bh, 44h,  24h
     db 4, 8Bh, 0, 3Dh
     db 4, 0, 0, 80h
     db 75h,  8, 8Bh,  64h
     db 24h,  8, 0EBh, 4
     db 58h,  0EBh, 0Ch, 0E9h
     db 64h,  8Fh, 5,  0
     db 0, 0, 0, 74h
     db 0F3h, 75h, 0F1h, 0EBh
     db 24h,  64h, 0FFh, 35h
     db 0, 0, 0, 0
     db 0EBh, 12h, 0FFh, 9Ch
     db 74h,  3, 75h,  1
     db 0E9h, 81h, 0Ch, 24h
     db 0, 1, 0, 0
     db 9Dh,  90h, 0EBh, 0F4h
     db 64h,  89h, 25h, 0
     db 0, 0, 0, 0EBh
     db 0E6h
 junkxx_02  db 0EBh, 1, 0Fh, 31h  ; DATA XREF: FillJunkXX+46t
     db 0F0h, 0EBh, 0Ch, 33h
     db 0C8h, 0EBh, 3, 0EBh
     db 9, 0Fh, 59h,  74h
     db 5, 75h, 0F8h, 51h
     db 0EBh, 0F1h
Continue Reading

HEX2ASCII && ASCII2HEX

; Author: Jake Commander
; Copyright The GeneSys Development System

HexEncode proc uses edi esi ebx pBuff:dword,dwLen:dword,pOutBuff:dword
;---------------------------------------
    mov    ebx, dwLen
    mov    edi, pOutBuff
    test    ebx, ebx
    mov    esi, pBuff
    jz      @F
    .repeat
      movzx  eax, byte ptr [esi]
      mov    ecx, eax
      add    edi, 2
      shr    ecx, 4
      and    eax, 1111b
      and    ecx, 1111b
      cmp    eax, 10
      sbb    edx, edx
      adc    eax, 0
      lea    eax, [eax+edx*8+'7']
      cmp    ecx, 10
      sbb    edx, edx
      adc    ecx, 0
      shl    eax, 8
      lea    ecx, [ecx+edx*8+'7']
      or      eax, ecx
      inc    esi
      mov    [edi-2], ax
      dec    ebx
    .until ZERO?
@@: mov    eax, edi
    mov    byte ptr [edi], 0
    sub    eax, pOutBuff
    ret
;---------------------------------------
HexEncode endp
Continue Reading