From 9b2fb43fb90816df3d15b58273c70890f1898a4b Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Sun, 29 May 2022 16:07:22 -0700 Subject: [PATCH] added some comments. preparing to move the routine split code to a pass... --- src/decomp/decomp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/decomp/decomp.cpp b/src/decomp/decomp.cpp index 27ea3ba..46995e2 100644 --- a/src/decomp/decomp.cpp +++ b/src/decomp/decomp.cpp @@ -126,13 +126,15 @@ std::optional decomp_t::decompose( auto syms = rtn.decompose(); m_syms->put_symbols(syms); + // else the symbol isnt a function and its public or private (some data + // symbols are private)... } else if (sym->storage_class == coff::storage_class_id::public_symbol || sym->storage_class == coff::storage_class_id::private_symbol) { auto scn = img->get_section(sym->section_index - 1); auto scn_sym = m_syms->sym_from_hash(m_scn_hash_tbl[scn]); - // if the section doesnt have a symbol then make one and put it into - // the symbol table... + // if the section containing this symbol doesnt have a symbol then make + // one and put it into the symbol table... // if (!scn_sym.has_value()) { auto scn_sym_name = @@ -153,6 +155,8 @@ std::optional decomp_t::decompose( scn->size_raw_data); } + // extract the relocations needed for this section... + // std::vector relocs; auto scn_relocs = reinterpret_cast( scn->ptr_relocs + reinterpret_cast(img)); @@ -167,6 +171,8 @@ std::optional decomp_t::decompose( sym_hash, sym_name.data())); } + // create a new section symbol... + // decomp::symbol_t new_scn_sym(img, scn_sym_name, 0, scn_data, scn, {}, relocs, sym_type_t::section);