Skip to content

Commit 47aece0

Browse files
committed
update sample comments
1 parent 8f6d4d0 commit 47aece0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/sample.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fn place_input_cb<'a>(
88
input: &[u8],
99
_persistent_round: u64,
1010
) -> bool {
11+
// The mode we specified in the command line
1112
let do_x86_64 = uc.get_data().user_data;
1213
if do_x86_64 {
1314
let mut buf = [0; 8];
@@ -38,6 +39,7 @@ fn place_input_cb<'a>(
3839

3940
fn main() {
4041
let input_file = std::env::args().nth(1);
42+
// If we have a second arguments, solve 8 bytes magic intead, which is more difficult.
4143
let do_x86_64 = std::env::args().nth(2).is_some();
4244

4345
let mut uc = if do_x86_64 {
@@ -49,7 +51,7 @@ fn main() {
4951
};
5052

5153
let code = if do_x86_64 {
52-
// 8 bytes
54+
// 8 bytes magic
5355
// ks.asm("mov rax, rdx; cmp rax, 0x114514; je die; xor rax, rax; die: mov rax, [rax]; xor rax, rax")
5456
b"\x48\x89\xd0\x48\x3d\x14\x45\x11\x00\x74\x03\x48\x31\xc0\x48\x8b\x00\x48\x31\xc0".to_vec()
5557
} else {

0 commit comments

Comments
 (0)