feat(core): add check for .NET binaries

This commit is contained in:
notcpuid
2025-07-02 10:58:37 +03:00
parent 456f1b7484
commit 4aae9feba6
2 changed files with 110 additions and 107 deletions

View File

@@ -17,12 +17,16 @@ c_core::c_core(std::string input_file, std::string output_file, std::uint32_t mu
print_error("Binary is not PE file\n"); print_error("Binary is not PE file\n");
} }
m_peImage = std::make_unique<pe_bliss::pe_base>(pe_bliss::pe_factory::create_pe(pe_file)); m_peImage = std::make_unique<pe_bliss::pe_base>(pe_bliss::pe_factory::create_pe(pe_file));
if (m_peImage->get_pe_type() != pe_bliss::pe_type_32) { if (m_peImage->get_pe_type() != pe_bliss::pe_type_32) {
print_error("Binary is not x86 architecture\n"); print_error("Binary is not x86 architecture\n");
} }
bool clr_dir = m_peImage->directory_exists(14);
if (clr_dir) {
print_error("CLR directory found, .NET binary is not supported yet\n");
}
JitRuntime jitRt; JitRuntime jitRt;
m_codeHolder = std::make_unique<CodeHolder>(); m_codeHolder = std::make_unique<CodeHolder>();
Error init_asmjit = m_codeHolder->init(jitRt.environment(), jitRt.cpuFeatures()); Error init_asmjit = m_codeHolder->init(jitRt.environment(), jitRt.cpuFeatures());
@@ -253,7 +257,6 @@ void c_core::process()
for (const xor_target_t& target : obf_xor_targets) { for (const xor_target_t& target : obf_xor_targets) {
xor_function_range(target); xor_function_range(target);
insert_runtime_xor_stub(target); insert_runtime_xor_stub(target);
} }
} }