From 4839c809899736850ede5d1de76d5bbeaf092a72 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Mon, 21 Oct 2024 23:02:33 +0200 Subject: [PATCH] fix: article --- pages/reversing_guardianrs1.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reversing_guardianrs1.html b/pages/reversing_guardianrs1.html index 523bf0c..50eb149 100644 --- a/pages/reversing_guardianrs1.html +++ b/pages/reversing_guardianrs1.html @@ -47,7 +47,7 @@

Writing a bytecode disassembler

-

At this stage, we'd have to reverse engineer the VMDispatcher to understand how the bytecode is encoded but I instead decided to cheat and look at the source code of the virtualizer (lol).

The bytecode follows this simple format :

Mnemonic (1 byte)Size of the data (1 byte) Argument (1 byte or more)
0x16 (Vmctx)0x08 (Qword)None
0x00 (Const)0x08 (Qword)0x20 (Rdx)

Following this example, we can retrieve the first instructions of our function !

Using this simple logic and by looking at the existing code of Guardian-rs I could write a disassembler (code here ).

It gave me the following code :

+

At this stage, we'd have to reverse engineer the VMDispatcher to understand how the bytecode is encoded but I instead decided to cheat and look at the source code of the virtualizer (lol).

The bytecode follows this simple format :

Mnemonic (1 byte)Size of the data (1 byte) Argument (1 byte or more)
0x16 (Vmctx)0x08 (Qword)None
0x00 (Const)0x08 (Qword)0x20 (Rdx)

Following this example, we can retrieve the first instructions of our function !

Using this simple logic and by looking at the existing code of Guardian-rs I could write a disassembler (code here ).

It gave me the following code (only showing a sample because it's long) :