aboutsummaryrefslogtreecommitdiff
path: root/test/long_mode/mod.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-08-14 00:44:09 -0700
committeriximeow <me@iximeow.net>2021-08-14 00:48:02 -0700
commit9bc4eca4b8269cb8e0898dfe05c3ed4059cf4fd5 (patch)
tree4c2cb8bdf632ea80fc09fc3f3526ce1a80559775 /test/long_mode/mod.rs
parentcf63d91ac22230ff5e97928f5bd319746fc49590 (diff)
relative branches should be shown as $+offset, not just plain offset
while x86 branches of immediates are all relative to PC, other architectures may have absolute branches to immediate addresses, leaving this syntax ambiguous and potentially confusing. yaxpeax prefers to write relative offsets `$+...` as a rule, so uphold that here.
Diffstat (limited to 'test/long_mode/mod.rs')
-rw-r--r--test/long_mode/mod.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index bfe21bd..61ea63d 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -1208,10 +1208,10 @@ fn test_prefixes() {
#[test]
fn test_control_flow() {
- test_display(&[0x73, 0x31], "jnb 0x31");
- test_display(&[0x72, 0x5a], "jb 0x5a");
- test_display(&[0x0f, 0x86, 0x8b, 0x01, 0x00, 0x00], "jna 0x18b");
- test_display(&[0x74, 0x47], "jz 0x47");
+ test_display(&[0x73, 0x31], "jnb $+0x31");
+ test_display(&[0x72, 0x5a], "jb $+0x5a");
+ test_display(&[0x0f, 0x86, 0x8b, 0x01, 0x00, 0x00], "jna $+0x18b");
+ test_display(&[0x74, 0x47], "jz $+0x47");
test_display(&[0xff, 0x15, 0x7e, 0x72, 0x24, 0x00], "call qword [rip + 0x24727e]");
test_display(&[0xff, 0x24, 0xcd, 0x70, 0xa0, 0xbc, 0x01], "jmp qword [rcx * 8 + 0x1bca070]");
test_display(&[0xff, 0xe0], "jmp rax");
@@ -1219,10 +1219,11 @@ fn test_control_flow() {
test_display(&[0x67, 0xff, 0xe0], "jmp rax");
test_invalid(&[0xff, 0xd8]);
test_display(&[0xff, 0x18], "callf mword [rax]");
- test_display(&[0xe0, 0x12], "loopnz 0x12");
- test_display(&[0xe1, 0x12], "loopz 0x12");
- test_display(&[0xe2, 0x12], "loop 0x12");
- test_display(&[0xe3, 0x12], "jrcxz 0x12");
+ test_display(&[0xe0, 0x12], "loopnz $+0x12");
+ test_display(&[0xe1, 0x12], "loopz $+0x12");
+ test_display(&[0xe2, 0x12], "loop $+0x12");
+ test_display(&[0xe3, 0x12], "jrcxz $+0x12");
+ test_display(&[0xe3, 0xf0], "jrcxz $+-0x10");
test_display(&[0xc3], "ret");
}