about summary refs log tree commit diff
path: root/src/disassemble.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/disassemble.cpp')
-rw-r--r--src/disassemble.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/disassemble.cpp b/src/disassemble.cpp
new file mode 100644
index 0000000..2a6d6c7
--- /dev/null
+++ b/src/disassemble.cpp
@@ -0,0 +1,9 @@
+#include "include/disassemble.hpp"
+
+int Disasm::disassemble(const uint8_t* buffer, uint32_t pos, uint32_t offset)
+{
+    Instruction* instr = new Instruction(&((uint8_t*)buffer)[pos + offset], offset, pos);
+    printf("<0x%x:0x%x> - %s - %02x - %s - %d\n", instr->offset, instr->pos, instr->bits, instr->hex, instr->string.c_str(), instr->type);
+
+    return sizeof(uint8_t) * 4;
+}