请僵哥帮忙.万分感谢
#include <string>  
#include <vector>  
#include <algorithm>  
#include <iostream>  
#include <fstream>  
using namespace std;  
  
char ranbuff[0xFFF];  
  
char readfilebuff[0x28+0x28+0x70000];  
char buff2[0x900000];  
char listbuff[0x90000];  
char wbuff[0x900000];  
  
DWORD listadd;  
DWORD listlen;  
  
HANDLE hFile;  
DWORD dwReadSize = 0;  
  
string rpath;  
string wpath;  
  
  
int fun_010C2EC0(const char* name,int code)  
{  
  
    char* a = ranbuff;  
    __asm  
    {  
        push esi  
            /*10C2EC1*/  mov    esi, name  
            /*10C2EC5*/  mov    cl, byte ptr [esi]  
        /*10C2EC7*/  test    cl, cl  
            /*10C2EC9*/  mov    eax, 0x7FED7FED  
            /*10C2ECE*/  mov    edx, 0xEEEEEEEE  
            /*10C2ED3*/  je      x2  
            /*10C2ED5*/  push    ebx  
            /*10C2ED6*/  push    ebp  
            /*10C2ED7*/  push    edi  
            /*10C2ED8*/  mov    edi, code  
            /*10C2EDC*/  shl    edi, 8  
x1:  
        /*10C2EE0*/  add    eax, edx  
            /*10C2EE2*/  imul    edx, edx, 0x21  
            /*10C2EE5*/  movsx  ecx, cl  
            /*10C2EE8*/  lea    ebx, dword ptr [edi+ecx]  
  
        push edi  
            mov edi,a  
            /*10C2EEB*/  mov    edi, dword ptr [ebx*4+edi]  
        /*10C2EF2*/  inc    esi  
            /*10C2EF3*/  add    edx, ecx  
            /*10C2EF5*/  mov    cl, byte ptr [esi]  
        /*10C2EF7*/  xor    eax, edi  
            pop edi  
            /*10C2EF9*/  test    cl, cl  
            /*10C2EFB*/  lea    edx, dword ptr [edx+eax+3]  
        /*10C2EFF*/  jnz    x1  
            /*10C2F01*/  pop    edi  
            /*10C2F02*/  pop    ebp  
            /*10C2F03*/  pop    ebx  
x2:  
        /*10C2F04*/  pop    esi  
  
  
  
  
    }  
  
  
}  
  
  
  
int fun_010C2F10(const char* name)  
{  
  
    if(name == NULL)  
        return 0;  
  
    int a1,a2,a3;  
  
    a1 = fun_010C2EC0(name,1);  
    a2 = fun_010C2EC0(name,2);  
    a3 = fun_010C2EC0(name,3);  
  
    __asm{  
  
        push edi  
            push esi  
  
            mov edi,a1  
            mov ebx,a2  
            mov ecx,a3  
  
            /*10C2F44*/  and    ecx, 0x7FFF  
            /*10C2F4A*/  mov    eax, ecx  
x1:  
        /*10C2F50*/  lea    edx, dword ptr [eax+eax*2]  
        shl edx,2  
            add edx,0x50  
            /*10C2F53*/  lea    esi, dword ptr [readfilebuff+edx]  
        /*10C2F57*/  mov    edx, dword ptr [esi+8]  
        /*10C2F5A*/  shr    edx, 0x1F  
            /*10C2F5D*/  test    dl, 1  
            /*10C2F60*/  je      x2  
            /*10C2F62*/  cmp    dword ptr [esi], edi  
            /*10C2F64*/  jnz    x2  
            /*10C2F66*/  cmp    dword ptr [esi+4], ebx  
            /*10C2F69*/  je      x3  
x2:  
        /*10C2F6B*/  inc    eax  
            /*10C2F6C*/  and    eax, 0x7FFF  
            /*10C2F71*/  cmp    eax, ecx  
            /*10C2F73*/  jnz    x1  
            /*10C2F75*/  or      eax, 0xFFFFFFFF  
x3:  
        pop    edi  
            pop    esi  
  
  
  
    }  
  
}  
  
  
  
