Tiny steps towards implementing C runtime

This commit is contained in:
KeybadeBlox 2026-02-14 12:34:28 -05:00
parent ccd2cd37a5
commit c38d9b5628
6 changed files with 65 additions and 14 deletions

View file

@ -0,0 +1,32 @@
/* JSRF Decompilation: XDK/CRT0.cpp
C runtime initialization.
Like other CRT code, there's some magic here with symbols that get special
treatment from the compiler and linker.
*/
#include "Win32.hpp"
// Every program is supposed to have a main(), so we can just assume its
// existence with a declaration here
int main();
void __stdcall mainCRTStartup ();
static DWORD _mainXapiStartup(LPVOID lpThreadParameter);
// Address: 0x00148023
// Matching: no
void __stdcall mainCRTStartup() {
/* The true entrypoint of the game, spawning a thread for the rest to run in
The linker automatically sets this function to the entrypoint.
*/
}
// Address: 0x00147FB4
// Matching: no
DWORD _mainXapiStartup(LPVOID const lpThreadParameter) {
/* Runs some initialization and then calls main() */
main();
}

View file

@ -32,10 +32,6 @@ typedef int BOOL;
// 64-bit integer compatibility type
union LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
};
struct {
DWORD LowPart;
LONG HighPart;