-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtarget_fn.S
More file actions
49 lines (44 loc) · 699 Bytes
/
target_fn.S
File metadata and controls
49 lines (44 loc) · 699 Bytes
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
//#include "consts.h"
.section .targetfn, "ax"
.global target_fn
.global end_target_fn
.type target_fn, @function
target_fn:
push %rbx
movabs $probe_buf, %rbx
mov (%rbx), %rbx
movabs $cur_probe_space, %rcx
mov (%rcx), %rcx
movabs $signal_idx, %rax
mov (%rax), %rax
//add %rax, %rax
imul $3, %rax
and $0xff, %rax
mul %rcx /* rax *= cur_probe_space */
add %rax, %rbx
movb (%rbx),%al
end_target_fn:
pop %rbx
ret
/*
mov signal_ptr, %rcx
mov (%rcx), %al
retq
*/
/*
// works
push %rbp
mov %rsp,%rbp
push %rbx
push %rcx
push %rdx
mov $signal_ptr,%edx
mov %edx,%ecx
mov (%rcx),%rbx
mov (%rbx),%al
pop %rdx
pop %rcx
pop %rbx
pop %rbp
retq
*/