diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index 35765201a..dacd6d778 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -681,21 +681,18 @@ BOOL mpqapi_write_block_table() return success && NumberOfBytesWritten == 0x8000; } -BOOLEAN mpqapi_write_hash_table() +BOOL mpqapi_write_hash_table() { - int v1; // eax - BOOL v2; // ebx - int v3; // eax - DWORD NumberOfBytesWritten; // [esp+4h] [ebp-4h] + BOOL success; + DWORD NumberOfBytesWritten; if (SetFilePointer(sghArchive, 32872, NULL, FILE_BEGIN) == -1) - return 0; - v1 = Hash("(hash table)", 3); - Encrypt(sgpHashTbl, 0x8000, v1); - v2 = WriteFile(sghArchive, sgpHashTbl, 0x8000u, &NumberOfBytesWritten, 0); - v3 = Hash("(hash table)", 3); - Decrypt(sgpHashTbl, 0x8000, v3); - return v2 && NumberOfBytesWritten == 0x8000; + return FALSE; + + Encrypt(sgpHashTbl, 0x8000, Hash("(hash table)", 3)); + success = WriteFile(sghArchive, sgpHashTbl, 0x8000, &NumberOfBytesWritten, 0); + Decrypt(sgpHashTbl, 0x8000, Hash("(hash table)", 3)); + return success && NumberOfBytesWritten == 0x8000; } BOOL mpqapi_can_seek() diff --git a/Source/mpqapi.h b/Source/mpqapi.h index ce5479022..3d078959f 100644 --- a/Source/mpqapi.h +++ b/Source/mpqapi.h @@ -32,7 +32,7 @@ void mpqapi_store_modified_time(const char *pszArchive, int dwChar); void mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, int dwChar); BOOLEAN mpqapi_write_header(); BOOL mpqapi_write_block_table(); -BOOLEAN mpqapi_write_hash_table(); +BOOL mpqapi_write_hash_table(); BOOL mpqapi_can_seek(); /* rdata */