1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-05 08:37:20 +02:00
openrw/rwengine/include/script/ScriptDisassembly.hpp
2015-05-03 18:09:25 +01:00

45 lines
814 B
C++

#pragma once
#ifndef _SCRIPTDISASSEMBLY_HPP_
#define _SCRIPTDISASSEMBLY_HPP_
#include <script/ScriptTypes.hpp>
class SCMFile;
/**
* Extracts instruction level information from a SCM file
*/
class ScriptDisassembly
{
public:
/**
* Information about a single call to a single opcode and
* it's parameters
*/
struct InstructionInfo
{
SCMOpcode opcode;
SCMParams parameters;
};
ScriptDisassembly(SCMOpcodes* codes, SCMFile* scm);
/**
* Execute the disassembly routine.
*
* If there is an error during disassembly, an exeption will be
* thrown
*/
void disassemble(SCMAddress startAddress);
std::map<SCMAddress, InstructionInfo>& getInstructions() { return instructions; }
private:
SCMOpcodes* codes;
SCMFile* scm;
std::map<SCMAddress, InstructionInfo> instructions;
};
#endif