|
|
1.1 root 1: //
2: // nono
1.1.1.2 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
1.1.1.5 ! root 7: //
! 8: // 逆アセンブラ (共通部分)
! 9: //
1.1 root 10:
11: #pragma once
12:
13: #include "debugger_private.h"
14:
15: // 逆アセンブラ抽象クラス
16: class Disasm
17: {
18: public:
1.1.1.4 root 19: Disasm(DebuggerMemoryStream& mem_)
20: : mem(mem_)
21: {
1.1 root 22: }
1.1.1.4 root 23: virtual ~Disasm();
1.1 root 24:
1.1.1.4 root 25: // mem.laddr の位置を1命令逆アセンブルする。
1.1 root 26: // 成功すれば true、失敗すれば false を返す?
27: // 成功すれば text に出力文字列、ir に命令バイナリがセットされている。
1.1.1.4 root 28: virtual bool Exec() = 0;
1.1 root 29:
30: // 出力文字列(ダンプ)
31: std::string dump {};
32:
33: // 出力文字列(命令)
34: std::string text {};
35:
36: // この命令のバイナリ列
37: // (メモリイメージ順)
38: std::vector<uint8> bin {};
39:
40: protected:
1.1.1.4 root 41: // メモリアクセス。
42: DebuggerMemoryStream& mem;
1.1 root 43:
44: // 継承先の Exec() の先頭で呼び出してください。
45: void ExecInit() {
46: text.clear();
47: bin.clear();
48: }
49: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.