Skip to content

Commit 50f3b13

Browse files
committed
shellcode: kernel wrapper: fix dirty x2 x3.
dirty x2 and x3 will cause bug check in linux kernel.
1 parent 736586b commit 50f3b13

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ShellCode/ShellCode.KernelWrapper.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ _ShellCodeStart:
4747

4848
// Copy Sub program, X4 is src, X5 is dst, X6 is size
4949
_CopyLoop:
50-
ldp x2, x3, [x4], #0x10 // Save value at [x4](pointer) to x2 and x3, then x4 add 16.
51-
stp x2, x3, [x5], #0x10 // Save value in x2 and x3 to [x5](pointer), then x5 add 16
50+
ldp x7, x8, [x4], #0x10 // Save value at [x4](pointer) to x7 and x8, then x4 add 16.
51+
stp x7, x8, [x5], #0x10 // Save value in x7 and x8 to [x5](pointer), then x5 add 16
5252
subs x6, x6, #0x10 // x6 - 16, if , set CPSR register to 0.
5353
b.ne _CopyLoop // Check CPSR, if CPSR != 0, jump back to _CopyLoop.
5454
ret // Return when finish.

0 commit comments

Comments
 (0)