summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index e71b1b7..32e4fa8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,6 +5,9 @@
#include "types.h"
#include "utils.c"
+#include "hashmap.c"
+
+extern u32 _fltused = TRUE;
static HANDLE h_input = NULL;
static HANDLE h_output = NULL;
@@ -15,6 +18,10 @@ static DWORD continue_status = DBG_EXCEPTION_NOT_HANDLED;
static DEBUG_EVENT dbg_event;
static PROCESS_INFORMATION proc_info = { 0 };
+// TODO: Perfect hashing table ?
+u8* string_stack_base = NULL;
+u8* string_stack_current = NULL;
+
/* Read debugged process memory at address */
u8 read_memory(const void* addr, void* buffer, size_t size) {
size_t b_read = 0U;
@@ -24,6 +31,7 @@ u8 read_memory(const void* addr, void* buffer, size_t size) {
}
#include "module.c"
+#include "stack_walk.c"
#include "parser.c"
#include "pdb.c"
#include "events.c"
@@ -80,12 +88,14 @@ void dbg_loop() {
int mainCRTStartup() {
- STARTUPINFOW startup_info = { 0 };
+ string_stack_current = string_stack_base = VirtualAlloc(NULL, 4096U * 16U, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
+
+ STARTUPINFOA startup_info = { 0 };
startup_info.cb = sizeof(startup_info);
- BOOL ret = CreateProcessW(
+ BOOL ret = CreateProcessA(
NULL,
- L"./test.exe",
+ "./test.exe",
NULL,
NULL,
FALSE,