forked from pkujhd/goloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.go
50 lines (44 loc) · 1.21 KB
/
const.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
package goloader
import (
"unsafe"
)
// size
const (
PtrSize = 4 << (^uintptr(0) >> 63)
Uint32Size = int(unsafe.Sizeof(uint32(0)))
IntSize = int(unsafe.Sizeof(int(0)))
UInt64Size = int(unsafe.Sizeof(uint64(0)))
_FuncSize = int(unsafe.Offsetof(_func{}.nfuncdata)) + int(unsafe.Sizeof(_func{}.nfuncdata))
ItabSize = int(unsafe.Sizeof(itab{}))
FindFuncBucketSize = int(unsafe.Sizeof(findfuncbucket{}))
InlinedCallSize = int(unsafe.Sizeof(inlinedCall{}))
InvalidHandleValue = ^uintptr(0)
InvalidOffset = int(-1)
InvalidIndex = uint32(0xFFFFFFFF)
PageSize = 1 << 12 //4096
)
const (
EmptyString = ""
DefaultPkgPath = "main"
EmptyPkgPath = `""`
ZeroByte = byte(0x00)
)
const (
TLSNAME = "(TLS)"
)
// runtime symbol
const (
RuntimeDeferReturn = "runtime.deferreturn"
)
// string match prefix/suffix
const (
FileSymPrefix = "gofile.."
MainPkgPrefix = "main."
TypeImportPathPrefix = "type..importpath."
TypeDoubleDotPrefix = "type.."
TypePrefix = "type."
ItabPrefix = "go.itab."
StkobjSuffix = ".stkobj"
InlineTreeSuffix = ".inlinetree"
OsStdout = "os.Stdout"
)