Browse Source

Merge branch 'mpqapi_write_hash_table' of https://github.com/AJenbo/devilution into AJenbo-mpqapi_write_hash_table

pull/88/head
Robin Eklind 7 years ago
parent
commit
531a3ad34d
  1. 21
      Source/mpqapi.cpp
  2. 2
      Source/mpqapi.h

21
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()

2
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 */

Loading…
Cancel
Save