2010-05-31 00:21:08 +00:00
|
|
|
class CCodeBlock :
|
|
|
|
private CRecompilerOps
|
2010-05-30 01:54:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-09-25 05:58:06 +00:00
|
|
|
CCodeBlock(DWORD VAddrEnter, BYTE * RecompPos );
|
2010-05-30 01:54:42 +00:00
|
|
|
|
|
|
|
bool Compile ( void );
|
|
|
|
|
|
|
|
inline DWORD VAddrEnter ( void ) const { return m_VAddrEnter; }
|
|
|
|
inline DWORD VAddrFirst ( void ) const { return m_VAddrFirst; }
|
|
|
|
inline DWORD VAddrLast ( void ) const { return m_VAddrLast; }
|
|
|
|
inline BYTE * CompiledLocation ( void ) const { return m_CompiledLocation; }
|
|
|
|
inline int NoOfSections ( void ) const { return m_NoOfSections; }
|
|
|
|
inline const CCodeSection & EnterSection ( void ) const { return m_EnterSection; }
|
2010-06-16 07:31:47 +00:00
|
|
|
inline const MD5Digest & Hash ( void ) const { return m_Hash; }
|
2010-05-30 01:54:42 +00:00
|
|
|
|
|
|
|
inline void SetVAddrFirst ( DWORD VAddr ) { m_VAddrFirst = VAddr; }
|
|
|
|
inline void SetVAddrLast ( DWORD VAddr ) { m_VAddrLast = VAddr; }
|
|
|
|
|
2010-07-23 10:45:35 +00:00
|
|
|
inline void IncSectionCount ( void ) { m_NoOfSections += 1; }
|
|
|
|
|
|
|
|
CCodeSection * ExistingSection ( DWORD Addr ) { return m_EnterSection.ExistingSection(Addr,NextTest()); }
|
2010-10-23 18:53:01 +00:00
|
|
|
bool SectionAccessible ( DWORD m_SectionID ) { return m_EnterSection.SectionAccessible(m_SectionID,NextTest()); }
|
2010-07-23 10:45:35 +00:00
|
|
|
|
2012-09-24 22:07:51 +00:00
|
|
|
inline QWORD MemContents(int i) const { return m_MemContents[i]; }
|
|
|
|
inline QWORD * MemLocation(int i) const { return m_MemLocation[i]; }
|
|
|
|
|
2010-05-30 01:54:42 +00:00
|
|
|
EXIT_LIST m_ExitInfo;
|
2010-10-23 18:53:01 +00:00
|
|
|
DWORD NextTest ( void );
|
2010-05-30 01:54:42 +00:00
|
|
|
|
|
|
|
private:
|
2010-07-23 10:45:35 +00:00
|
|
|
bool AnalyseBlock ( void );
|
2010-06-04 06:25:07 +00:00
|
|
|
void CompileExitCode ( void );
|
2010-05-30 01:54:42 +00:00
|
|
|
|
|
|
|
DWORD m_VAddrEnter;
|
|
|
|
DWORD m_VAddrFirst; // the address of the first opcode in the block
|
|
|
|
DWORD m_VAddrLast; // the address of the first opcode in the block
|
|
|
|
BYTE * m_CompiledLocation; // What address is this compiled at
|
|
|
|
int m_NoOfSections; // The number of sections this block uses
|
2010-06-07 02:23:58 +00:00
|
|
|
CCodeSection m_EnterSection;
|
2010-10-23 18:53:01 +00:00
|
|
|
DWORD m_Test;
|
2010-06-16 07:31:47 +00:00
|
|
|
MD5Digest m_Hash;
|
2012-09-24 22:07:51 +00:00
|
|
|
QWORD m_MemContents[2];
|
|
|
|
QWORD * m_MemLocation[2];
|
2010-05-30 01:54:42 +00:00
|
|
|
};
|