From 8d91b47d000656e4a637bf2e4023dd16ad52a159 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Wed, 14 Oct 2020 14:21:47 -0400 Subject: [PATCH] Print strings in assembly (#81) * print strings in disasm * format --- decompiler/ObjectFile/LinkedObjectFile.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/decompiler/ObjectFile/LinkedObjectFile.cpp b/decompiler/ObjectFile/LinkedObjectFile.cpp index 58e86acc15..92f671970f 100644 --- a/decompiler/ObjectFile/LinkedObjectFile.cpp +++ b/decompiler/ObjectFile/LinkedObjectFile.cpp @@ -561,6 +561,14 @@ std::string LinkedObjectFile::print_disassembly() { line.append(40 - line.length(), ' '); } line += ";; " + func.get_basic_op_at_instr(i)->print(*this); + for (int iidx = 0; iidx < instr.n_src; iidx++) { + if (instr.get_src(iidx).is_label()) { + auto lab = labels.at(instr.get_src(iidx).get_label()); + if (is_string(lab.target_segment, lab.offset)) { + line += " " + get_goal_string(lab.target_segment, lab.offset / 4 - 1); + } + } + } } result += line + "\n"; }