Browse Source

Clean-up mpqapi_reg_store_modification_time (#623)

* Clean-up AddChest.

* (Work in progress) Clean-up InitL1Triggers

* Clean-up InitL1Triggers (Binary-exact version)

* Add /FAs flag.

* Rebase

* Accidental add.

* Minor modifications.

* Clean-Up mpqapi_reg_store_modification_time.

* Change to DWORD.
pull/35/head
JustAnotherGuid 7 years ago committed by Robin Eklind
parent
commit
820e70cd94
  1. 31
      Source/mpqapi.cpp
  2. 2
      Source/mpqapi.h

31
Source/mpqapi.cpp

@ -101,27 +101,24 @@ void __fastcall mpqapi_update_multi_creation_time(DWORD dwChar)
{
}
BOOLEAN __fastcall mpqapi_reg_store_modification_time(char *pbData, int dwLen)
BOOLEAN __fastcall mpqapi_reg_store_modification_time(char *pbData, DWORD dwLen)
{
int v2; // ebx
char *v3; // ebp
char *v4; // edi
unsigned int v5; // esi
char *v6; // ecx
char *pbCurrentData;
DWORD i;
char *pbDataToXor;
v2 = dwLen;
v3 = pbData;
v4 = pbData;
if ((unsigned int)dwLen >= 8) {
v5 = (unsigned int)dwLen >> 3;
pbCurrentData = pbData;
if (dwLen >= 8) {
i = dwLen >> 3;
do {
v6 = v4;
v4 += 8;
mpqapi_xor_buf(v6);
--v5;
} while (v5);
pbDataToXor = pbCurrentData;
pbCurrentData += 8;
mpqapi_xor_buf(pbDataToXor);
--i;
} while (i);
}
return SRegSaveData("Diablo", "Video Player ", 0, (unsigned char *)v3, v2);
return SRegSaveData("Diablo", "Video Player ", 0, (unsigned char *)pbData, dwLen);
}
void __fastcall mpqapi_remove_hash_entry(const char *pszName)

2
Source/mpqapi.h

@ -11,7 +11,7 @@ void __fastcall mpqapi_store_creation_time(const char *pszArchive, int dwChar);
BOOLEAN __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, int dwLen);
BOOLEAN __fastcall mpqapi_reg_store_modification_time(char *pbData, DWORD dwLen);
_BLOCKENTRY *__fastcall j_mpqapi_remove_hash_entry(char *pszName);
void __fastcall mpqapi_remove_hash_entry(const char *pszName);
void __fastcall mpqapi_free_block(int block_offset, int block_size);

Loading…
Cancel
Save