mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 11:34:53 +08:00
[0.0 -> 0.1 ] integrated : disasm.h
git-svn-id: https://pykd.svn.codeplex.com/svn@70758 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
b7737870e5
commit
0c12f39ea7
62
pykd/disasm.h
Normal file
62
pykd/disasm.h
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "dbgmem.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class disasm {
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
disasm( ULONG64 offset = 0);
|
||||||
|
|
||||||
|
std::string disassemble() {
|
||||||
|
std::string s = m_disasm;
|
||||||
|
m_currentOffset += m_length;
|
||||||
|
doDisasm();
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string reset() {
|
||||||
|
|
||||||
|
m_currentOffset = m_beginOffset;
|
||||||
|
doDisasm();
|
||||||
|
return m_disasm;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
assembly( const std::string &instr );
|
||||||
|
|
||||||
|
std::string instruction() const {
|
||||||
|
return m_disasm;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG64 begin() const {
|
||||||
|
return m_beginOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG64 current() const {
|
||||||
|
return m_currentOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG length() const {
|
||||||
|
return m_length;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG64 ea() const {
|
||||||
|
return m_ea;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void doDisasm();
|
||||||
|
|
||||||
|
ULONG64 m_beginOffset;
|
||||||
|
ULONG64 m_currentOffset;
|
||||||
|
ULONG64 m_ea;
|
||||||
|
ULONG m_length;
|
||||||
|
|
||||||
|
std::string m_disasm;
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
Loading…
Reference in New Issue
Block a user