Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

LZ unpacker

Name: Anonymous 2011-11-10 13:07

Have you seen original source code for following routine?

_BYTE *__fastcall decodeLZ_sub(_BYTE *Dst, void *Src)
{
  _BYTE *D; // esi@1
  _BYTE *S; // edi@1
  unsigned int i; // ecx@1
  char v5; // al@2
  _BYTE *R; // esi@2
  char v7; // dl@3
  char v8; // al@3
  __int16 v9; // ax@3
  __int16 v10; // ax@5
  char v11; // dl@7
  char v12; // al@7
  _BYTE *v13; // esi@7
  unsigned __int8 v14; // dh@7
  __int16 v15; // ax@7
  __int16 v16; // dx@9

  D = Dst;
  S = Src;
  for ( i = 0; ; S += i )
  {
    while ( 1 )
    {
      while ( 1 )
      {
        while ( 1 )
        {
          v5 = *D;
          R = D + 1;
          if ( v5 < 0 )
            break;
          v7 = v5;
          v8 = *R;
          D = R + 1;
          HIBYTE(v9) = v8;
          LOBYTE(v9) = v9 & 0x18;
          if ( (_BYTE)v9 )
          {
            LOBYTE(i) = (unsigned __int8)v9 >> 3;
            memcpy(S, D, i);
            D += i;
            S += i;
            i = 0;
          }
          LOBYTE(i) = (HIBYTE(v9) & 7) + 3;
          LOBYTE(v9) = HIBYTE(v9);
          v10 = 4 * v9 & 0x380;
          LOBYTE(v10) = v7 | v10;
          memcpy(S, &S[-(unsigned __int16)(v10 + 1)], i);
          S += i;
        }
        if ( v5 & 0x40 )
          break;
        v11 = v5;
        v12 = *R;
        v13 = R + 1;
        HIBYTE(v15) = v12;
        LOBYTE(v15) = *v13;
        D = v13 + 1;
        v14 = v15;
        LOBYTE(v15) = v15 & 3;
        if ( (_BYTE)v15 )
        {
          LOBYTE(i) = v15;
          memcpy(S, D, i);
          D += i;
          S += i;
          i = 0;
        }
        LOBYTE(i) = (HIBYTE(v15) & 0x1F) + 3;
        HIBYTE(v16) = (v14 >> 1) & 0x7E;
        LOBYTE(v16) = v11 & 0x3F;
        LOBYTE(v15) = HIBYTE(v15);
        memcpy(S, &S[-(unsigned __int16)((v16 | 2 * v15 & 0x1C0) + 1)], i);
        S += i;
      }
      if ( v5 & 0x30 )
        break;
      LOBYTE(i) = 4 * ((v5 & 0xF) + 1);
      memcpy(S, R, i);
      D = &R[i];
      S += i;
    }
    if ( v5 == -1 )
      break;
    LOBYTE(i) = v5 & 0xF;
    memcpy(S, R, i);
    D = &R[i];
  }
  return R;
}

Name: Anonymous 2011-11-10 13:08

>>1
Also, it uses memcpy to copy overlapping regions. Worse is Better!

