fixed mistake in menuet header, improved formatting
This commit is contained in:
parent
e69292b815
commit
2e7cc4191e
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
|||||||
*.exe
|
*.exe
|
||||||
*.zip
|
*.zip
|
||||||
*.img
|
*.img
|
||||||
|
tests/
|
14
kexview.c
14
kexview.c
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char signature[SIGNATURE_SIZE];
|
char signature[SIGNATURE_SIZE];
|
||||||
|
uint32_t version;
|
||||||
uint32_t start_address;
|
uint32_t start_address;
|
||||||
uint32_t file_size;
|
uint32_t file_size;
|
||||||
uint32_t memory_required;
|
uint32_t memory_required;
|
||||||
@ -34,7 +35,8 @@ void show_menuet_xx(const char *fpath) {
|
|||||||
printf("Error: Invalid signature.\n");
|
printf("Error: Invalid signature.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("Version: %.*s\n", SIGNATURE_SIZE, header.signature);
|
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("Start Address: 0x%x\n", header.start_address);
|
||||||
printf("File Size: %u bytes\n", header.file_size);
|
printf("File Size: %u bytes\n", header.file_size);
|
||||||
printf("Memory Required: %u bytes\n", header.memory_required);
|
printf("Memory Required: %u bytes\n", header.memory_required);
|
||||||
@ -52,6 +54,7 @@ void show_library(const char *fpath) {
|
|||||||
printf("Failed to load library.");
|
printf("Failed to load library.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
printf("Export table:\n\nFunction Address\n-------------------------------------\n");
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
char *func_name = (table + i)->func_name;
|
char *func_name = (table + i)->func_name;
|
||||||
@ -62,7 +65,14 @@ void show_library(const char *fpath) {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} 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++;
|
i++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user