|
|
@ -82,7 +82,17 @@ class pass_t {
|
|
|
|
/// allows you to manipulate symbols in a generic manner.
|
|
|
|
/// allows you to manipulate symbols in a generic manner.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="sym">a symbol of the same type of m_sym_type.</param>
|
|
|
|
/// <param name="sym">a symbol of the same type of m_sym_type.</param>
|
|
|
|
virtual void pre_recomp_pass(decomp::symbol_t* sym) = 0;
|
|
|
|
virtual void generic_pass(decomp::symbol_t* sym) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// This virtual method is invoked prior to calling the "copier". This allows
|
|
|
|
|
|
|
|
/// you to manipulate the symbol prior to it being copied into memory.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="sym">Symbol being copied into memory.</param>
|
|
|
|
|
|
|
|
/// <param name="copier">copier lambda that the pass can use. if it does, then
|
|
|
|
|
|
|
|
/// you must return true.</param> <returns>returns true if the copy was done
|
|
|
|
|
|
|
|
/// by the pass. false if copying still needs to be done.</returns>
|
|
|
|
|
|
|
|
virtual bool copier_pass(decomp::symbol_t* sym, copier_t& copier) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// This virtual method is invoked prior to calling the "allocator". This
|
|
|
|
/// This virtual method is invoked prior to calling the "allocator". This
|
|
|
@ -100,16 +110,6 @@ class pass_t {
|
|
|
|
std::uint32_t size,
|
|
|
|
std::uint32_t size,
|
|
|
|
allocator_t& allocator) = 0;
|
|
|
|
allocator_t& allocator) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// This virtual method is invoked prior to calling the "copier". This allows
|
|
|
|
|
|
|
|
/// you to manipulate the symbol prior to it being copied into memory.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="sym">Symbol being copied into memory.</param>
|
|
|
|
|
|
|
|
/// <param name="copier">copier lambda that the pass can use. if it does, then
|
|
|
|
|
|
|
|
/// you must return true.</param> <returns>returns true if the copy was done
|
|
|
|
|
|
|
|
/// by the pass. false if copying still needs to be done.</returns>
|
|
|
|
|
|
|
|
virtual bool copier_pass(decomp::symbol_t* sym, copier_t& copier) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// This virtual method is invoked before the call to the "resolver". This
|
|
|
|
/// This virtual method is invoked before the call to the "resolver". This
|
|
|
|
/// allows you the manipulate the relocation address and symbol before
|
|
|
|
/// allows you the manipulate the relocation address and symbol before
|
|
|
@ -134,4 +134,29 @@ class pass_t {
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
decomp::sym_type_t m_sym_type;
|
|
|
|
decomp::sym_type_t m_sym_type;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// generic pass class overloads non-generic pass methods to return default
|
|
|
|
|
|
|
|
/// values... this makes it so generic passes dont need to overload all of these
|
|
|
|
|
|
|
|
/// methods and return default values every single time...
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
class generic_pass_t : public pass_t {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
explicit generic_pass_t(decomp::sym_type_t sym_type) : pass_t(sym_type) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// default non-generic passes to return generic values...
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
bool copier_pass(decomp::symbol_t* sym, copier_t& copier) { return false; }
|
|
|
|
|
|
|
|
std::optional<std::uintptr_t> allocation_pass(decomp::symbol_t* sym,
|
|
|
|
|
|
|
|
std::uint32_t size,
|
|
|
|
|
|
|
|
allocator_t& allocator) {
|
|
|
|
|
|
|
|
return {};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::optional<std::uintptr_t> resolver_pass(decomp::symbol_t* sym,
|
|
|
|
|
|
|
|
recomp::reloc_t* reloc,
|
|
|
|
|
|
|
|
std::uintptr_t allocated_t) {
|
|
|
|
|
|
|
|
return {};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
} // namespace theo::obf
|
|
|
|
} // namespace theo::obf
|