解压缩清单文件

来源:互联网 发布:php 共享内存 加锁 编辑:程序博客网 时间:2024/05/12 05:19

解压缩清单文件

struct WCPRtl {    int length; //必须是压缩文件的长度    int X;    char* content;    WCPRtl() {}    WCPRtl(int l, int x, char* c) { length = l; X = x; content = c; }};int DecompressManifest(WCHAR* dcFilename){    typedef int(__fastcall * fnDecompressManifest)(int, WCPRtl *pManifestContents, int *);    fnDecompressManifest g_fnDecompressManifest;    int pfn = (int)phWCP + 0x226b2c;    g_fnDecompressManifest = (fnDecompressManifest)pfn;    int result = -1;    char *in = ReadFileToBuffer(dcFilename);    long fileSize = GetFilesize(dcFilename);    int newFileSize = 0;//fileSize;    WCPRtl S = WCPRtl(fileSize, newFileSize, in);    int a3 = -1;    cout << sizeof(S) << endl;    int b;    result = g_fnDecompressManifest(0, &S, &a3);    printf("DecompressManifest error: %d\n", GetLastError());    cout << "DecompressManifest result: " << result << endl;    printf("a3: %d\n", a3);    WCHAR* filename = dcFilename; // 此处写入文件名     ofstream fout(filename, ios::binary);    fout.write(S.content, S.length);    fout.close();    //if (GetLastError())    if (result > 0)        return 1;    else        return 0;}

wcp.dll,Windows Componentization Platform Servicing API,10.0.10240.16384

0 0