Update user module imports debug dump
This commit is contained in:
parent
589e672d20
commit
ef912e7e13
|
@ -351,6 +351,8 @@ void XUserModule::Dump() {
|
||||||
int unimpl_count = 0;
|
int unimpl_count = 0;
|
||||||
for (size_t m = 0; m < import_info_count; m++) {
|
for (size_t m = 0; m < import_info_count; m++) {
|
||||||
const xe_xex2_import_info_t* info = &import_infos[m];
|
const xe_xex2_import_info_t* info = &import_infos[m];
|
||||||
|
|
||||||
|
if (kernel_state_->IsKernelModule(library->name)) {
|
||||||
KernelExport* kernel_export =
|
KernelExport* kernel_export =
|
||||||
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
||||||
if (kernel_export) {
|
if (kernel_export) {
|
||||||
|
@ -364,6 +366,24 @@ void XUserModule::Dump() {
|
||||||
unknown_count++;
|
unknown_count++;
|
||||||
unimpl_count++;
|
unimpl_count++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// User module
|
||||||
|
XModule* module = kernel_state_->GetModule(library->name);
|
||||||
|
if (module) {
|
||||||
|
uint32_t export_addr =
|
||||||
|
module->GetProcAddressByOrdinal(info->ordinal);
|
||||||
|
if (export_addr) {
|
||||||
|
impl_count++;
|
||||||
|
known_count++;
|
||||||
|
} else {
|
||||||
|
unimpl_count++;
|
||||||
|
unknown_count++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unimpl_count++;
|
||||||
|
unknown_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
printf(" Total: %4u\n", uint32_t(import_info_count));
|
printf(" Total: %4u\n", uint32_t(import_info_count));
|
||||||
printf(" Known: %3d%% (%d known, %d unknown)\n",
|
printf(" Known: %3d%% (%d known, %d unknown)\n",
|
||||||
|
@ -377,14 +397,24 @@ void XUserModule::Dump() {
|
||||||
// Listing.
|
// Listing.
|
||||||
for (size_t m = 0; m < import_info_count; m++) {
|
for (size_t m = 0; m < import_info_count; m++) {
|
||||||
const xe_xex2_import_info_t* info = &import_infos[m];
|
const xe_xex2_import_info_t* info = &import_infos[m];
|
||||||
KernelExport* kernel_export =
|
|
||||||
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
|
||||||
const char* name = "UNKNOWN";
|
const char* name = "UNKNOWN";
|
||||||
bool implemented = false;
|
bool implemented = false;
|
||||||
|
|
||||||
|
KernelExport* kernel_export;
|
||||||
|
if (kernel_state_->IsKernelModule(library->name)) {
|
||||||
|
kernel_export =
|
||||||
|
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
||||||
if (kernel_export) {
|
if (kernel_export) {
|
||||||
name = kernel_export->name;
|
name = kernel_export->name;
|
||||||
implemented = kernel_export->is_implemented;
|
implemented = kernel_export->is_implemented;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
XModule* module = kernel_state_->GetModule(library->name);
|
||||||
|
if (module && module->GetProcAddressByOrdinal(info->ordinal)) {
|
||||||
|
// TODO: Name lookup
|
||||||
|
implemented = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (kernel_export && kernel_export->type == KernelExport::Variable) {
|
if (kernel_export && kernel_export->type == KernelExport::Variable) {
|
||||||
printf(" V %.8X %.3X (%3d) %s %s\n", info->value_address,
|
printf(" V %.8X %.3X (%3d) %s %s\n", info->value_address,
|
||||||
info->ordinal, info->ordinal, implemented ? " " : "!!", name);
|
info->ordinal, info->ordinal, implemented ? " " : "!!", name);
|
||||||
|
|
Loading…
Reference in New Issue