Name: Anonymous 2011-11-10 13:28

    while ( 1 )
    {
      while ( 1 )
      {
        while ( 1 )
        {


Oh god it hurts to live.

Name: Anonymous 2011-11-10 13:29

Enjoying your pirated disassembler?

Also that's pretty trivial as far as RE goes. Shouldn't take you more than half an hour or so.

Name: Anonymous 2011-11-10 13:32

3 nested while(1), WTF?

Post the asm output, it looks like your decompiler misidentified the loop conditions. The innermost should start with something like while((c=*d++)<0)

Name: Anonymous 2011-11-10 13:37

>>5
The outermost for is also missing its condition, which is actually this:
    if ( v5 == -1 )
      break;


Horrible decompiler. It would be easier to understand the asm.

Name: Anonymous 2011-11-10 13:43

    while ( 1 )
    {
      while ( 1 )
      {
        while ( 1 )
        {

curly brackets are not next to while() statement?! there is something wrong with that compiler

Name: Anonymous 2011-11-10 13:45

>>7
*decompiler. also binary trips get

Name: Anonymous 2011-11-10 13:47

ITT /prog/ solves NP-complete problems for breakfast, producing a perfect automated decompiler.

Name: Anonymous 2011-11-10 13:52

>>9
it is easy, I just proved P is NP and rest is straightforward

Name: Anonymous 2011-11-10 15:14

Just upgraded to the latest version, went from 1.1 to 1.6. The improvements are very subtle at best. About 1-2% reduced decompiled code size, simplified some trivial shit, but the output is basically the same. Can't recommend. It would probably get rid of OP's while ( 1 )s, but that's hardly an improvement (I don't know why you people throw a fit over that, the exit conditions are perfectly clear, there's exactly one if (cond) break; per nesting level.) It still doesn't do C++ well at all.

Name: Anonymous 2011-11-10 18:28

WHO THE FUCK NESTS WHILE(1) LOOPS

Name: Anonymous 2011-11-10 19:01

>>6
Horrible decompiler. It would be easier to understand the asm.
But it's easy to maker errors translating code manually!

Name: Anonymous 2011-11-10 19:05

>>9
ITT /prog/ solves NP-complete problems for breakfast, producing a perfect automated decompiler.
That crap works only on simple compiler produced code. It wont decompile handwritten assembly, Lisp fasls or Forth code.

Name: Anonymous 2011-11-10 19:08

An example of code it wont decompile:




.data



byte_curbits db 0

word_maxvalue dw 0

word_dicreset dw 0

word_incbits dw 0



dword_buff2 dd 0

dword_buff3 dd 0

dword_buff4 dd 0



dword_427B51 dd 0

byte_427B4C db 0

word_nextcode dw 0

dword_427B4D dd 0

word_427ABE dw 0

word_427AC2 dw 0

word_427AC0 dw 0



dword_stack dd ?



dword_usize dd ?

dword_psize dd ?

dword_outbf dd ?



dword_input dd ?

dword_buff2_b db 8D00h dup(?)

dword_buff3_b db 4680h dup(?)

dword_buff4_b db 0FA0h dup(?)



.code

proc unlzw

        pop    eax ; retnaddr

        pop    [dword_usize]

        pop    [dword_psize]

        pop    [dword_outbf]

        pop    [dword_input] ; input

        push    eax ;retnaddr



        push    ebp

        mov    ebp, esp

        push    ebx

        push    esi

        push    edi



        mov    [dword_stack], esp



        mov    ebx, [dword_usize] ; u

        mov    eax, [dword_psize] ; p

        mov    edi, [dword_outbf] ; out



        push    edi ; output buffer

        push    eax ; packed size

        push    ebx ; unpacked size (edi size)



        mov edx, dword_buff2_b

        mov [dword_buff2], edx



        mov edx, dword_buff3_b

        mov [dword_buff3], edx



        mov edx, dword_buff4_b

        mov [dword_buff4], edx



        pop    ebx

        pop    eax

        pop    edi

        push    edi

        mov    edx, eax

        mov    eax, edx

        mov    [dword_427B51], 0

        mov    esi, [dword_input]

        push    esi

        mov    edi, [dword_input]

;               call    sub_40BAA9 ; read from file to buffer

        pop    esi

        pop    edi

        ; start unpacking code

        mov    al, 9

        call    lzwinit

        mov    [byte_427B4C], 0



loc_40BB49:

        mov    [word_nextcode], 100h

        mov    ebx, [dword_427B4D]

        mov    ch, [byte_curbits]

        mov    cl, [byte_427B4C]

        mov    edx, [dword_427B51]



loc_40BB6A:

        shl    ebx, 8

        mov    bl, [esi]

        inc    esi

        add    cl, 8

        or    edx, edx

        jz    short loc_40BB8C

        dec    edx

        or    edx, edx

        ja    short loc_40BB8C

        mov    esi, [dword_input]

        mov    [dword_427B51], 0



loc_40BB8C:



        cmp    ch, cl

        jg    short loc_40BB6A

        mov    [dword_427B51], edx

        sub    cl, ch

        mov    eax, ebx

        shr    eax, cl

        and    ax, [word_maxvalue]

        mov    [byte_427B4C], cl

        mov    [dword_427B4D], ebx

        mov    [word_427ABE], ax

        mov    [word_427AC2], ax

        stosb



loc_40BBBC:

        mov    ebx, [dword_427B4D]

        mov    ch, [byte_curbits]

        mov    cl, [byte_427B4C]

        mov    edx, [dword_427B51]



loc_40BBD4:

        shl    ebx, 8

        mov    bl, [esi]

        inc    esi

        add    cl, 8

        or    edx, edx

        jz    short loc_40BBF6

        dec    edx

        or    edx, edx

        ja    short loc_40BBF6

        mov    esi, [dword_input]

        mov    [dword_427B51], 0



loc_40BBF6:



        cmp    ch, cl

        jg    short loc_40BBD4

        mov    [dword_427B51], edx

        sub    cl, ch

        mov    eax, ebx

        shr    eax, cl

        and    ax, [word_maxvalue]

        mov    [byte_427B4C], cl

        mov    [dword_427B4D], ebx

        mov    [word_427AC0], ax

        cmp    ax, [word_maxvalue]

        jz    loc_endproc

        cmp    ax, [word_dicreset]

        jz    loc_40BB49

        mov    ebp, [dword_buff4]

        mov    bx, ax

        cmp    ax, [word_nextcode]

        jl    short loc_40BC5D

        mov    dx, [word_427AC2]

        mov    [ebp+0], dl

        inc    ebp

        mov    bx, [word_427ABE]



loc_40BC5D:

        push    ax

        xor    cx, cx

        jmp    short loc_40BC93

; ---------------------------------------------------------------------------



loc_40BC64:

        movzx    ebx, bx

        mov    edx, [dword_buff3]

        mov    al, [ebx+edx]

        mov    [ebp+0], al

        inc    ebp

        shl    ebx, 1

        mov    edx, [dword_buff2]

        mov    bx, [edx+ebx]

        inc    cx

        cmp    cx, 0FA0h

        jb    short loc_40BC93

                ; Fatal error, code depth too great.

        xor    eax, eax

        inc    eax

        mov    esp, [dword_stack] ; restore stack

        jmp    loc_endproc_error

; ---------------------------------------------------------------------------



loc_40BC93:



        cmp    bx, 0FFh

        jg    short loc_40BC64

        mov    [ebp+0], bl

        movzx    ax, byte [ebp+0]

        mov    [word_427AC2], ax



loc_40BCA8:

        cmp    ebp, [dword_buff4]

        jb    short loc_40BCB7

        mov    al, [ebp+0]

        stosb

        dec    ebp

        jmp    short loc_40BCA8

; ---------------------------------------------------------------------------



loc_40BCB7:

        xor    ebp, ebp

        mov    bp, [word_nextcode]

        shl    bp, 1

        add    ebp, [dword_buff2]

        mov    ax, [word_427ABE]

        mov    [ebp+0], ax

        xor    ebp, ebp

        mov    bp, [word_nextcode]

        add    ebp, [dword_buff3]

        mov    ax, [word_427AC2]

        mov    [ebp+0], al

        inc    [word_nextcode]

        mov    ax, [word_nextcode]

        cmp    ax, [word_incbits]

        jle    short loc_40BD16

        cmp    [byte_curbits], 0Eh

        jge    short loc_40BD16

        mov    al, [byte_curbits]

        inc    al

        call    lzwinit



loc_40BD16:



        pop    ax

        mov    [word_427ABE], ax

        jmp    loc_40BBBC

; ---------------------------------------------------------------------------



loc_endproc:

        xor    eax, eax

loc_endproc_error:

        pop    edi

        pop    esi

        pop    ebx

        pop    ebp

        retn

endp

Name: Anonymous 2011-11-10 19:10

Probably due to

push    ax
...
pop    ax

Name: Anonymous 2011-11-10 19:17

Oh look it's that Nigger again who posts decompiled binaries and complains about autism

Name: Anonymous 2011-11-10 19:32

>>17
Don't mind me, just checking whether code tags highlight Nigger as a keyword.

nigger Nigger NIGGER lhadfuewouh Lhadfuewouh LHADFUEWOUH

Name: Anonymous 2011-11-10 20:16

>>15
They don't analyze the stack since the majority of the code doesn't use it to its full power.

Name: Anonymous 2011-11-10 20:29

>>19
Good code doesnt use stack. It uses generational garbage collector.

Name: Anonymous 2011-11-10 21:06

Good code doesnt use stack.
Thus, Forth was never good code.

Name: Anonymous 2011-11-10 22:39

>>21
Forth cant do continuations and all control constructs look uglier than a retarded jew. Kinda brainfuck.

Name: Anonymous 2011-11-11 1:02

Here is a manually disassembled version. Note the obsence of memcpy (which were erroneously supplied by decompiler)

static int decodeLZ(u1 *Dst, u1 *Src) {
  u4 A=0, B=0, C=0, D=0;
  u1 *P, *O = Dst;

  for (AL = *Src++; AL != 0xFF; AL = *Src++) {
    if (!(AL&0x80)) {
      DL = AL;
      AL = *Src++;
      AH = AL;
      AL &= 0x18;
      if (AL) {
        AL >>= 3;
        for (CL=AL; CL; CL--) *Dst++ = *Src++;
      }
      CL = (AH&7)+3; //backref len
      AL = AH;
      P = Dst - (((AX<<2)&0x380)|DL) - 1; //backref off
      for (; CL; CL--) *Dst++ = *P++;
    } else if (!(AL&0x40)) {
      DL = AL;
      AL = *Src++;
      AH = AL;
      AL = *Src++;
      DH = AL;
      AL &= 3;
      for (CL=AL; CL; CL--) *Dst++ = *Src++;
      CL = (AH&0x1F)+3;
      DH = (DH>>1)&0x7E;
      DL = 0x3F;
      AL = AH;
      P = Dst - (((AX<<1)&0x1C0)|DX) - 1;
      for (; CL; CL--) *Dst++ = *P++;
    } else if (!(AL&0x30)) {
      CL = ((AL&0xF)+1)<<2;
      for (; CL; CL--) *Dst++ = *P++;
    } else {
      for (CL=AL&0xF; CL; CL--) *Dst++ = *Src++;
    }
  }

  return Dst-O;
}

Name: Anonymous 2011-11-11 1:03

>>23
manually decompiled
self fix

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-11-11 5:02

Post the original, I'll try it with mine.

>>15

char byte_curbits;
short word_maxvalue;
short word_dicreset;
short word_incbits;
unsigned short *dword_buff2;
char *dword_buff3;
char *dword_buff4;
unsigned int dword_427B51;
char byte_427B4C;
unsigned short word_nextcode;
int dword_427B4D;
short word_427ABE;
short word_427AC2;
short word_427AC0;
char *dword_stack;
int dword_usize;
int dword_psize;
int dword_outbf;
int dword_input;
unsigned short dword_buff2_b[0x4680];
char dword_buff3_b[0x4680];
char dword_buff4_b[0xFA0];

int unlzw(char *arg_1, char *arg_2, int arg_3, int arg_4) {
 dword_usize = arg_4;
 dword_psize = arg_3;
 dword_outbf = arg_2;
 dword_input = arg_1;
 char *v_edi = dword_outbf;
 dword_buff2 = &dword_buff2_b;
 dword_buff3 = &dword_buff3_b;
 dword_buff4 = &dword_buff4_b;
 dword_427B51 = 0;
 char *v_esi = dword_input;
 sub_40BAA9(v_esi, dword_outbf);
 lzwinit();
 byte_427B4C = 0;
 short v_ax;
 do { /* loc_40BB49 */
  word_nextcode = 256;
  int v_ebx = dword_427B4D;
  char v_ch = byte_curbits;
  char v_cl = byte_427B4C;
  unsigned int v_edx = dword_427B51;
  do { /* loc_40BB6A */
   v_ebx = (v_ebx<<8) | *v_esi++;
   v_cl += 8;
   if(!v_edx && !--v_edx) {
    v_esi = dword_input;
    dword_427B51 = 0;
   }
  } while(v_ch > v_cl);
  dword_427B51 = v_edx;
  v_cl -= v_ch;
  v_ax = (v_ebx<<v_cl)&word_maxvalue;
  byte_427B4C = v_cl;
  dword_427B4D = v_ebx;
  word_427ABE = v_ax;
  word_427AC2 = v_ax;
  *v_edi++ = v_ax;
 loc_40BBBC:
  v_ebx = dword_427B4D;
  v_ch = byte_curbits;
  v_cl = byte_427B4C;
  v_edx = dword_427B51;
  do { /* loc_40BBD4 */
   v_ebx = (v_ebx<<8) | *v_esi++;
   v_cl += 8;
   if(!v_edx && !--v_edx) {
    v_esi = dword_input;
    dword_427B51 = 0;
   }
  } while(v_ch > v_cl);
  dword_427B51 = v_edx;
  v_cl -= v_ch;
  v_ax = (v_ebx<<v_cl)&word_maxvalue;
  byte_427B4C = v_cl;
  dword_427B4D = v_ebx;
  word_427AC0 = v_ax;
  if(v_ax == word_maxvalue)
   return 0;
 } while(v_ax == word_dicreset);
 unsigned char *v_ebp = dword_buff4;
 unsigned short v_bx = v_ax;
 if(v_ax >= word_nextcode) {
  *v_ebp++ = word_427AC2;
  v_bx = word_427ABE;
 }
 unsigned short v_cx = 0;
 while(v_bx > 255) {
  *v_ebp++ = dword_buff3[v_bx];
  v_bx = dword_buff2[v_bx];
  if(++v_cx >= 4000)
   return 1;
 }
 *v_ebp = v_bx;
 word_427AC2 = *v_ebp;
 while(v_ebp >= dword_buff4)
  *v_edi++ = *v_ebp--;
 dword_buff2[word_nextcode] = word_427ABE;
 dword_buff3[word_nextcode++] = word_427AC2;
 if((signed short)word_nextcode > word_incbits && byte_curbits < 14)
  lzwinit();
 word_427ABE = v_ax;
 goto loc_40BBBC;
}

Name: Anonymous 2011-11-11 5:39

>>25

0003F499                 push    ds
0003F49A                 pop     es
0003F49B                 push    ecx
0003F49C                 push    esi
0003F49D                 push    edi
0003F49E                 mov     esi, eax
0003F4A0                 mov     edi, edx
0003F4A2                 xor     ecx, ecx
0003F4A4
0003F4A4 head:                                   ; CODE XREF: hlib_decodeLZ_sub+49j
0003F4A4                                         ; hlib_decodeLZ_sub+8Bj ...
0003F4A4                 lodsb
0003F4A5                 or      al, al
0003F4A7                 jl      short al_has_0x80
0003F4A9                 mov     dl, al
0003F4AB                 lodsb
0003F4AC                 mov     ah, al
0003F4AE                 and     al, 18h
0003F4B0                 jz      short skip_copy1
0003F4B2                 shr     al, 1
0003F4B4                 shr     al, 1
0003F4B6                 shr     al, 1
0003F4B8                 mov     cl, al
0003F4BA                 rep movsb
0003F4BC
0003F4BC skip_copy1:                             ; CODE XREF: hlib_decodeLZ_sub+17j
0003F4BC                 mov     cl, ah
0003F4BE                 and     cl, 7
0003F4C1                 inc     cl
0003F4C3                 inc     cl
0003F4C5                 inc     cl
0003F4C7                 mov     al, ah
0003F4C9                 shl     ax, 1
0003F4CC                 shl     ax, 1
0003F4CF                 and     ax, 380h
0003F4D3                 or      al, dl
0003F4D5                 inc     ax
0003F4D7                 push    esi
0003F4D8                 mov     esi, edi
0003F4DA                 movzx   eax, ax
0003F4DD                 sub     esi, eax
0003F4DF                 rep movsb
0003F4E1                 pop     esi
0003F4E2                 jmp     short head
0003F4E4 ; ---------------------------------------------------------------------------
0003F4E4
0003F4E4 al_has_0x80:                            ; CODE XREF: hlib_decodeLZ_sub+Ej
0003F4E4                 test    al, 40h
0003F4E6                 jnz     short al_has_0x40
0003F4E8                 mov     dl, al
0003F4EA                 lodsb
0003F4EB                 mov     ah, al
0003F4ED                 lodsb
0003F4EE                 mov     dh, al
0003F4F0                 and     al, 3
0003F4F2                 jz      short skip_copy2
0003F4F4                 mov     cl, al
0003F4F6                 rep movsb
0003F4F8
0003F4F8 skip_copy2:                             ; CODE XREF: hlib_decodeLZ_sub+59j
0003F4F8                 mov     cl, ah
0003F4FA                 and     cl, 1Fh
0003F4FD                 inc     cl
0003F4FF                 inc     cl
0003F501                 inc     cl
0003F503                 shr     dh, 1
0003F505                 and     dh, 7Eh
0003F508                 and     dl, 3Fh
0003F50B                 mov     al, ah
0003F50D                 shl     ax, 1
0003F510                 and     ax, 1C0h
0003F514                 or      ax, dx
0003F517                 inc     ax
0003F519                 push    esi
0003F51A                 mov     esi, edi
0003F51C                 movzx   eax, ax
0003F51F                 sub     esi, eax
0003F521                 rep movsb
0003F523                 pop     esi
0003F524                 jmp     head
0003F529 ; ---------------------------------------------------------------------------
0003F529
0003F529 al_has_0x40:                            ; CODE XREF: hlib_decodeLZ_sub+4Dj
0003F529                 test    al, 30h
0003F52B                 jnz     short al_has_0x30
0003F52D                 and     al, 0Fh
0003F52F                 inc     al
0003F531                 shl     al, 1
0003F533                 shl     al, 1
0003F535                 mov     cl, al
0003F537                 rep movsb
0003F539                 jmp     head
0003F53E ; ---------------------------------------------------------------------------
0003F53E
0003F53E al_has_0x30:                            ; CODE XREF: hlib_decodeLZ_sub+92j
0003F53E                 cmp     al, 0FFh
0003F540                 jz      short end
0003F542                 and     al, 0Fh
0003F544                 mov     cl, al
0003F546                 rep movsb
0003F548                 jmp     head
0003F54D ; ---------------------------------------------------------------------------
0003F54D
0003F54D end:                                    ; CODE XREF: hlib_decodeLZ_sub+A7j
0003F54D                 mov     eax, esi
0003F54F                 pop     edi
0003F550                 pop     esi
0003F551                 pop     ecx
0003F552                 retn

Name: Anonymous 2011-11-11 9:43

test:
Nigger

Name: Anonymous 2011-11-11 23:23

double Nigger

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-11-12 4:20

>>26
Raw output:

_Optlink char *l_0003F499(char *arg_1, char *arg_2) {
 char *v_esi = arg_1;
 char *v_edi = arg_2;
 char v_al;
 char v_ah;
 char v_cl;
 char v_dl;
 char v_dh;
 while(1) {
  unsigned short v_ax;
  v_al = *v_esi++;
  if(v_al>=0) {
   v_dl = v_al;
   v_al = *v_esi++;
   v_ah = v_al;
   if(v_al&=24) {
    v_cl = v_al<<3;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   v_cl = (v_ah&7) + 3;
   v_al = v_ah;
   v_ax = (v_ah<<8)|v_al;
   v_ax = (((v_ax<<2)&0x380)|v_dl)+1;
   {
    char *v_esi = v_edi - v_ax;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   continue;
  } else if(v_al&64) {
   v_dl = v_al;
   v_ah = *v_esi++;
   v_al = *v_esi++;
   v_dh = v_al;
   if(v_al&=3) {
    v_cl = v_al;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   v_cl = (v_ah&31) + 3;
   v_dh = (v_dh>>1)&126;
   v_dl &= 63;
   v_al = v_ah;
   v_ax = (((((v_ah<<8)|v_al)<<1)&0x1c0)|(v_dh<<8)|v_dl)+1;
   {
    char *v_esi = v_edi - v_ax;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   continue;
  } else if(v_al&48) {
   v_cl = ((v_al&15)+1)<<2;
   while(v_cl) {
    *v_edi++ = *v_esi++;
    v_cl--;
   }
   continue;
  } else if(v_al==-1)
   break;
  v_cl = v_al&15;
  while(v_cl) {
   *v_edi++ = *v_esi++;
   v_cl--;
  }
 }
 return v_esi;
}

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-11-12 4:22

After some minor expression substitution:

__Optlink char *l_0003F499(char *arg_1, char *arg_2) {
 char *v_esi = arg_1;
 char *v_edi = arg_2;
 char v_al;
 char v_ah;
 char v_cl;
 char v_dl;
 char v_dh;
 while(1) {
  unsigned short v_ax;
  v_al = *v_esi++;
  if(v_al>=0) {
   v_dl = v_al;
   v_al = *v_esi++;
   v_ah = v_al;
   if(v_al&=24) {
    v_cl = v_al<<3;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   v_cl = (v_ah&7) + 3;
   v_ax = (((((v_ah<<8)|v_ah)<<2)&0x380)|v_dl)+1;
   {
    char *v_esi = v_edi - v_ax;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   continue;
  } else if(v_al&64) {
   v_dl = v_al;
   v_ah = *v_esi++;
   v_al = *v_esi++;
   v_dh = v_al;
   if(v_al&=3) {
    v_cl = v_al;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   v_cl = (v_ah&31) + 3;
   v_ax = (((((v_ah<<8)|v_ah)<<1)&0x1c0)|(((v_dh>>1)&126)<<8)|(v_dl&63))+1;
   {
    char *v_esi = v_edi - v_ax;
    while(v_cl) {
     *v_edi++ = *v_esi++;
     v_cl--;
    }
   }
   continue;
  } else if(v_al&48) {
   v_cl = ((v_al&15)+1)<<2;
   while(v_cl) {
    *v_edi++ = *v_esi++;
    v_cl--;
   }
   continue;
  } else if(v_al==-1)
   break;
  v_cl = v_al&15;
  while(v_cl) {
   *v_edi++ = *v_esi++;
   v_cl--;
  }
 }
 return v_esi;
}

Name: Anonymous 2011-11-12 16:38

>>29
You should sell your converter to hexrays, cuz their is crappy.

Name: Anonymous 2011-11-12 21:29

>>29-30
Go back to REchan, ragstorm.

Name: Anonymous 2011-11-12 21:47

What is the difference between Anonix and LoseThos?

Name: Anonymous 2011-11-12 21:52

Anonix is to LoseThos what Linux is to GNU.

Name: Anonymous 2011-11-12 22:51

Nerd life
Graphics calculator hp40ag
the g is for gangsta

Name: Anonymous 2011-11-13 2:11

>>33
LoseThos actually exists.

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-11-13 4:11

>>31
It's currently not public but we have plans to release it as open-source/public domain sometime in the future.

It is a part of a larger system/analysis framework, intended to replace IDA. IDA is certainly not the greatest, being too windows/x86-centric and closed-source, making use of proprietary formats.

Name: Anonymous 2011-11-13 9:10

Who's the better ``programmer'', Cudder or FrozenVoid?

Name: Anonymous 2011-11-13 23:41

>>38
Why did you put "programmer" in quotes?

Name: Anonymous 2011-11-13 23:46

>>37
You're very ambitious, considering that IDA took 20 years to develop into it's current state, while the best crackers contributed to it's development. Good luck.

Name: Anonymous 2011-11-14 9:39

>>39
Why are you such a ``faggot''?

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2011-11-15 6:52

>>40
Considering that IDA took 20 years to accrue mostly frivolous features (OVER 20 TOOLBARS!!!111), I'd say we're not too ambitious. IDA's control flow analyser is still tripped up by the simplest of irregular-looking code, especially those dealing with the stack. It's been 20 years and they still have not powerful simulation facility.

Loading custom file formats in IDA is horrible. We have to slice and create the memory image outside of it, while our analysis system supports loadmaps (CSV format). This is another point of advantage - all analysis information in our system is stored in relational format, making it easy to manage using databases and easy to interoperate. The small parts that aren't in relational format (e.g. instruction semantics) are XML. I guess IDA was deliberately designed to be difficult to extend in ways the authors did not intend it to be, while our system was designed from the beginning to be extensible and very flexible.

If you want to add a new CPU or just instructions to existing one, with IDA you need to compile a new DLL with their horrifically underdocumented SDK and write your own disassembler, etc. With our system, adding an instruction is little more than adding rows to the disassembler table and semantics to an XML file, all (relatively) human-readable. This is how we do VN script disassembly too.

Name: Anonymous 2013-03-20 9:09

I LOVE THIS THREAD

Name: Anonymous 2013-03-20 20:04

http://www.discreetfx.com/DownloadDigipaint.html

Did Amiga had a C/C++ compiler?

I also love how they comment every line:

chkmsg:    MACRO
    lea    OnlyPort_(BP),A3    ;my port's on my base page, easy, quick.
    lea    MP_MSGLIST(A3),A3    ;TOP of list
    cmp.l    8(A3),A3        ;super qwick, NASTY check for msg
    bne.s    stopblitting        ;gotta msg, dont doablit
    endm

    movem.l    d0-d7/a0-a2,-(sp)

    move.l    a3,-(sp)
    lea    OnlyPort_(BP),A3    ;my port's on my base page, easy, quick.
    lea    MP_MSGLIST(A3),A3    ;TOP of list
    cmp.l    8(A3),A3        ;super qwick, NASTY check for msg
    moveM.l    (sp)+,a3        ;no flag effect with move*M*
    beq.s    fullblit        ;no msg, do all 6 bitplanes

    xref PasteRastPort_
    lea    PasteRastPort_(BP),A0    ;rastport for flooding (singlebitplane)

    ;move.b    #%00000001,d7    ;bitplane mask bottom 4
    moveq    #%001,d7    ;bitplane mask bottom 4
    move.b    #$60,d6         ;flip destination based on mask
    CALLIB    Graphics,ClipBlit    ;mask->screen, then check
    xref FlagSingleBit_
    st    FlagSingleBit_(BP)    ;only need undo of single bitplane
    bra.s    stopblitting        ;gotta msg, dont doablit

Name: Anonymous 2013-03-20 20:21

>>40
while the best crackers contributed to it's development.
Dass right. None dem niggas done did nuffin. Jus da crackas.

Don't change these.
Name: Email:
Entire Thread Thread List