void fun_010C3030()  
{  
    char* a = ranbuff;  
    char* b = ranbuff + 0x400;  
    char* c = ranbuff + 0x800;  
    __asm{  
        /*10C3030*/  push    ebx  
            /*10C3031*/  push    esi  
            /*10C3032*/  mov    ebx, ecx  
            /*10C3034*/  push    edi  
            /*10C3035*/  mov    ecx, 0x400  
            /*10C303A*/  xor    eax, eax  
            /*10C303C*/  mov    edi, a  
            /*10C3041*/  rep    stos dword ptr es:[edi]  
        /*10C3043*/  mov    edx, 0x100001  
            /*10C3048*/  mov    ecx, b  
            /*10C304D*/  lea    ecx, dword ptr [ecx]  
x1:  
        /*10C3050*/  mov    eax, edx  
            /*10C3052*/  imul    eax, eax, 0x7D  
            /*10C3055*/  add    eax, 3  
            /*10C3058*/  xor    edx, edx  
            /*10C305A*/  mov    esi, 0x2AAAAB  
            /*10C305F*/  div    esi  
            /*10C3061*/  mov    edi, 0x2AAAAB  
            /*10C3066*/  add    ecx, 4  
            /*10C3069*/  mov    eax, edx  
            /*10C306B*/  mov    esi, eax  
            /*10C306D*/  imul    eax, eax, 0x7D  
            /*10C3070*/  add    eax, 3  
            /*10C3073*/  xor    edx, edx  
            /*10C3075*/  div    edi  
            /*10C3077*/  shl    esi, 0x10  
            /*10C307A*/  mov    eax, edx  
            /*10C307C*/  imul    eax, eax, 0x7D  
            /*10C307F*/  add    eax, 3  
            /*10C3082*/  and    edx, 0x0FFFF  
            /*10C3088*/  or      edx, esi  
            /*10C308A*/  mov    dword ptr [ecx-0x404], edx  
            /*10C3090*/  xor    edx, edx  
            /*10C3092*/  mov    esi, edi  
            /*10C3094*/  div    esi  
            /*10C3096*/  mov    eax, edx  
            /*10C3098*/  mov    esi, eax  
            /*10C309A*/  imul    eax, eax, 0x7D  
            /*10C309D*/  add    eax, 3  
            /*10C30A0*/  xor    edx, edx  
            /*10C30A2*/  div    edi  
            /*10C30A4*/  shl    esi, 0x10  
            /*10C30A7*/  mov    eax, edx  
            /*10C30A9*/  imul    eax, eax, 0x7D  
            /*10C30AC*/  and    edx, 0x0FFFF  
            /*10C30B2*/  or      edx, esi  
            /*10C30B4*/  add    eax, 3  
            /*10C30B7*/  mov    dword ptr [ecx-4], edx  
            /*10C30BA*/  xor    edx, edx  
            /*10C30BC*/  mov    esi, edi  
            /*10C30BE*/  div    esi  
            /*10C30C0*/  mov    eax, edx  
            /*10C30C2*/  mov    esi, eax  
            /*10C30C4*/  imul    eax, eax, 0x7D  
            /*10C30C7*/  add    eax, 3  
            /*10C30CA*/  xor    edx, edx  
            /*10C30CC*/  div    edi  
            /*10C30CE*/  shl    esi, 0x10  
            /*10C30D1*/  mov    eax, edx  
            /*10C30D3*/  imul    eax, eax, 0x7D  
            /*10C30D6*/  and    edx, 0x0FFFF  
            /*10C30DC*/  or      edx, esi  
            /*10C30DE*/  add    eax, 3  
            /*10C30E1*/  mov    dword ptr [ecx+0x3FC], edx  
            /*10C30E7*/  xor    edx, edx  
            /*10C30E9*/  mov    esi, edi  
            /*10C30EB*/  div    esi  
            /*10C30ED*/  mov    eax, edx  
            /*10C30EF*/  mov    esi, eax  
            /*10C30F1*/  imul    eax, eax, 0x7D  
            /*10C30F4*/  add    eax, 3  
            /*10C30F7*/  xor    edx, edx  
            /*10C30F9*/  div    edi  
            /*10C30FB*/  shl    esi, 0x10  
            /*10C30FE*/  mov    eax, edx  
            /*10C3100*/  and    eax, 0x0FFFF  
            /*10C3105*/  or      eax, esi  
            /*10C3107*/  cmp    ecx, c  
            /*10C310D*/  mov    dword ptr [ecx+0x7FC], eax  
            /*10C3113*/  jl      x1  
            /*10C3119*/  pop    edi  
            /*10C311A*/  pop    esi  
            /*10C311B*/  mov    eax, ebx  
            /*10C311D*/  pop    ebx  
    }  
  
}  
  
  
  
  
void fun_010E40E0(int a)  
{  
  
    __asm{  
        mov edi,a  
            /*10E40E6*/  lea    edx, dword ptr [edi+edi*2]  
        /*10E40E9*/  lea    eax, dword ptr [readfilebuff+edx*4+0x50]  
        /*10E40ED*/  mov    eax, dword ptr [eax+8]  
        /*10E40F0*/  and    eax, 0x3FFFFFFF  
            /*10E40F5*/  lea    eax, dword ptr [eax+eax*2]  
        /*10E40F8*/  lea    ebx, dword ptr [buff2+eax*4]  
  
        mov  eax, dword ptr [ebx]  
  
        mov  listadd,eax  
            mov  eax, dword ptr [ebx+4]  
  
        mov  listlen,eax  
    }  
  
  
}  

