From 28008a746a31abb7909dd86cb0cd413ac8943b0b Mon Sep 17 00:00:00 2001 From: jmpoep Date: Thu, 7 Dec 2023 16:51:07 +0800 Subject: first commit --- utils/x86disasm/main.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 utils/x86disasm/main.cc (limited to 'utils/x86disasm/main.cc') diff --git a/utils/x86disasm/main.cc b/utils/x86disasm/main.cc new file mode 100644 index 0000000..e0d43af --- /dev/null +++ b/utils/x86disasm/main.cc @@ -0,0 +1,24 @@ +#include +#include "disasm.h" + +int main(int argc, char **argv) +{ + int rc; + bool x64; + std::cout << "x86 Disassembly Generator (C) 2012\n"; + if (argc < 2) { + std::cerr << "Usage: " << argv[0] << " [x64]\n"; + return 1; + } + if (argc >= 3) { + x64 = (0 == _strnicmp(argv[2], "x64", 3)); + } else { + x64 = false; + } + rc = GenerateInstructions(argv[1], x64); + if (rc == GEN_INSN_OKAY) + std::cout << "Finished\n"; + else + std::cerr << "ERROR Failed with error " << rc << "\n"; + return rc; +} -- cgit v1.2.3