예제 #1
0
파일: main.go 프로젝트: pmeido/Arianrhod
func NewDyldCacheExtractor(path string) *DyldCacheExtractor {
	file := filestream.Open(path)

	return &DyldCacheExtractor{
		file:     file,
		mappings: []cache.SharedFileMappingNp{},
		images:   []cache.CacheImageInfo{},
	}
}
예제 #2
0
파일: edao.go 프로젝트: pmeido/Arianrhod
func LoadEDAOEffect(jsonpath string) *EDAOEffect {
	f := filestream.Open(jsonpath)
	defer f.Close()

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

	return eff
}
예제 #3
0
파일: efftool.go 프로젝트: pmeido/Arianrhod
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)
	}
}
예제 #4
0
파일: edao.go 프로젝트: pmeido/Arianrhod
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
}