fixed mistake in menuet header, improved formatting
This commit is contained in:
parent
e69292b815
commit
2e7cc4191e
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
*.code-workspace
|
||||
*.exe
|
||||
*.zip
|
||||
*.img
|
||||
*.img
|
||||
tests/
|
24
kexview.c
24
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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user