From e5dd47b5dd6293c06cb3fbb1757aef4ca3cc966e Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 26 Aug 2024 15:03:39 +0200 Subject: [PATCH] Added more tests --- src/x64/x64_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/x64/x64_test.go b/src/x64/x64_test.go index 23f61ef..8216f1a 100644 --- a/src/x64/x64_test.go +++ b/src/x64/x64_test.go @@ -8,10 +8,12 @@ import ( ) func TestX64(t *testing.T) { - assert.DeepEqual(t, x64.Call(nil, 1), []byte{0xe8, 0x01, 0x00, 0x00, 0x00}) - assert.DeepEqual(t, x64.MoveRegisterNumber(nil, 0, 1), []byte{0xb8, 0x01, 0x00, 0x00, 0x00}) - assert.DeepEqual(t, x64.MoveRegisterNumber(nil, 1, 1), []byte{0xb9, 0x01, 0x00, 0x00, 0x00}) - assert.DeepEqual(t, x64.Return(nil), []byte{0xc3}) - assert.DeepEqual(t, x64.Syscall(nil), []byte{0x0f, 0x05}) + assert.DeepEqual(t, x64.AlignStack(nil), []byte{0x48, 0x83, 0xE4, 0xF0}) + assert.DeepEqual(t, x64.Call(nil, 1), []byte{0xE8, 0x01, 0x00, 0x00, 0x00}) + assert.DeepEqual(t, x64.CallAtAddress(nil, 1), []byte{0xFF, 0x15, 0x01, 0x00, 0x00, 0x00}) assert.DeepEqual(t, x64.ExtendRAXToRDX(nil), []byte{0x48, 0x99}) + assert.DeepEqual(t, x64.MoveRegisterNumber(nil, 0, 1), []byte{0xB8, 0x01, 0x00, 0x00, 0x00}) + assert.DeepEqual(t, x64.MoveRegisterNumber(nil, 1, 1), []byte{0xB9, 0x01, 0x00, 0x00, 0x00}) + assert.DeepEqual(t, x64.Return(nil), []byte{0xC3}) + assert.DeepEqual(t, x64.Syscall(nil), []byte{0x0F, 0x05}) }