-
-
Notifications
You must be signed in to change notification settings - Fork 100
/
arch.go
57 lines (53 loc) · 946 Bytes
/
arch.go
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
package cfg
/*
import (
cs "github.com/bnagy/gapstone"
"github.com/lunixbochs/usercorn/go/models"
)
type archConfig struct {
CondJmps []int
Jmps []int
Call int
Ret int
}
func ArchConfig(u models.Usercorn) *archConfig {
switch u.Arch().Radare {
case "x86", "x86_64":
condJmps := []int{
cs.X86_INS_JA,
cs.X86_INS_JAE,
cs.X86_INS_JB,
cs.X86_INS_JBE,
cs.X86_INS_JCXZ,
cs.X86_INS_JE,
cs.X86_INS_JECXZ,
cs.X86_INS_JG,
cs.X86_INS_JGE,
cs.X86_INS_JL,
cs.X86_INS_JLE,
cs.X86_INS_JNE,
cs.X86_INS_JNO,
cs.X86_INS_JNP,
cs.X86_INS_JNS,
cs.X86_INS_JO,
cs.X86_INS_JP,
cs.X86_INS_JRCXZ,
cs.X86_INS_JS,
}
jmps := []int{
cs.X86_INS_JMP,
cs.X86_INS_LOOP,
cs.X86_INS_LOOPE,
cs.X86_INS_LOOPNE,
}
return &archConfig{
CondJmps: condJmps,
Jmps: jmps,
Call: cs.X86_INS_CALL,
Ret: cs.X86_INS_RET,
}
default:
panic("unknown arch")
}
}
*/