From 37bfbf556a55d5678987f78f06d21e911cf4141b Mon Sep 17 00:00:00 2001 From: JustAnotherGuid <46401660+JustAnotherGuid@users.noreply.github.com> Date: Sun, 24 Mar 2019 17:47:52 +0100 Subject: [PATCH] void __fastcall mpqapi_remove_hash_entries(BOOL(__stdcall *fnGetName)(DWORD, char *)) --- Source/mpqapi.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index 9beddeb7f..158e45052 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -257,18 +257,13 @@ int __fastcall mpqapi_get_hash_index(short index, int hash_a, int hash_b, int lo void __fastcall mpqapi_remove_hash_entries(BOOL(__stdcall *fnGetName)(DWORD, char *)) { - BOOL(__stdcall * v1) - (DWORD, char *); // edi - DWORD v2; // esi - BOOL i; // eax - DWORD v4; // eax - char v5[260]; // [esp+8h] [ebp-104h] - - v1 = fnGetName; - v2 = 1; - for (i = fnGetName(0, v5); i; i = v1(v4, v5)) { - mpqapi_remove_hash_entry(v5); - v4 = v2++; + DWORD dwIndex; + BOOL i; + char pszFileName[260]; + + dwIndex = 1; + for (i = fnGetName(0, pszFileName); i; i = fnGetName(dwIndex++, pszFileName)) { + mpqapi_remove_hash_entry(pszFileName); } }