-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathjump.asm
60 lines (48 loc) · 790 Bytes
/
jump.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
global _start
section .data
align 16
%include "header.inc"
mov eax, 0
mov ebx, 0
mov ecx, 0
mov edx, 0
mov esi, 0
mov edi, 0
; skip
jmp .target1
inc eax
.target1:
; conditional jump up
.target2:
inc ebx
inc ecx
cmp ebx, 2
jne .target2
; conditional jump down
.target3:
cmp ebx, 4
je .target4
inc ebx
inc edx
jmp .target3
.target4:
call .fun
call .not_returning_fun
.after_call:
jmp .after_fun
.fun:
inc esi
ret
.not_returning_fun:
inc esi
jmp .after_call
inc esi
ret
.after_fun:
push .target5
ret
.target5:
; clear stack (pushed eip is not the same between vm and gdb execution)
mov dword [esp], 0
mov dword [esp-4], 0
%include "footer.inc"