⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urarlib.c

📁 一个解RAR文件的开发库源码
💻 C
📖 第 1 页 / 共 5 页
字号:
                jmp  next_5              else_5:                             // else                mov  I, 10                         //  I=10;              next_5:             jmp  next_B           else_B:                             // else                 cmp  eax, dword ptr[edx + 11*4 + 4]// if (N<Dec->DecodeLen[11])                 jae  else_6                mov  I, 11                         //  I=11;                jmp  next_6              else_6:                             // else                mov  I, 12                         //  I=12;              next_6:           next_B:                        jmp  next_D        else_D:                             // else               cmp  eax, dword ptr[edx + 14*4 + 4]// if (N<Dec->DecodeLen[14])                jae  else_A                  cmp  eax, dword ptr[edx + 13*4 + 4]// if (N<Dec->DecodeLen[13])                   jae  else_7                  mov  I, 13                         //  I=13;                  jmp  next_7                 else_7:                             // else                  mov  I, 14                         //  I=14;                 next_7:               jmp  next_A              else_A:                             // else               mov  I, 15                         //  I=15;              next_A:                  next_D:                                 next_G:}#else __asm__ __volatile__ (     "andl $0xFFFFFFFE, %%eax      movl %%eax, %1          cmpl 8*4(%%edx), %%eax /* 5379 */          jae  else_G             cmpl 4*4(%%edx), %%eax             jae  else_F                cmpl 2*4(%%edx), %%eax                jae  else_C                   cmpl 1*4(%%edx), %%eax                   jae  else_1                   movl $1, %0                   jmp  next_1                 else_1:                          movl  $2, %0                 next_1:                                jmp  next_C              else_C:                             cmpl 3*4(%%edx), %%eax                    jae  else_2                   movl  $3, %0                   jmp  next_2                 else_2:                          movl  $4, %0                 next_2:              next_C:                       jmp  next_F           else_F:             cmpl 6*4(%%edx), %%eax             jae  else_E                cmpl 5*4(%%edx), %%eax                jae  else_3                movl  $5, %0                   jmp  next_3              else_3:                          movl  $6, %0                 next_3:             jmp  next_E           else_E:                             cmpl 7*4(%%edx), %%eax                jae  else_4                movl  $7, %0                   jmp  next_4              else_4:                          movl  $8, %0                 next_4:           next_E:           next_F:          jmp  next_G        else_G:          cmpl 12*4(%%edx), %%eax          jae  else_D             cmpl 10*4(%%edx), %%eax             jae  else_B                cmpl 9*4(%%edx), %%eax                jae  else_5                movl  $9, %0                   jmp  next_5              else_5:                          movl  $10, %0                next_5:             jmp  next_B           else_B:                             cmpl 11*4(%%edx), %%eax                 jae  else_6                movl  $11, %0                  jmp  next_6              else_6:                          movl  $12, %0                next_6:           next_B:                        jmp  next_D        else_D:                               cmpl 14*4(%%edx), %%eax               jae  else_A                  cmpl 13*4(%%edx), %%eax                  jae  else_7                  movl  $13, %0                  jmp  next_7                 else_7:                         movl  $14, %0                 next_7:               jmp  next_A              else_A:                         movl  $15, %0                 next_A:                  next_D:                                 next_G:"     : "=g" (I), "=r"(N)     : "eax" ((long)BitField), "edx"((long)Deco->DecodeLen)      : "memory"     );#endif /* #ifdef _WIN_32 ... #elif defined _X86_ASM_ */#else  N=BitField & 0xFFFE;  if (N<Deco->DecodeLen[8])  {    if (N<Deco->DecodeLen[4]) {      if (N<Deco->DecodeLen[2]) {        if (N<Deco->DecodeLen[1])          I=1;        else          I=2;      } else {        if (N<Deco->DecodeLen[3])          I=3;        else          I=4;      }    } else {      if (N<Deco->DecodeLen[6])  {        if (N<Deco->DecodeLen[5])          I=5;        else          I=6;      } else {        if (N<Deco->DecodeLen[7])          I=7;        else          I=8;      }   }        } else {    if (N<Deco->DecodeLen[12]) {      if (N<Deco->DecodeLen[10]) {        if (N<Deco->DecodeLen[9])          I=9;        else          I=10;      } else {        if (N<Deco->DecodeLen[11])          I=11;        else          I=12;      }    } else {      if (N<Deco->DecodeLen[14]) {        if (N<Deco->DecodeLen[13])          I=13;        else          I=14;            } else {          I=15;      }    }	      }#endif  AddBits(I);  if ((N=Deco->DecodePos[I]+((N-Deco->DecodeLen[I-1])>>(16-I)))>=Deco->MaxNum)      N=0;  Number=Deco->DecodeNum[N]; }void UnpInitData(){  InAddr=InBit=0;  if (!(NewLhd.Flags & LHD_SOLID))  {    ChannelDelta=CurChannel=0;#ifdef _USE_ASM#ifdef _WIN_32                              /* Win32 with VisualC           */        __asm {        push edi        push eax        push ecx        cld                                 /* increment EDI and ESI        */        mov  al, 0x00        mov  ecx, SIZE AudV        mov  edi, Offset AudV        rep  stosb                          /* clear memory                 */        mov  ecx, SIZE OldDist        mov  edi, Offset OldDist        rep  stosb                          /* clear memory                 */        mov  ecx, SIZE UnpOldTable        mov  edi, Offset UnpOldTable        rep  stosb                          /* clear memory                 */        pop  ecx        pop  eax         pop  edi                mov  [OldDistPtr], 0        mov  [LastDist], 0        mov  [LastLength], 0        mov  [UnpPtr], 0        mov  [WrPtr], 0        mov  [OldDistPtr], 0        mov  [LastLength], 0        mov  [LastDist], 0        mov  [UnpPtr], 0        mov  [WrPtr], 0    }    memset(UnpBuf,0,MAXWINSIZE);#else                    /* unix/linux on i386 cpus */    __asm__ __volatile (        "        cld                                 /* increment EDI and ESI        */        movb $0x00, %%al        movl %0, %%ecx        movl %1, %%edi        rep          stosb                              /* clear memory                 */        movl %2, %%ecx        mov  %3, %%edi        rep          stosb                              /* clear memory                 */        movl %4, %%ecx        movl %5, %%edi        rep          stosb                              /* clear memory                 */        movl $0, (OldDistPtr)        movl $0, (LastDist)        movl $0, (LastLength)        movl $0, (UnpPtr)        movl $0, (WrPtr)        movl $0, (OldDistPtr)        movl $0, (LastLength)        movl $0, (LastDist)        movl $0, (UnpPtr)        movl $0, (WrPtr)"        :        : "m" ((long)sizeof(AudV)),          "m" ((long)AudV),          "m" ((long)sizeof(OldDist)),          "m" ((long)OldDist),          "m" ((long)sizeof(UnpOldTable)),          "m" ((long)UnpOldTable)        : "memory", "edi", "eax", "ecx"    );    memset(UnpBuf,0,MAXWINSIZE);            #endif    #else                                       /* unix/linux on non-i386 cpu  */    memset(AudV,0,sizeof(AudV));    memset(OldDist,0,sizeof(OldDist));    OldDistPtr=0;    LastDist=LastLength=0;    memset(UnpBuf,0,MAXWINSIZE);    memset(UnpOldTable,0,sizeof(UnpOldTable));    UnpPtr=WrPtr=0;#endif  }}UBYTE DecodeAudio(int Delta){  struct AudioVariables *V;  unsigned int Ch;  unsigned int NumMinDif,MinDif;  int PCh,I;  V=&AudV[CurChannel];  V->ByteCount++;  V->D4=V->D3;  V->D3=V->D2;  V->D2=V->LastDelta-V->D1;  V->D1=V->LastDelta;  PCh=8*V->LastChar+V->K1*V->D1+V->K2*V->D2+           V->K3*V->D3+V->K4*V->D4+V->K5*ChannelDelta;  PCh=(PCh>>3) & 0xFF;  Ch=PCh-Delta;  I=((signed char)Delta)<<3;  V->Dif[0]+=abs(I);  V->Dif[1]+=abs(I-V->D1);  V->Dif[2]+=abs(I+V->D1);  V->Dif[3]+=abs(I-V->D2);  V->Dif[4]+=abs(I+V->D2);  V->Dif[5]+=abs(I-V->D3);  V->Dif[6]+=abs(I+V->D3);  V->Dif[7]+=abs(I-V->D4);  V->Dif[8]+=abs(I+V->D4);  V->Dif[9]+=abs(I-ChannelDelta);  V->Dif[10]+=abs(I+ChannelDelta);  ChannelDelta=V->LastDelta=(signed char)(Ch-V->LastChar);  V->LastChar=Ch;  if ((V->ByteCount & 0x1F)==0)  {    MinDif=V->Dif[0];    NumMinDif=0;    V->Dif[0]=0;    for (I=1;(unsigned int)I<sizeof(V->Dif)/sizeof(V->Dif[0]);I++)    {      if (V->Dif[I]<MinDif)      {        MinDif=V->Dif[I];        NumMinDif=I;      }      V->Dif[I]=0;    }    switch(NumMinDif)    {      case 1:        if (V->K1>=-16)          V->K1--;        break;      case 2:        if (V->K1<16)          V->K1++;        break;      case 3:        if (V->K2>=-16)          V->K2--;        break;      case 4:        if (V->K2<16)          V->K2++;        break;      case 5:        if (V->K3>=-16)          V->K3--;        break;      case 6:        if (V->K3<16)          V->K3++;        break;      case 7:        if (V->K4>=-16)          V->K4--;        break;      case 8:        if (V->K4<16)          V->K4++;        break;      case 9:        if (V->K5>=-16)          V->K5--;        break;      case 10:        if (V->K5<16)          V->K5++;        break;    }  }  return((UBYTE)Ch);}/* *************************************************** * ** CRCCrypt Code - decryption engine starts here ** * ***************************************************/#define NROUNDS 32#define rol(x,n)  (((x)<<(n)) | ((x)>>(8*sizeof(x)-(n))))#define ror(x,n)  (((x)>>(n)) | ((x)<<(8*sizeof(x)-(n))))#define substLong(t) ( (UDWORD)SubstTable[(int)t&255] | \           ((UDWORD)SubstTable[(int)(t>> 8)&255]<< 8) | \           ((UDWORD)SubstTable[(int)(t>>16)&255]<<16) | \           ((UDWORD)SubstTable[(int)(t>>24)&255]<<24) )UDWORD CRCTab[256];UBYTE SubstTable[256];UBYTE InitSubstTable[256]={  215, 19,149, 35, 73,197,192,205,249, 28, 16,119, 48,221,  2, 42,  232,  1,177,233, 14, 88,219, 25,223,195,244, 90, 87,239,153,137,  255

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -