Skip to content

Commit

Permalink
Add DataXor
Browse files Browse the repository at this point in the history
Fix RTDP
  • Loading branch information
Venomalia committed Jul 24, 2022
1 parent 13eab1f commit c51b653
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TextureExtraction tool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.3.0")]
[assembly: AssemblyFileVersion("0.7.3.0")]
[assembly: AssemblyVersion("0.7.3.1")]
[assembly: AssemblyFileVersion("0.7.3.1")]
2 changes: 1 addition & 1 deletion lib/AuroraLip/Archives/Formats/RTDP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override void Read(Stream stream)

ArchiveFile Sub = new ArchiveFile() { Parent = Root, Name = Entry.Name };
stream.Position = Entry.DataOffset + EOH;
Sub.FileData = stream.Read((int)Entry.DataSize);
Sub.FileData = stream.Read((int)Entry.DataSize).DataXor(0x55);
Root.Items.Add(Sub.Name, Sub);
}
}
Expand Down
9 changes: 9 additions & 0 deletions lib/AuroraLip/Common/Extensions/BitConverterEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,14 @@ public static int ToInt32(this BitArray array)
array.CopyTo(Finalarray, 0);
return Finalarray[0];
}

public static byte[] DataXor(this byte[] data, byte key)
{
for (int i = 0; i < data.Length; i++)
{
data[i] = (byte)(data[i] ^ key);
}
return data;
}
}
}

0 comments on commit c51b653

Please sign in to comment.