Skip to content

Commit

Permalink
Unpacker 2.0 (x86) - Add support for additional samples. (Header size…
Browse files Browse the repository at this point in the history
…: 884)

Bump version.
  • Loading branch information
atom0s committed Sep 26, 2022
1 parent fa0d831 commit 640e57e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
32 changes: 32 additions & 0 deletions Steamless.Unpacker.Variant20.x86/Classes/SteamStubHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,38 @@ public struct SteamStub32Var20_856_Header
public byte[] StubData; // Misc stub data, such as strings, error messages, etc.
}

/// <summary>
/// SteamStub DRM Variant 2.0 Header
///
/// Size: 884 bytes
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct SteamStub32Var20_884_Header
{
public uint XorKey1; // Xor key used to encode the header data.
public uint XorKey2; // Xor key used to encode the header data.
public uint GetModuleHandleA_idata; // The address of GetModuleHandleA inside of the .idata section.
public uint GetProcAddress_idata; // The address of GetProcAddress inside of the .idata section.
public uint LoadLibraryA_idata; // The address of LoadLibraryA inside of the .idata section.
public uint GetProcAddress_custom; // The address of the custom GetProcAddress implementation function.
public uint Flags; // Protection flags used with the file.
public uint Unknown0000; // Unknown (Used as part of a hash check when (Flags & 0x10) is set.)
public uint BindSectionVirtualAddress; // The virtual address to the .bind section.
public uint BindSectionCodeSize; // The size of the code stub inside of the .bind section.
public uint BindSectionHash; // Hash that is calculated based on the .bind code section and .bind stub header data. (Only used if (Flags & 1) is set.)
public uint OEP; // The original file OEP to be invoked after the stub has finished.
public uint CodeSectionVirtualAddress; // The virtual address to the code section. (.text)
public uint CodeSectionSize; // The size of the code section.
public uint CodeSectionXorKey; // The starting key to xor decode against. (Only used if (Flags & 4) is set.)
public uint SteamAppId; // The steam application id of the packed file.

[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x08)]
public byte[] SteamAppIDString; // The SteamAppID of the packed file, in string format.

[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x32C)]
public byte[] StubData; // Misc stub data, such as strings, error messages, etc.
}

/// <summary>
/// SteamStub DRM Variant 2.0 Header
///
Expand Down
3 changes: 3 additions & 0 deletions Steamless.Unpacker.Variant20.x86/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ private bool Step1()
case 856:
this.StubHeader = Pe32Helpers.GetStructure<SteamStub32Var20_856_Header>(headerData);
break;
case 884:
this.StubHeader = Pe32Helpers.GetStructure<SteamStub32Var20_884_Header>(headerData);
break;
case 952:
this.StubHeader = Pe32Helpers.GetStructure<SteamStub32Var20_952_Header>(headerData);
break;
Expand Down
4 changes: 2 additions & 2 deletions Steamless.Unpacker.Variant20.x86/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("4f11f26d-2946-467f-a4e9-9e2a619a1fd3")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: AssemblyVersion("1.0.0.3")]
[assembly: AssemblyFileVersion("1.0.0.3")]
4 changes: 2 additions & 2 deletions Steamless/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("3.1.0.2")]
[assembly: AssemblyFileVersion("3.1.0.2")]
[assembly: AssemblyVersion("3.1.0.3")]
[assembly: AssemblyFileVersion("3.1.0.3")]

0 comments on commit 640e57e

Please sign in to comment.