github.com/pkujhd/goloader@v0.0.0-20240411034752-1a28096bd7bd/const.go (about)

     1  package goloader
     2  
     3  import (
     4  	"unsafe"
     5  )
     6  
     7  // size
     8  const (
     9  	PtrSize            = 4 << (^uintptr(0) >> 63)
    10  	Uint32Size         = int(unsafe.Sizeof(uint32(0)))
    11  	IntSize            = int(unsafe.Sizeof(int(0)))
    12  	UInt64Size         = int(unsafe.Sizeof(uint64(0)))
    13  	_FuncSize          = int(unsafe.Offsetof(_func{}.Nfuncdata)) + int(unsafe.Sizeof(_func{}.Nfuncdata))
    14  	FindFuncBucketSize = int(unsafe.Sizeof(findfuncbucket{}))
    15  	PCHeaderSize       = int(unsafe.Sizeof(pcHeader{}))
    16  	_typeSize          = int(unsafe.Sizeof(_type{}))
    17  	funcTypeSize       = int(unsafe.Sizeof(funcType{}))
    18  	uncommonTypeSize   = int(unsafe.Sizeof(uncommonType{}))
    19  	InvalidHandleValue = ^uintptr(0)
    20  	InvalidOffset      = int(-1)
    21  	PageSize           = 1 << 12 //4096
    22  )
    23  
    24  const (
    25  	EmptyString    = ""
    26  	DefaultPkgPath = "main"
    27  	ZeroByte       = byte(0x00)
    28  )
    29  
    30  // runtime symbol
    31  const (
    32  	RuntimeDeferReturn = "runtime.deferreturn"
    33  )
    34  
    35  // string match prefix/suffix
    36  const (
    37  	FileSymPrefix  = "gofile.."
    38  	MainPkgPrefix  = "main."
    39  	OsStdout       = "os.Stdout"
    40  	GOTPCRELSuffix = "·f"
    41  )