Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace System.Collections.Generic
- using namespace System.IO
- using namespace System.Linq
- using namespace System.Reflection
- using namespace Newtonsoft.Json
- using namespace Newtonsoft.Json.Serialization
- $ErrorActionPreference = "SilentlyContinue"
- $sbpath = "C:\temp\ark-backup\smartbreed"
- $arkpath = "C:\temp\ark-backup\currArk\TheIsland.ark"
- [System.Reflection.Assembly]::LoadFile("$sbpath\Newtonsoft.Json.dll")
- [System.Reflection.Assembly]::LoadFile("$sbpath\SavegameToolkit.dll")
- [System.Reflection.Assembly]::LoadFile("$sbpath\SavegameToolkitAdditions.dll")
- [System.Reflection.Assembly]::LoadFile("$sbpath\System.Collections.Immutable.dll")
- $arkdata = [SavegameToolkitAdditions.ArkDataReader]::ReadFromFile("$sbpath\json\ark_data.json")
- $bytes = [System.IO.File]::ReadAllBytes($arkpath)
- $stream = [System.IO.MemoryStream]::new($bytes)
- $arkSavegame = [SavegameToolkit.ArkSavegame]::new()
- $archive = [SavegameToolkit.ArkArchive]::new($stream)
- $ro = [SavegameToolkit.ReadingOptions]::Create()
- $ro.WithDatafiles($false)
- $ro.WithEmbeddedData($false)
- $ro.WithDataFilesObjectMap($false)
- $ro.WithBuildComponentTree($true)
- $arkSavegame.ReadBinary($archive, $ro)
- $cryos = ($arkSavegame.Objects | where-object {$_.ClassName -like "*CryoP*"})
- foreach ($cryo in $cryos)
- {
- Write-Host $cryo.properties[4].value.properties[1].value[1]
- $cryobytes = $cryo.properties[4].value.properties[6].value.properties[0].value[0].properties.value
- $outpath = (split-path $arkpath) + "\" + ($cryo.properties[4].value.properties[1].value[1])
- [System.IO.File]::WriteAllBytes($outpath, $cryobytes)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement