mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Collapse sequences of "int3" (padding after block linking) in x86 disassembly.
This commit is contained in:
parent
5888b3bdc4
commit
db853d8513
1 changed files with 16 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "JitCommon.h"
|
#include "JitCommon.h"
|
||||||
|
#include "Common/StringUtils.h"
|
||||||
|
|
||||||
#include "ext/disarm.h"
|
#include "ext/disarm.h"
|
||||||
#include "ext/udis86/udis86.h"
|
#include "ext/udis86/udis86.h"
|
||||||
|
@ -72,8 +73,22 @@ std::vector<std::string> DisassembleX86(const u8 *data, int size) {
|
||||||
ud_set_syntax(&ud_obj, UD_SYN_INTEL);
|
ud_set_syntax(&ud_obj, UD_SYN_INTEL);
|
||||||
|
|
||||||
ud_set_input_buffer(&ud_obj, data, size);
|
ud_set_input_buffer(&ud_obj, data, size);
|
||||||
|
|
||||||
|
int int3_count = 0;
|
||||||
while (ud_disassemble(&ud_obj) != 0) {
|
while (ud_disassemble(&ud_obj) != 0) {
|
||||||
lines.push_back(ud_insn_asm(&ud_obj));
|
std::string str = ud_insn_asm(&ud_obj);
|
||||||
|
if (str == "int3") {
|
||||||
|
int3_count++;
|
||||||
|
} else {
|
||||||
|
if (int3_count) {
|
||||||
|
lines.push_back(StringFromFormat("int3 (x%i)", int3_count));
|
||||||
|
int3_count = 0;
|
||||||
|
}
|
||||||
|
lines.push_back(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (int3_count) {
|
||||||
|
lines.push_back(StringFromFormat("int3 (x%i)", int3_count));
|
||||||
}
|
}
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue