diff --git a/.gitignore b/.gitignore index bf5f8a9..d84b6a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.code-workspace *.exe *.zip -*.img \ No newline at end of file +*.img +tests/ \ No newline at end of file diff --git a/kexview b/kexview index e569d2d..0754d0a 100644 Binary files a/kexview and b/kexview differ diff --git a/kexview.c b/kexview.c index 3f95120..a1beac1 100644 --- a/kexview.c +++ b/kexview.c @@ -7,6 +7,7 @@ typedef struct { char signature[SIGNATURE_SIZE]; + uint32_t version; uint32_t start_address; uint32_t file_size; uint32_t memory_required; @@ -34,15 +35,16 @@ void show_menuet_xx(const char *fpath) { printf("Error: Invalid signature.\n"); return; } - printf("Version: %.*s\n", SIGNATURE_SIZE, header.signature); - printf("Start Address: 0x%x\n", header.start_address); - printf("File Size: %u bytes\n", header.file_size); - printf("Memory Required: %u bytes\n", header.memory_required); - printf("ESP Value: 0x%x\n", header.esp_value); + printf("Signature: %.*s\n", SIGNATURE_SIZE, header.signature); + printf("Version: 0x%x\n", header.version); + printf("Start Address: 0x%x\n", header.start_address); + printf("File Size: %u bytes\n", header.file_size); + printf("Memory Required: %u bytes\n", header.memory_required); + printf("ESP Value: 0x%x\n", header.esp_value); printf("Parameter Address: 0x%x\n", header.param_address); printf("File Path Address: 0x%x\n", header.file_path_address); if (strncmp(header.signature, "MENUET02", SIGNATURE_SIZE) == 0) { - printf("TLS Data Address: 0x%x\n", header.tls_data_address); + printf("TLS Data Address: 0x%x\n", header.tls_data_address); } } @@ -52,6 +54,7 @@ void show_library(const char *fpath) { printf("Failed to load library."); return; } + printf("Export table:\n\nFunction Address\n-------------------------------------\n"); size_t i = 0; for (;;) { char *func_name = (table + i)->func_name; @@ -62,7 +65,14 @@ void show_library(const char *fpath) { } return; } else { - printf("%s %p\n", func_name, func_ptr); + printf("%s", func_name); + int x = strlen(func_name); + while (x < 25) { + putc(' '); + x++; + } + putc(' '); + printf(" 0x%x\n", func_ptr); } i++; }