diff --git a/section.ld b/section.ld index f9540c1a..1695e3eb 100644 --- a/section.ld +++ b/section.ld @@ -14,5 +14,6 @@ SECTIONS { *(.eh_frame*) *(.ctors) *(.reloc) + *(.idata*) } } \ No newline at end of file diff --git a/section/SimGetCommandQueue.cpp b/section/SimGetCommandQueue.cpp index 5acf1db3..ff105b99 100644 --- a/section/SimGetCommandQueue.cpp +++ b/section/SimGetCommandQueue.cpp @@ -1,5 +1,4 @@ #include "include/moho.h" -#include "include/LuaAPI.h" void __thiscall SimGetCommandQueueInsert(LuaObject *this_, LuaObject *obj) { @@ -11,7 +10,7 @@ void __thiscall SimGetCommandQueueInsert(LuaObject *this_, LuaObject *obj) auto targetId = *reinterpret_cast(unitCmd + 0xA0); if (targetId != 0xF0000000) { char buf[16]; - sprintf_s(buf, sizeof(buf), "%d", targetId); //like game doing entityId with std::string + FAsprintf_s(buf, sizeof(buf), "%d", targetId); //like game doing entityId with std::string obj->SetString("targetId", buf); } auto v3 = *reinterpret_cast(unitCmd + 0x60); diff --git a/section/SimGetDepositsAroundPoint.cpp b/section/SimGetDepositsAroundPoint.cpp index ccabf1a8..32120360 100644 --- a/section/SimGetDepositsAroundPoint.cpp +++ b/section/SimGetDepositsAroundPoint.cpp @@ -33,7 +33,7 @@ int SimGetDepositsAroundPoint(lua_State *L) { lua_push(L, "X2", deposit->X2); lua_push(L, "Z2", deposit->Z2); lua_push(L, "Type", deposit->Type); - lua_push(L, "Dist", sqrtf(dist)); + lua_push(L, "Dist", FAsqrtf(dist)); lua_settable(L, -3); } return 1; diff --git a/section/include/global.h b/section/include/global.h index c52159eb..fad7551d 100644 --- a/section/include/global.h +++ b/section/include/global.h @@ -71,17 +71,17 @@ FDecl(0x937C30, SpewF, int (*)(const char *fmt, ...)) FDecl(0x41C990, ConsoleLogF, int (*)(const char *fmt, ...)) FDecl(0xA9B4E6, FileWrite, int (*)(int fileIndex, const char *str, int strlen)) //index 3 is log. FDecl(0xA825B9, shi_new, void* (*)(size_t size)) -FDecl(0x957B00, realloc, void* (*)(void *ptr, size_t new_size)) -FDecl(0x958B20, malloc, void* (*)(size_t size)) -FDecl(0x958C40, free, void (*)(void *ptr)) -FDecl(0x957EA0, msize, size_t (*)(void *memblock)) -FDecl(0x957AB0, calloc, void* (*)(size_t num, size_t size)) -FDecl(0xA89110, memset, void* (*)(void *dest, int ch, size_t count)) -FDecl(0xA89190, memcpy, void* (*)(void *dest, const void *src, size_t count)) -FDecl(0x452FC0, sqrtf, float (*)(float arg)) -FDecl(0xA94450, strlen, size_t (*)(const char *str)) -FDecl(0xAA549E, strcmp, int (*)(const char *str1, const char *str2)) -FDecl(0xA82F32, sprintf_s, int (*)(char *Buffer, size_t BufferCount, const char *Format, ...)) +FDecl(0x957B00, FArealloc, void* (*)(void *ptr, size_t new_size)) +FDecl(0x958B20, FAmalloc, void* (*)(size_t size)) +FDecl(0x958C40, FAfree, void (*)(void *ptr)) +FDecl(0x957EA0, FAmsize, size_t (*)(void *memblock)) +FDecl(0x957AB0, FAcalloc, void* (*)(size_t num, size_t size)) +FDecl(0xA89110, FAmemset, void* (*)(void *dest, int ch, size_t count)) +FDecl(0xA89190, FAmemcpy, void* (*)(void *dest, const void *src, size_t count)) +FDecl(0x452FC0, FAsqrtf, float (*)(float arg)) +FDecl(0xA94450, FAstrlen, size_t (*)(const char *str)) +FDecl(0xAA549E, FAstrcmp, int (*)(const char *str1, const char *str2)) +FDecl(0xA82F32, FAsprintf_s, int (*)(char *Buffer, size_t BufferCount, const char *Format, ...)) FDecl(0x405550, InitString, __thiscall void (*)(void *this_, const char *str)) FDecl(0x4059E0, AssignString, __thiscall void (*)(void *this_, const char *str, size_t size))