From 51ab94a29f64de42e3dec3a3ef0ec6a94cda28a6 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sat, 1 Sep 2018 12:10:13 +0200 Subject: working on new syscalls --- asm/task.s | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'asm/task.s') diff --git a/asm/task.s b/asm/task.s index e6c1bc4..4322da5 100644 --- a/asm/task.s +++ b/asm/task.s @@ -6,6 +6,8 @@ task_pusha: push $0x8 // code segment push $userfunc + push $0x666 + pusha push %ds @@ -17,13 +19,15 @@ task_pusha: now stack looks like: - param // esp+64 + param // esp+68 returnaddy eflags code segment userfunc + 0x666 + eax // rest by popa ecx edx @@ -40,7 +44,7 @@ task_pusha: */ - mov 64(%esp),%eax // get address of alternative stack where we want to simulate the pusha + mov 68(%esp),%eax // get address of alternative stack where we want to simulate the pusha mov (%esp),%ecx mov %ecx,(%eax) @@ -87,6 +91,9 @@ task_pusha: mov 56(%esp),%ecx mov %ecx,56(%eax) + mov 60(%esp),%ecx + mov %ecx,60(%eax) + pop %gs pop %fs pop %es @@ -97,5 +104,6 @@ task_pusha: pop %eax pop %eax pop %eax + pop %eax ret -- cgit v1.2.3