1
0
Fork 0
mirror of https://github.com/atom0s/Steamless.git synced 2024-12-28 23:37:41 +01:00

Fixed 2.1 (x86) unpacker using the wrong encryption size when the .text section is encrypted. (Fixes #57)

This commit is contained in:
atom0s 2021-09-23 22:51:31 -07:00
parent 2a10df60c1
commit b31c7a1884
No known key found for this signature in database
GPG key ID: 37D5FD3494D79AF8
3 changed files with 7 additions and 6 deletions

View file

@ -395,11 +395,12 @@ namespace Steamless.Unpacker.Variant21.x86
var aesKey = this.PayloadData.Skip(this.SteamDrmpOffsets[5]).Take(32).ToArray(); var aesKey = this.PayloadData.Skip(this.SteamDrmpOffsets[5]).Take(32).ToArray();
var aesIv = this.PayloadData.Skip(this.SteamDrmpOffsets[6]).Take(16).ToArray(); var aesIv = this.PayloadData.Skip(this.SteamDrmpOffsets[6]).Take(16).ToArray();
var codeStolen = this.PayloadData.Skip(this.SteamDrmpOffsets[7]).Take(16).ToArray(); var codeStolen = this.PayloadData.Skip(this.SteamDrmpOffsets[7]).Take(16).ToArray();
var encryptedSize = BitConverter.ToUInt32(this.PayloadData.Skip(this.SteamDrmpOffsets[4]).Take(4).ToArray(), 0);
// Restore the stolen data then read the rest of the section data.. // Restore the stolen data then read the rest of the section data..
codeSectionData = new byte[mainSection.SizeOfRawData + codeStolen.Length]; codeSectionData = new byte[encryptedSize + codeStolen.Length];
Array.Copy(codeStolen, 0, codeSectionData, 0, codeStolen.Length); Array.Copy(codeStolen, 0, codeSectionData, 0, codeStolen.Length);
Array.Copy(this.File.FileData, this.File.GetFileOffsetFromRva(mainSection.VirtualAddress), codeSectionData, codeStolen.Length, mainSection.SizeOfRawData); Array.Copy(this.File.FileData, this.File.GetFileOffsetFromRva(mainSection.VirtualAddress), codeSectionData, codeStolen.Length, encryptedSize);
// Decrypt the code section.. // Decrypt the code section..
var aes = new AesHelper(aesKey, aesIv); var aes = new AesHelper(aesKey, aesIv);

View file

@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: Guid("a40154cd-a0fd-4371-8099-ce277e0989af")] [assembly: Guid("a40154cd-a0fd-4371-8099-ce277e0989af")]
[assembly: AssemblyVersion("1.0.0.7")] [assembly: AssemblyVersion("1.0.0.8")]
[assembly: AssemblyFileVersion("1.0.0.7")] [assembly: AssemblyFileVersion("1.0.0.8")]

View file

@ -37,5 +37,5 @@ using System.Windows;
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("3.0.0.11")] [assembly: AssemblyVersion("3.0.0.12")]
[assembly: AssemblyFileVersion("3.0.0.11")] [assembly: AssemblyFileVersion("3.0.0.12")]