il2cpp

package module
v0.0.0-...-3972468 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2022 License: GPL-2.0 Imports: 4 Imported by: 1

README

A wrapper around il2cpp

Support Server (discord)

Quickstart

First of all, quite importantly, this wrapper makes some assumptions about your environment. It assumes that the current golang binary is a c-shared library
injected into a Unity process built using il2cpp. It also assumes that the initialization process has gone far enough for all assemblies to be loaded.

This wrapper updates as my GoMod project evolves, which you can get in the support server above.

Here is a simple example fetching some metadata about images/classes/methods/properties/fields

package main

import (
	"github.com/RinLovesYou/il2cpp"
	"fmt"
)

func init() {
	domain := il2cpp.GetDomain()
	domain.AttachThread()

	for _, image := range domain.GetImages() {
		utils.Log("Image: %s", image.GetName())

		for _, class := range image.GetClasses() {
			utils.Log("Class: %s", class.GetName())

			for _, method := range class.GetMethods() {
				utils.Log("Method: %s", method.GetName())
				utils.Log("ReturnType: %s", method.GetReturnType().GetName())
				for _, param := range method.GetParams() {
					utils.Log("Param: %s", param.GetName())
				}
			}

			for _, property := range class.GetProperties() {
				utils.Log("Property: %s", property.GetName())
				utils.Log("ReturnType: %s", property.GetGet().GetReturnType().GetName())
			}

			for _, field := range class.GetFields() {
				utils.Log("Field: %s", field.GetName())
			}

		}
	}
}

func main() {

}

You can compile this using go build --buildmode=c-shared -o GoMod.dll .

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assembly

type Assembly uintptr

func (Assembly) GetImage

func (a Assembly) GetImage() Image

func (Assembly) GetName

func (a Assembly) GetName() string

type BindingFlags

type BindingFlags int32
const (
	FIELD_STATIC BindingFlags = 16
)

type Class

type Class struct {
	// contains filtered or unexported fields
}

func (*Class) GetField

func (c *Class) GetField(name string) (Field, error)

func (*Class) GetFieldWhere

func (c *Class) GetFieldWhere(predicate func(Field) bool) (Field, error)

func (*Class) GetFields

func (c *Class) GetFields() []Field

func (*Class) GetFieldsWhere

func (c *Class) GetFieldsWhere(predicate func(Field) bool) []Field

func (*Class) GetFlags

func (c *Class) GetFlags() BindingFlags

func (*Class) GetMethod

func (c *Class) GetMethod(name string) (Method, error)

func (*Class) GetMethodWhere

func (c *Class) GetMethodWhere(predicate func(Method) bool) (Method, error)

func (*Class) GetMethods

func (c *Class) GetMethods() []Method

func (*Class) GetMethodsWhere

func (c *Class) GetMethodsWhere(predicate func(Method) bool) []Method

func (*Class) GetName

func (c *Class) GetName() string

func (*Class) GetNamespace

func (c *Class) GetNamespace() string

func (*Class) GetParent

func (c *Class) GetParent() Class

func (Class) GetProperties

func (c Class) GetProperties() []Property

func (*Class) GetPropertiesWhere

func (c *Class) GetPropertiesWhere(predicate func(Property) bool) []Property

func (*Class) GetProperty

func (c *Class) GetProperty(name string) (Property, error)

func (*Class) GetPropertyWhere

func (c *Class) GetPropertyWhere(predicate func(Property) bool) (Property, error)

func (*Class) HasField

func (c *Class) HasField(name string) bool

func (*Class) HasMethod

func (c *Class) HasMethod(name string) bool

func (*Class) HasProperty

func (c *Class) HasProperty(name string) bool

func (*Class) IsInterface

func (c *Class) IsInterface() bool

func (*Class) IsNull

func (c *Class) IsNull() bool

func (*Class) TypeObject

func (c *Class) TypeObject() *Object

type Domain

type Domain struct {
	// contains filtered or unexported fields
}

func GetDomain

func GetDomain() *Domain

func (*Domain) AttachThread

