Is it possible to add detection of binary translation at runtime to the debugger? #5722
Replies: 4 comments 4 replies
-
@nogitsune-youkai I think we need a little clarification.... Are you asking:
|
Beta Was this translation helpful? Give feedback.
-
OK, gotcha. In my experience, there are essentially two approaches - neither one of them push-button in any sense. The first is to find the loop that's responsible for the translation, trap on its execution, then follow where the data leads. Identifying the loop can be done either purely statically or dynamically, i.e. even sampling execution on a program doing large amounts of binary translation is likely to land in the loop more often than not. Needless to say, this is not a generic solution - it requires analysis of the binary-translation engine you're interested in. The second approach is a little more direct but requires a debugger capable of watching changes in page permissions. In broad strokes, you're looking for memory marked writable and then executable. This can be done in "normal" debuggers by hooking the relevant syscall APIs. In virtualized environments or emulators, you may be able to leverage various aspects of the system hardware to trap on those events (assuming the environment itself is not using them for other purposes. The PEBS/BTS facilities on Intel processors are one example. |
Beta Was this translation helpful? Give feedback.
-
Yep, 3B especially Chapters 20, 25 and following. |
Beta Was this translation helpful? Give feedback.
-
If someone have any other thoughts - please respond |
Beta Was this translation helpful? Give feedback.
-
Is it technically possible?
Beta Was this translation helpful? Give feedback.
All reactions