Browse Source

Merge pull request #820 from JustAnotherGuid/mpqapiregloadmodificationtime

mpqapi_reg_load_modification_time bin exact
pull/78/head
Robin Eklind 7 years ago committed by GitHub
parent
commit
650ce139d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      Source/mpqapi.cpp
  2. 2
      Source/mpqapi.h

41
Source/mpqapi.cpp

@ -55,29 +55,30 @@ void __fastcall mpqapi_store_creation_time(const char *pszArchive, int dwChar)
}
// 679660: using guessed type char gbMaxPlayers;
BOOLEAN __fastcall mpqapi_reg_load_modification_time(char *dst, int size)
BOOL __fastcall mpqapi_reg_load_modification_time(char *dst, int size)
{
unsigned int v2; // esi
char *v3; // edi
unsigned int v6; // esi
char *v7; // ecx
int nbytes_read; // [esp+8h] [ebp-4h]
v2 = size;
v3 = dst;
unsigned int iSize;
char *pszDst;
char *pbData;
int nbytes_read;
iSize = size;
pszDst = dst;
memset(dst, 0, size);
if (!SRegLoadData("Diablo", "Video Player ", 0, (unsigned char *)v3, v2, (LPDWORD)&nbytes_read) || nbytes_read != v2)
return 0;
if (v2 >= 8) {
v6 = v2 >> 3;
do {
v7 = v3;
v3 += 8;
mpqapi_xor_buf(v7);
--v6;
} while (v6);
if (!SRegLoadData("Diablo", "Video Player ", 0, (unsigned char *)pszDst, iSize, (LPDWORD)&nbytes_read)) {
return FALSE;
}
return 1;
if (nbytes_read != size)
return FALSE;
for (; iSize >= 8; iSize -=8) {
pbData = pszDst;
pszDst += 8;
mpqapi_xor_buf(pbData);
}
return TRUE;
}
void __fastcall mpqapi_xor_buf(char *pbData)

2
Source/mpqapi.h

@ -8,7 +8,7 @@ extern BOOLEAN save_archive_open; // weak
BOOL __fastcall mpqapi_set_hidden(const char *pszArchive, BOOL hidden);
void __fastcall mpqapi_store_creation_time(const char *pszArchive, int dwChar);
BOOLEAN __fastcall mpqapi_reg_load_modification_time(char *dst, int size);
BOOL __fastcall mpqapi_reg_load_modification_time(char *dst, int size);
void __fastcall mpqapi_xor_buf(char *pbData);
void __fastcall mpqapi_update_multi_creation_time(DWORD dwChar);
BOOLEAN __fastcall mpqapi_reg_store_modification_time(char *pbData, DWORD dwLen);

Loading…
Cancel
Save