解决方案 »

  1.   

    void writef(string name)  
    {  
        transform (name.begin(),name.end(), name.begin(), tolower);    
        fun_010E40E0(fun_010C2F10(name.c_str()));  
      
      
        string path = wpath;  
        string _name = name;  
      
        while (name.find("/") != string::npos)  
        {              
            path.append(name.substr(0,name.find("/")));  
            ::CreateDirectory(path.c_str(),NULL);  
            path = wpath;  
            name.replace(name.find("/"),1,"\\");  
        }    
        path.append(name);  
        ::SetFilePointer(hFile, 0, NULL, FILE_BEGIN);  
        ::SetFilePointer(hFile, listadd, NULL, FILE_BEGIN);  
        ::ReadFile(hFile,&wbuff,listlen,&dwReadSize,NULL);  
        HANDLE hwFile = ::CreateFile(path.c_str(), GENERIC_WRITE|GENERIC_READ,0,NULL,  CREATE_ALWAYS,    FILE_ATTRIBUTE_NORMAL,  NULL);    
        ::WriteFile(hwFile,wbuff,listlen,&dwReadSize,NULL);  
    }  
      
      
    void writelistfile()  
    {  
        fun_010E40E0(fun_010C2F10("(list)"));  
        ::SetFilePointer(hFile, 0, NULL, FILE_BEGIN);  
        ::SetFilePointer(hFile, listadd, NULL, FILE_BEGIN);  
        ::ReadFile(hFile,&listbuff,listlen,&dwReadSize,NULL);  
        string path = wpath;  
        path.append("(list)");  
        HANDLE hwFile = ::CreateFile(path.c_str(), GENERIC_WRITE|GENERIC_READ,0,NULL,  CREATE_ALWAYS,    FILE_ATTRIBUTE_NORMAL,  NULL);    
        ::WriteFile(hwFile,listbuff,listlen,&dwReadSize,NULL);  
    }  
      
      
    void axp(string _rpath)  
    {  
      
        int aa;  
        hFile = ::CreateFile(_rpath.c_str(), GENERIC_READ,0,NULL,  OPEN_EXISTING,    FILE_ATTRIBUTE_NORMAL,  NULL);    
        ::ReadFile(hFile,&readfilebuff[0x28],0x60028,&dwReadSize,NULL);  
        ::SetFilePointer(hFile, 0x60028, NULL, FILE_BEGIN);  
        __asm{  
      
            pushad  
      
                /*10C222F*/  mov    eax, dword ptr [readfilebuff+0x3C]  
            /*10C223F*/  lea    eax, dword ptr [eax+eax*2]  
            /*10C2242*/  shl    eax, 2  
                mov aa,eax  
      
      
                popad  
      
      
        }  
        ::ReadFile(hFile,&buff2,aa,&dwReadSize,NULL);  
        fun_010C3030();  
        writelistfile();  
        string liststr;  
        vector<string> v;  
      
        for(DWORD i=0;i<listlen;i++)  
        {  
            if(listbuff != 0xA)  
            {  
                liststr += listbuff;  
            }else{  
                v.push_back(liststr);  
                liststr = "";  
            }  
        }  
      
      
        vector<string>::iterator iter;  
        string tem;  
        string tem1;  
        string::size_type loc;  
        for( iter = v.begin(); iter != v.end(); iter++ ) {  
      
            tem = (*iter);  
            loc = tem.find("|");  
            if( loc != string::npos)  
            {  
                tem1 = tem.substr(0,loc);  
                writef(tem1);  
      
            }  
      
        }    
      
    }  
      
      
      
      
    int _tmain(int argc, _TCHAR* argv[])  
    {  
        printf("天龙八部资源提取小工具\n");  
        string d= "F:\\TLBB\\Data";  
        string p = d + "\\axp";  
        ::CreateDirectory(p.c_str(),NULL);  
        wpath = p+"\\Brushes.axp\\";  
        ::CreateDirectory(wpath.c_str(),NULL);  
        axp(rpath);  
        printf("Brushes.axp提取成功\n")  
            getchar();  
        return 0;  
    }