diff --git a/src/Core/PS4/HLE/LibC.cpp b/src/Core/PS4/HLE/LibC.cpp index aec94d3d..db58b9df 100644 --- a/src/Core/PS4/HLE/LibC.cpp +++ b/src/Core/PS4/HLE/LibC.cpp @@ -4,6 +4,8 @@ namespace HLE::Libs::LibC { + static u32 g_need_sceLibc = 1; + static void init_env() //every game/demo should probably { for(;;) { @@ -50,6 +52,8 @@ namespace HLE::Libs::LibC { LIB_FUNCTION("XKRegsFpEpk", "libc", 1, "libc", 1, 1, catchReturnFromMain); LIB_FUNCTION("uMei1W9uyNo", "libc", 1, "libc", 1, 1, exit); LIB_FUNCTION("8G2LB+A3rzg", "libc", 1, "libc", 1, 1, atexit); + + LIB_OBJ("P330P3dFF68", "libc", 1, "libc", 1, 1, &HLE::Libs::LibC::g_need_sceLibc); } }; \ No newline at end of file diff --git a/src/Core/PS4/HLE/LibKernel.cpp b/src/Core/PS4/HLE/LibKernel.cpp index 231213c8..0bb77997 100644 --- a/src/Core/PS4/HLE/LibKernel.cpp +++ b/src/Core/PS4/HLE/LibKernel.cpp @@ -4,6 +4,8 @@ namespace HLE::Libs::LibKernel { + static u64 g_stack_chk_guard = 0xDEADBEEF54321ABC; //dummy return + int sceKernelAllocateDirectMemory(off_t searchStart, off_t searchEnd, size_t len, size_t alignment, int memoryType, off_t* physAddrOut) { return 0;//OK } size_t sceKernelGetDirectMemorySize() { return 0; @@ -26,6 +28,8 @@ namespace HLE::Libs::LibKernel { } void LibKernel_Register(SymbolsResolver* sym) { + //obj + LIB_OBJ("f7uOxY9mM1U", "libkernel", 1, "libkernel", 1, 1, &HLE::Libs::LibKernel::g_stack_chk_guard); //memory LIB_FUNCTION("rTXw65xmLIA", "libkernel", 1, "libkernel", 1, 1, sceKernelAllocateDirectMemory); LIB_FUNCTION("pO96TwzOm5E", "libkernel", 1, "libkernel", 1, 1, sceKernelGetDirectMemorySize); diff --git a/src/Core/PS4/HLE/Libs.h b/src/Core/PS4/HLE/Libs.h index a7177ca3..5f94e81c 100644 --- a/src/Core/PS4/HLE/Libs.h +++ b/src/Core/PS4/HLE/Libs.h @@ -16,6 +16,19 @@ sym->AddSymbol(sr, func);\ } +#define LIB_OBJ(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, function) \ + { \ + SymbolRes sr{}; \ + sr.name = nid; \ + sr.library = lib; \ + sr.library_version = libversion; \ + sr.module = mod; \ + sr.module_version_major = moduleVersionMajor; \ + sr.module_version_minor = moduleVersionMinor; \ + sr.type = STT_OBJECT; \ + auto func = reinterpret_cast(function); \ + sym->AddSymbol(sr, func); \ + } namespace HLE::Libs { void Init_HLE_Libs(SymbolsResolver* sym); } \ No newline at end of file