forked from Lephenixnoir/fxos
Lephenixnoir
d5c5fa6aeb
New features: * The syscall pass now resolves syscalls for the input target, provided that an OS is mapped on the ROM region. * Formalized the variations of print's arguments as a sequence (tree, to be precise) of /promotions/. * Added a short notion of Symbol and SymbolTable, and a loader for them. Data files of type "symbol" are read as such and provide name to syscalls or arbitrary addresses. Code changes: * The disassembly operation of the command-line interface is now finally in its own file with more room. * Encoded the tree structure of promotions as a sequence of (mainly tail-calling) inter-calling methods in the print pass.
32 lines
730 B
C++
32 lines
730 B
C++
//---
|
|
// fxos.disasm-passes.syscall: Detection and substitution of syscall addresses
|
|
//
|
|
// This passes looks for insruction arguments that evaluate to syscall
|
|
// addresses, and substitutes to that the syscall number and (hopefully) the
|
|
// syscall name will be shown by the print pass if it's available in the
|
|
// documentation.
|
|
//---
|
|
|
|
#ifndef FXOS_DISASM_PASSES_SYSCALL_H
|
|
#define FXOS_DISASM_PASSES_SYSCALL_H
|
|
|
|
#include <fxos/disassembly.h>
|
|
#include <fxos/os.h>
|
|
|
|
namespace FxOS {
|
|
|
|
class SyscallPass: public DisassemblyPass
|
|
{
|
|
public:
|
|
SyscallPass(Disassembly &disasm, OS *os);
|
|
|
|
void analyze(uint32_t pc, ConcreteInstruction &inst) override;
|
|
|
|
private:
|
|
OS *m_os;
|
|
};
|
|
|
|
} /* namespace FxOS */
|
|
|
|
#endif /* FXOS_DISASM_PASSES_SYSCALL_H */
|