-
Notifications
You must be signed in to change notification settings - Fork 0
/
compiler.ps1
35 lines (31 loc) · 1.08 KB
/
compiler.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<#
.SYNOPSIS
Forgotton Anne save dump encrypter.
.DESCRIPTION
Encrypts provided save dump file to format can be used by the game.
.PARAMETER dumpFile
Location of decrypted dump file.
Default is "./ForgottonAnne-Save.dump.json".
.PARAMETER saveFile
Location of output file.
Default is "./ForgottonAnne-Save.new.json".
.NOTES
Version: 1.0
Author: Zekfad
Creation Date: 31.01.2020
.EXAMPLE
.\compiler.ps1 -dumpFile ./ForgottonAnne-Save.dump.json -saveFile ./ForgottonAnne-Save.new.json
.LINK
https://github.com/Zekfad/ForgottonAnneSave
#>
#requires -Version 5.0
Using module .\ForgottonAnneSave.psm1;
param(
[string] $dumpFile = './ForgottonAnne-Save.dump.json',
[string] $saveFile = './ForgottonAnne-Save.new.json'
)
[ForgottonAnneSave] $fas = [ForgottonAnneSave]::new();
[byte[]] $saveDumpBytes = [System.IO.File]::ReadAllBytes($dumpFile);
[string] $saveDump = [System.Text.Encoding]::ASCII.GetString($saveDumpBytes);
[byte[]] $saveEncryptedBytes = $fas.Encrypt($saveDump);
[System.IO.File]::WriteAllBytes($saveFile, $saveEncryptedBytes);