Results 1 to 1 of 1
  1. #1
    h4x0r
    h4x0r is offline
    h4x0r's Avatar
    Join Date
    2011 Aug
    Location
    ..\root\home\pgc
    Posts
    826
    Thanks
    64
    Thanked 525 Times in 205 Posts
    Rep Power
    8

    Alvegia Online ENC Decrypting

    All resource stored in default ZIP and encrypted by XOR + CRC32. All files have extension .enc

    Algo:

    PHP Code:
    static unsigned char szKey[128] = {
        
    0x970xC30x950x770x2D0xFB0x450x330xB20xDD0x350x89,
        
    0x220x0F0x3F0x310x780xD20x4E0xFC0x350xBD0x470x5C,
        
    0x810x990x4C0x9B0xD70x9F0x4B0x5A0xEB0xBE0x750x7A,
        
    0xE00x2E0x430x020x930xBF0x9C0x3B0xCB0xBA0x480x8C,
        
    0xF10x8D0xF50x7B0x780x270x400x0E0xAA0xFC0x5C0x38,
        
    0x740x960x2E0x3B0x0C0xC40x130x950xF90x570x420x29,
        
    0xA00x900x8D0xE20xA60x260x030xA20xFC0x630xDF0x3D,
        
    0x390xCE0x4E0x010xB80xCD0xB80xA30x9E0xD40xDC0x82,
        
    0x020xC00xA50xD80xD80xDB0x460x690xA80x7B0x710xE1,
        
    0x9C0xB70xFF0xF00x060xE60x430xE30x2E0x090x480xEF,
        
    0xBB0xBC0x4F0xE30x870xD90xFF0x5F}; 
    PHP Code:
    #define ROL(x, n) (((x) << ((n) & 0x1F)) | ((x) >> (32-((n) & 0x1F))))

    typedef unsigned char _BYTE;

    int __stdcall AlvegiaDecrypt(signed int a1int a2int a3)
    {
      
    int v3;
      
    int v4;
      
    int v5;
      
    int result;
      
    char v7;

      
    v3 a3;
      
    v4 a2;
      
    v5 a1 8;
      
    result a1 0x7F;
      while ( 
    v3 )
      {
        --
    v3;
        
    v7 ROL(*(_BYTE *)v4v5);
        ++
    result;
        ++
    v4;
        *(
    _BYTE *)(v4 1) = AlvegiaKey[result] ^ v7;
        if ( (
    unsigned int)result >= 0x80 )
          
    result 0;
        ++
    v5;
        if ( 
    v5 >= )
          
    v5 0;
      }
      return 
    result;

    a1 = Calculated CRC32 hash for file name
    a2 = Buffer
    a3 = Size

    How it work (Example):

    Game opening file inside archive -> resources.xml.enc and eliminate extension from full filename .enc = resources.xml
    Next this file name resources.xml passes through the CRC32 and calculate hash = A40D64DF

    And last phase -

    PHP Code:
    AlvegiaDecrypt(0xA40D64DF,buffer,size
    Maybe useful to someone and it seems nothing hard
    Last edited by h4x0r; 2012-07-22 at 01:14 PM.

Similar Threads

  1. [C++] Audition 2 SF Decrypting (Need some Help)
    By h4x0r in forum C/C++
    Replies: 7
    Last Post: 2013-08-28, 10:15 PM
  2. [Asm] Dragonica Decrypting and Decompressing Table's
    By h4x0r in forum Game Researching Tutorials
    Replies: 4
    Last Post: 2013-05-25, 08:41 AM
Visitors found this page by searching for:

dragonica decryption

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •