Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeExportProperties(rawData []byte, summary *FileSummary, includeTags, includeSemantic bool) map[int]ExportProperties
- func FindExtraPropertyTags(data []byte, names []string, serialOffset, serialSize int, ...) map[string]PropertyTag
- func FindInt32ArrayByName(data []byte, names []string, start, end int, propName string) []int
- func FindIntPropertyByName(data []byte, names []string, start, end int, propName string) (int, bool)
- func FindStructArrayItemStarts(data []byte, names []string, start, end int, propName string) (int, int, int)
- func HasStructSignature(data []byte, names []string, payloadOffset, payloadSize int) bool
- func ParsePropertyCollection(data []byte, names []string, startOffset, maxSize int) (map[string]ParsedProperty, int)
- func ParsePropertyHeader(data []byte, names []string, cursor, end int) (string, string, int, int, int, int)
- func ParseStructArrayItemsAsPropertyCollections(data []byte, names []string, payloadOffset, payloadSize, count int) []map[string]ParsedProperty
- func ReadArrayPropertyCount(data []byte, tag PropertyTag) int
- func ReadArrayPropertyI32Rows(data []byte, tag PropertyTag, itemWidth int) [][]int
- func ReadArrayPropertyI32Values(data []byte, tag PropertyTag) []int
- func ReadArrayPropertyObjectValues(data []byte, tag PropertyTag) []int
- func ReadArrayPropertyPayloadInfo(data []byte, tag PropertyTag) (int, int, int)
- func ReadArrayPropertyPayloadInfoWithStructMeta(data []byte, names []string, tag PropertyTag) (int, int, int)
- func ReadArrayPropertyStructHeadI32(data []byte, tag PropertyTag, headI32 int) [][]int
- func ReadArrayPropertyStructI32Matrix(data []byte, tag PropertyTag) [][]int
- func ReadObjectPropertyValue(data []byte, tag PropertyTag) int
- func ReadRawI32(data []byte, offset int) int
- func ResolveName(data []byte, offset int, names []string) string
- type ArrayLayoutInfo
- type ContainerHit
- type Export
- type ExportDetail
- type ExportProperties
- type FileSummary
- func ReadFile(path string) (*FileSummary, error)
- func ReadFileExports(path string, predicate func(Export) bool) (*FileSummary, map[int][]byte, error)
- func ReadFileFromBytes(data []byte, path string) (*FileSummary, error)
- func ReadFileFromBytesAndExports(data []byte, path string, predicate func(Export) bool) (*FileSummary, map[int][]byte, error)
- func ReadFileHeaderOnly(path string) (*FileSummary, error)
- func ReadFileRaw(path string) ([]byte, *FileSummary, error)
- func ReadFileRawFromBytes(data []byte, path string) ([]byte, *FileSummary, error)
- type GameProfile
- type Header
- type Import
- type ParsedProperty
- type PropertyTag
Constants ¶
View Source
const ChunkBlockHeaderSize = 8
View Source
const ChunkHeaderMagic = 0x9E2A83C1
View Source
const ChunkHeaderSize = 16
View Source
const CompressedFlag = 0x02000000
View Source
const CompressionLZO = 0x2
View Source
const MaxBlockSizeOT = 0x20000
View Source
const PackageMagic = 0x9E2A83C1
Variables ¶
View Source
var PropertyTypeNames = map[string]bool{ "ArrayProperty": true, "BoolProperty": true, "ByteProperty": true, "ClassProperty": true, "ComponentProperty": true, "DelegateProperty": true, "FloatProperty": true, "InterfaceProperty": true, "IntProperty": true, "MapProperty": true, "NameProperty": true, "ObjectProperty": true, "StrProperty": true, "StringRefProperty": true, "StructProperty": true, }
Functions ¶
func ComputeExportProperties ¶
func ComputeExportProperties(rawData []byte, summary *FileSummary, includeTags, includeSemantic bool) map[int]ExportProperties
func FindExtraPropertyTags ¶
func FindInt32ArrayByName ¶
FindInt32ArrayByName scans raw bytes in range [start, end) for an ArrayProperty<IntProperty> with the given property name. Returns the int32 element values.
func FindIntPropertyByName ¶
func FindIntPropertyByName(data []byte, names []string, start, end int, propName string) (int, bool)
FindIntPropertyByName scans raw bytes in range [start, end) for a scalar int-like property with the given name and returns its value.
func FindStructArrayItemStarts ¶
func FindStructArrayItemStarts(data []byte, names []string, start, end int, propName string) (int, int, int)
FindStructArrayItemStarts scans raw bytes for an ArrayProperty<StructProperty> and returns the absolute payload start, item count, and stride hint. Returns (-1, 0, 0) if not found.
func HasStructSignature ¶
func ParsePropertyCollection ¶
func ParsePropertyHeader ¶
func ParseStructArrayItemsAsPropertyCollections ¶
func ParseStructArrayItemsAsPropertyCollections( data []byte, names []string, payloadOffset, payloadSize, count int, ) []map[string]ParsedProperty
func ReadArrayPropertyCount ¶
func ReadArrayPropertyCount(data []byte, tag PropertyTag) int
func ReadArrayPropertyI32Rows ¶
func ReadArrayPropertyI32Rows(data []byte, tag PropertyTag, itemWidth int) [][]int
func ReadArrayPropertyI32Values ¶
func ReadArrayPropertyI32Values(data []byte, tag PropertyTag) []int
func ReadArrayPropertyObjectValues ¶
func ReadArrayPropertyObjectValues(data []byte, tag PropertyTag) []int
func ReadArrayPropertyPayloadInfo ¶
func ReadArrayPropertyPayloadInfo(data []byte, tag PropertyTag) (int, int, int)
func ReadArrayPropertyStructHeadI32 ¶
func ReadArrayPropertyStructHeadI32(data []byte, tag PropertyTag, headI32 int) [][]int
func ReadArrayPropertyStructI32Matrix ¶
func ReadArrayPropertyStructI32Matrix(data []byte, tag PropertyTag) [][]int
func ReadObjectPropertyValue ¶
func ReadObjectPropertyValue(data []byte, tag PropertyTag) int
func ReadRawI32 ¶
Types ¶
type ArrayLayoutInfo ¶
type ArrayLayoutInfo struct {
Count int `json:"count"`
PayloadSize int `json:"payload_size"`
BytesPerItem *int `json:"bytes_per_item,omitempty"`
Remainder int `json:"remainder"`
IsTightI32 bool `json:"is_tight_i32"`
}
func AnalyzeArrayPropertyLayout ¶
func AnalyzeArrayPropertyLayout(data []byte, tag PropertyTag) ArrayLayoutInfo
type ContainerHit ¶
type ContainerHit struct {
StrRef int `json:"strref"`
AbsoluteOffset int `json:"absolute_offset"`
LocalOffset int `json:"local_offset"`
ExportIndex int `json:"export_index"`
ExportName string `json:"export_name,omitempty"`
ClassName string `json:"class_name,omitempty"`
SerialOffset int `json:"serial_offset"`
SerialSize int `json:"serial_size"`
}
func MapOffsetsToContainers ¶
func MapOffsetsToContainers(exports []Export, offsets map[int][]int, dataLen int) []ContainerHit
type Export ¶
type Export struct {
Index int `json:"index"`
ClassIndex int `json:"class_index"`
ObjectNameIndex int `json:"object_name_index"`
SerialSize int `json:"serial_size"`
SerialOffset int `json:"serial_offset"`
ObjectName string `json:"object_name,omitempty"`
ClassName string `json:"class_name,omitempty"`
}
type ExportDetail ¶
type ExportProperties ¶
type ExportProperties struct {
Tags []PropertyTag `json:"property_tags,omitempty"`
SemanticProps map[string]ParsedProperty `json:"semantic_props,omitempty"`
}
type FileSummary ¶
type FileSummary struct {
Path string `json:"file"`
GameProfile GameProfile `json:"game_profile"`
Compressed bool `json:"compressed"`
Header Header `json:"header"`
Names []string `json:"names,omitempty"`
Imports []Import `json:"imports,omitempty"`
Exports []Export `json:"exports"`
}
func ReadFile ¶
func ReadFile(path string) (*FileSummary, error)
func ReadFileExports ¶
func ReadFileFromBytes ¶
func ReadFileFromBytes(data []byte, path string) (*FileSummary, error)
func ReadFileHeaderOnly ¶
func ReadFileHeaderOnly(path string) (*FileSummary, error)
func ReadFileRaw ¶
func ReadFileRaw(path string) ([]byte, *FileSummary, error)
func ReadFileRawFromBytes ¶
func ReadFileRawFromBytes(data []byte, path string) ([]byte, *FileSummary, error)
func (*FileSummary) RequireME2 ¶
func (fs *FileSummary) RequireME2() error
type GameProfile ¶
type GameProfile string
const ( ProfileME2OT GameProfile = "me2_ot" ProfileLE2 GameProfile = "le2" ProfileME3OT GameProfile = "me3_ot" ProfileLE3 GameProfile = "le3" ProfileUnknown GameProfile = "unknown" )
func InferGameProfile ¶
func InferGameProfile(uv, lv int) GameProfile
func (GameProfile) String ¶
func (p GameProfile) String() string
type Header ¶
type Header struct {
UnrealVersion int `json:"unreal_version"`
LicenseeVersion int `json:"licensee_version"`
Flags uint32 `json:"flags"`
NameCount int `json:"name_count"`
NameOffset int `json:"name_offset"`
ExportCount int `json:"export_count"`
ExportOffset int `json:"export_offset"`
ImportCount int `json:"import_count"`
ImportOffset int `json:"import_offset"`
}
type ParsedProperty ¶
type PropertyTag ¶
type PropertyTag struct {
Name string `json:"name"`
PropType string `json:"prop_type"`
Size int `json:"size"`
ArrayIndex int `json:"array_index"`
ValueOffset int `json:"value_offset"`
}
func ExtractBioConversationKeyProperties ¶
func ExtractBioConversationKeyProperties(data []byte, names []string, serialOffset, serialSize int) []PropertyTag
func ParsePropertyTags ¶
Click to show internal directories.
Click to hide internal directories.