Skip to content

Commit eb54022

Browse files
committed
Fix wrong call convention that lead to crash
1 parent 8832e0b commit eb54022

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Ext/INIClass/Body.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#include "Body.h"
22

3-
// Ares replaced ReadString with its implementations, which is very different from the vanilla.
4-
// Vanilla implementation reads raw bytes, which makes it possible to read the UTF-8 from INI.
5-
// Ares implementation reads only valid ANSI symbols - Belonit
6-
int INIClassExt::ReadString_WithoutAresHook(INIClass* pThis, const char* pSection, const char* pKey, const char* pDefault, char* pBuffer, size_t szBufferSize)
3+
int __fastcall ReadString_WithoutAresHook_Impl(INIClass* pThis, size_t, const char* pSection, const char* pKey, const char* pDefault, char* pBuffer, size_t szBufferSize)
74
{
85
EPILOG_THISCALL;
96

@@ -14,3 +11,8 @@ int INIClassExt::ReadString_WithoutAresHook(INIClass* pThis, const char* pSectio
1411
_asm { mov edx, 0x528A10 + 5 };
1512
_asm { jmp edx }
1613
}
14+
15+
int INIClassExt::ReadString_WithoutAresHook(INIClass* pThis, const char* pSection, const char* pKey, const char* pDefault, char* pBuffer, size_t szBufferSize)
16+
{
17+
return ReadString_WithoutAresHook_Impl(pThis, 0, pSection, pKey, pDefault, pBuffer, szBufferSize);
18+
}

src/Ext/INIClass/Body.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class INIClassExt
44
{
55
public:
6-
// Ares replaced ReadString with its implementations, which is very different from the vanilla.
6+
// Ares replaced ReadString with its implementation, which is very different from the vanilla.
77
// Vanilla implementation reads raw bytes, which makes it possible to read the UTF-8 from INI.
88
// Ares implementation reads only valid ANSI symbols - Belonit
99
static int ReadString_WithoutAresHook(INIClass* pThis, const char* pSection, const char* pKey, const char* pDefault, char* pBuffer, size_t szBufferSize);

0 commit comments

Comments
 (0)