2017-01-06 11:17:35 +01:00
/ * *
2022-03-22 11:46:48 +01:00
* Steamless - Copyright ( c ) 2015 - 2022 atom0s [ atom0s @live . com ]
2017-01-06 11:17:35 +01:00
*
* This work is licensed under the Creative Commons Attribution - NonCommercial - NoDerivatives 4.0 International License .
* To view a copy of this license , visit http : //creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to
* Creative Commons , PO Box 1866 , Mountain View , CA 94042 , USA .
*
* By using Steamless , you agree to the above license and its terms .
*
* Attribution - You must give appropriate credit , provide a link to the license and indicate if changes were
* made . You must do so in any reasonable manner , but not in any way that suggests the licensor
* endorses you or your use .
*
* Non - Commercial - You may not use the material ( Steamless ) for commercial purposes .
*
* No - Derivatives - If you remix , transform , or build upon the material ( Steamless ) , you may not distribute the
* modified material . You are , however , allowed to submit the modified works back to the original
* Steamless project in attempt to have it added to the original project .
*
* You may not apply legal terms or technological measures that legally restrict others
* from doing anything the license permits .
*
* No warranties are given .
* /
2020-12-18 08:16:20 +01:00
namespace Steamless.Unpacker.Variant21.x86.Classes
2017-01-06 11:17:35 +01:00
{
using System.Runtime.InteropServices ;
/// <summary>
2020-12-18 08:16:20 +01:00
/// SteamStub DRM Variant 2.1 Header
2017-01-06 11:17:35 +01:00
/// </summary>
[StructLayout(LayoutKind.Sequential)]
2020-12-18 08:16:20 +01:00
public struct SteamStub32Var21Header
2017-01-06 11:17:35 +01:00
{
public uint XorKey ; // The base XOR key, if defined, to unpack the file with.
2022-04-16 04:28:59 +02:00
public uint GetModuleHandleA ; // The address of GetModuleHandleA. (If set.)
public uint GetModuleHandleW ; // The address of GetModuleHandleW. (If set.)
public uint GetProcAddress ; // The address of GetProcAddress. (If set.)
public uint LoadLibraryA ; // The address of LoadLibraryA. (If set.)
public uint LoadLibraryW ; // The address of LoadLibraryW. (If set.)
2017-01-06 11:17:35 +01:00
public uint BindSectionVirtualAddress ; // The virtual address to the .bind section.
public uint BindStartFunctionSize ; // The size of the start function from the .bind section.
public uint PayloadKeyMatch ; // The key inside of the SteamDRMP.dll file that is matched to this structures data. (This matches the first 4 bytes of the payload data.)
public uint PayloadDataVirtualAddress ; // The virtual address to the payload data.
public uint PayloadDataSize ; // The size of the payload data.
public uint SteamAppID ; // The steam application id of the packed file.
public uint Unknown0001 ; // Unknown
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x08)]
public byte [ ] SteamAppIDString ; // The SteamAppID of the packed file, in string format.
public uint SteamDRMPDllVirtualAddress ; // The offset inside of the payload data holding the virtual address to the SteamDRMP.dll file data.
public uint SteamDRMPDllSize ; // The offset inside of the payload data holding the size of the SteamDRMP.dll file data.
public uint XTeaKeys ; // The offset inside of the payload data holding the address to the Xtea keys to decrypt the SteamDRMP.dll file.
2022-04-25 06:34:23 +02:00
//
// The 'StubData' field is dynamically sized based on the needs of the stub version and used options. This is effectively
// impossible to 'size' correctly for all header versions, so instead it will be treated separately.
//
// [MarshalAs(UnmanagedType.ByValArray, SizeConst = ???)]
// public byte[] StubData; // Misc stub data, such as strings, error messages, etc.
//
2017-01-06 11:17:35 +01:00
}
2018-06-25 21:15:38 +02:00
/// <summary>
2020-12-18 08:16:20 +01:00
/// SteamStub DRM Variant 2.1 Header (Header Size: 0xD0 Variant)
2018-06-25 21:15:38 +02:00
/// </summary>
[StructLayout(LayoutKind.Sequential)]
2020-12-18 08:16:20 +01:00
public struct SteamStub32Var21Header_D0Variant
2018-06-25 21:15:38 +02:00
{
public uint XorKey ; // The base XOR key, if defined, to unpack the file with.
2022-04-16 04:28:59 +02:00
public uint GetModuleHandleA ; // The address of GetModuleHandleA. (If set.)
public uint GetModuleHandleW ; // The address of GetModuleHandleW. (If set.)
public uint GetProcAddress ; // The address of GetProcAddress. (If set.)
public uint LoadLibraryA ; // The address of LoadLibraryA. (If set.)
2018-06-25 21:15:38 +02:00
public uint BindSectionVirtualAddress ; // The virtual address to the .bind section.
public uint BindStartFunctionSize ; // The size of the start function from the .bind section.
public uint PayloadKeyMatch ; // The key inside of the SteamDRMP.dll file that is matched to this structures data. (This matches the first 4 bytes of the payload data.)
public uint PayloadDataVirtualAddress ; // The virtual address to the payload data.
public uint PayloadDataSize ; // The size of the payload data.
public uint SteamAppID ; // The steam application id of the packed file.
public uint Unknown0000 ; // Unknown
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x08)]
public byte [ ] SteamAppIDString ; // The SteamAppID of the packed file, in string format.
public uint SteamDRMPDllVirtualAddress ; // The offset inside of the payload data holding the virtual address to the SteamDRMP.dll file data.
public uint SteamDRMPDllSize ; // The offset inside of the payload data holding the size of the SteamDRMP.dll file data.
public uint XTeaKeys ; // The offset inside of the payload data holding the address to the Xtea keys to decrypt the SteamDRMP.dll file.
2022-04-25 06:34:23 +02:00
//
// The 'StubData' field is dynamically sized based on the needs of the stub version and used options. This is effectively
// impossible to 'size' correctly for all header versions, so instead it will be treated separately.
//
// [MarshalAs(UnmanagedType.ByValArray, SizeConst = ???)]
// public byte[] StubData; // Misc stub data, such as strings, error messages, etc.
//
2018-06-25 21:15:38 +02:00
}
2017-01-06 11:17:35 +01:00
}