Beispiel #1
0
func NewDyldCacheExtractor(path string) *DyldCacheExtractor {
	file := filestream.Open(path)

	return &DyldCacheExtractor{
		file:     file,
		mappings: []cache.SharedFileMappingNp{},
		images:   []cache.CacheImageInfo{},
	}
}
Beispiel #2
0
func LoadEDAOEffect(jsonpath string) *EDAOEffect {
	f := filestream.Open(jsonpath)
	defer f.Close()

	eff := &EDAOEffect{}
	eff.Unserialize(f.ReadAll())

	return eff
}
Beispiel #3
0
func dofile(input string) {
	f := filestream.Open(input)
	defer f.Close()

	if string(f.Read(4)) == "EF20" {
		f.Close()
		handleEffFile(input)
	} else {
		f.Close()
		handleJsonFile(input)
	}
}
Beispiel #4
0
func NewEDAOEffect(effpath string) *EDAOEffect {
	f := filestream.Open(effpath)
	defer f.Close()

	header := f.ReadType(edaoEffFileHeader{}).(edaoEffFileHeader)

	eff := &EDAOEffect{
		EffectBase:   newEffectBase(),
		Magic:        utility.BytesToString(header.Magic[:]),
		Unknown:      int(header.Unknown),
		Flags:        int(header.Flags),
		PartDataBits: int(header.PartDataBits),
		PartData:     [partDataCount]*EDAOPartData{},
	}

	eff.fileName = String(filepath.Base(effpath))
	eff.name = utility.BytesToString(header.Name[:])

	for _, texture := range header.Texture {
		t := utility.BytesToString(texture[:])
		eff.texture = append(eff.texture, t)
	}

	for _, child := range header.Children {
		c := utility.BytesToString(child[:])
		eff.children = append(eff.children, c)
	}

	for i := uint(0); i != partDataCount; i++ {
		if ((1 << i) & eff.PartDataBits) == 0 {
			continue
		}

		part := &EDAOPartData{
			edaoPartData: f.ReadType(edaoPartData{}).(edaoPartData),
			Extra:        []edaoPartDataExtra{},
		}

		for j := uint(0); j != uint(part.Header.ExtraCount); j++ {
			part.Extra = append(part.Extra, f.ReadType(edaoPartDataExtra{}).(edaoPartDataExtra))
		}

		eff.PartData[i] = part
	}

	return eff
}