Skip to content

Commit

Permalink
ObjectExplorer: Add Assemblies information
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Mar 9, 2025
1 parent 7f94cf2 commit 426d435
Showing 1 changed file with 70 additions and 4 deletions.
74 changes: 70 additions & 4 deletions src/mods/tools/ObjectExplorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,79 @@ void ObjectExplorer::on_draw_dev_ui() {
fake_type.resize(t->size);
}

memset(fake_type.data(), 0, t->size);\
memset(fake_type.data(), 0, t->size);
handle_type((REManagedObject*)fake_type.data(), t);
}
}

if (ImGui::CollapsingHeader("Assemblies")) {
auto tdb = sdk::RETypeDB::get();

for (auto i = 0; i < tdb->get_num_modules(); ++i) {
auto& module = tdb->modules[i];

if (ImGui::TreeNode(module.get_assembly_name())) {
ImGui::Text("Location: %s", module.get_location());
ImGui::Text("Module Name: %s", module.get_module_name());

if (ImGui::TreeNode("Assembly Types")) {
std::vector<uint8_t> fake_type{ 0 };

for (auto& t_index : module.get_types()) {
auto t = tdb->get_type(t_index);
if (t == nullptr) {
continue;
}
if (t->size > fake_type.size()) {
fake_type.resize(t->size);
}

memset(fake_type.data(), 0, t->size);
handle_type((REManagedObject*)fake_type.data(), t->get_type());
}

ImGui::TreePop();
}

if (ImGui::TreeNode("Assembly Methods")) {
for (auto& m_index : module.get_methods()) {
auto m = tdb->get_method(m_index);
if (m == nullptr) {
continue;
}
attempt_display_method(nullptr, *m, true);
}

ImGui::TreePop();
}

if (ImGui::TreeNode("Assembly Instantiated Methods")) {
for (auto& m_index : module.get_instantiated_methods()) {
auto m = tdb->get_method(m_index);
if (m == nullptr) {
continue;
}
attempt_display_method(nullptr, *m, true);
}

ImGui::TreePop();
}

if (ImGui::TreeNode("Assembly Member References")) {
for (auto& m_index : module.get_member_references()) {
if (auto m = tdb->get_method(m_index); m != nullptr) {
attempt_display_method(nullptr, *m, true);
}
}

ImGui::TreePop();
}

ImGui::TreePop();
}
}
}

ImGui::Checkbox("Search using Regex", &m_search_using_regex);

if (m_do_init || ImGui::InputText("Type Name", m_type_name.data(), 256)) {
Expand Down Expand Up @@ -4916,12 +4984,10 @@ LONG ObjectExplorer::exception_handler_veh_internal(_EXCEPTION_POINTERS* ex) {

// Clear DR6
ex->ContextRecord->Dr6 &= ~(1 << i);
break;
return EXCEPTION_CONTINUE_EXECUTION;
}
}
}

return EXCEPTION_CONTINUE_EXECUTION;
}

return EXCEPTION_CONTINUE_SEARCH;
Expand Down

0 comments on commit 426d435

Please sign in to comment.