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

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-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.

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