func (d *Domain) AttachThread()

func (*Domain) GetAssemblies

func (d *Domain) GetAssemblies() []Assembly

func (*Domain) GetImage

func (d *Domain) GetImage(name string) (Image, error)

func (*Domain) GetImageWhere

func (d *Domain) GetImageWhere(predicate func(Image) bool) (Image, error)

func (*Domain) GetImages

func (d *Domain) GetImages() []Image

func (*Domain) Name

func (d *Domain) Name() string

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (*Field) GetFlags

func (f *Field) GetFlags() BindingFlags

func (*Field) GetName

func (f *Field) GetName() string

func (*Field) GetValue

func (f *Field) GetValue() *Object

func (*Field) GetValueObject

func (f *Field) GetValueObject(o *Object) *Object

func (*Field) HasFlag

func (f *Field) HasFlag(flag BindingFlags) bool

type Image

type Image struct {
	// contains filtered or unexported fields
}

func (*Image) GetClass

func (i *Image) GetClass(name string) (Class, error)

func (*Image) GetClassCount

func (i *Image) GetClassCount() int

func (*Image) GetClassWhere

func (i *Image) GetClassWhere(predicate func(Class) bool) (Class, error)

func (*Image) GetClasses

func (i *Image) GetClasses() []Class

func (*Image) GetName

func (i *Image) GetName() string

func (*Image) GetNameExt

func (i *Image) GetNameExt() string

type Method

type Method struct {
	// contains filtered or unexported fields
}

func (*Method) GetName

func (m *Method) GetName() string

func (*Method) GetParams

func (m *Method) GetParams() []Type

func (*Method) GetReturnType

func (m *Method) GetReturnType() Type

func (*Method) Invoke

func (m *Method) Invoke(args ...uintptr) (*Object, error)

func (*Method) InvokeObject

func (m *Method) InvokeObject(obj *Object, args ...uintptr) (*Object, error)

func (*Method) IsNull

func (m *Method) IsNull() bool

func (*Method) Pointer

func (m *Method) Pointer() uintptr

type MethodFlags

type MethodFlags int32

type MethodImplFlags

type MethodImplFlags int32

type Object

type Object struct {
	Handle C.IppObject
	// contains filtered or unexported fields
}

func NewObject

func NewObject(handle unsafe.Pointer) *Object

func (*Object) Free

func (o *Object) Free()

func (*Object) IsNull

func (o *Object) IsNull() bool

func (*Object) Unbox

func (o *Object) Unbox() unsafe.Pointer

func (*Object) UnboxString

func (o *Object) UnboxString() string

type Property

type Property struct {
	// contains filtered or unexported fields
}

func (*Property) GetGet

func (p *Property) GetGet() *Method

func (*Property) GetName

func (p *Property) GetName() string

func (*Property) GetSet

func (p *Property) GetSet() *Method

type String

type String struct {
	Handle C.IppString
	// contains filtered or unexported fields
}

func NewString

func NewString(stringe string) *String

func (*String) Free

func (s *String) Free()

type Type

type Type struct {
	// contains filtered or unexported fields
}

func (Type) GetName

func (t Type) GetName() string

type Vector3

type Vector3 struct {
	// contains filtered or unexported fields
}

func NewVector3

func NewVector3(x, y, z float32) *Vector3

func Vector3FromPointer

func Vector3FromPointer(ptr unsafe.Pointer) *Vector3

func (*Vector3) Divide

func (v *Vector3) Divide(other *Vector3) *Vector3

func (*Vector3) Handle

func (v *Vector3) Handle() unsafe.Pointer

func (*Vector3) Minus

func (v *Vector3) Minus(other *Vector3) *Vector3

func (*Vector3) Plus

func (v *Vector3) Plus(other *Vector3) *Vector3

func (*Vector3) Times

func (v *Vector3) Times(other float32) *Vector3

func (*Vector3) X

func (v *Vector3) X() float32

func (*Vector3) Y

func (v *Vector3) Y() float32

func (*Vector3) Z

func (v *Vector3) Z() float32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL