175 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
93 lines
6.6 KiB
C
93 lines
6.6 KiB
C
#ifndef GW_ENGINE_ORIGINAL_MAIN_HEADER_H
|
|
#define GW_ENGINE_ORIGINAL_MAIN_HEADER_H
|
|
/* Exact declared PE-header fingerprint of the accepted original 70334 Main.
|
|
* Derived only from saved C52I2-header-r1 disk/live captures: both first0x400
|
|
* bytes agree exactly. Bytes after SizeOfHeaders belong to file-section data
|
|
* versus mapped padding and are intentionally outside this fingerprint.
|
|
*
|
|
* This is a pure byte comparison, not process access or an integrity bypass.
|
|
* The owner must separately qualify registered Main, its expected base,
|
|
* allocation/type/protection/span and live owner/generation. Matching arbitrary
|
|
* memory does not make it a registered/owned Main image.
|
|
*/
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#define GW_ENGINE_ORIGINAL_MAIN_HEADER_BYTES 1024u
|
|
#define GW_ENGINE_ORIGINAL_MAIN_HEADER_SHA256 "a58f3eeb2b0dbfb80712459ffa0c5245136074da93aeab4f92941af066358b23"
|
|
static const uint8_t gw_engine_original_main_header_bytes[GW_ENGINE_ORIGINAL_MAIN_HEADER_BYTES] = {
|
|
0x4d,0x5a,0x90,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0x00,0x00,
|
|
0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x01,0x00,0x00,
|
|
0x0e,0x1f,0xba,0x0e,0x00,0xb4,0x09,0xcd,0x21,0xb8,0x01,0x4c,0xcd,0x21,0x54,0x68,
|
|
0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x20,0x63,0x61,0x6e,0x6e,0x6f,
|
|
0x74,0x20,0x62,0x65,0x20,0x72,0x75,0x6e,0x20,0x69,0x6e,0x20,0x44,0x4f,0x53,0x20,
|
|
0x6d,0x6f,0x64,0x65,0x2e,0x0d,0x0d,0x0a,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0xa4,0x13,0x85,0x14,0xe0,0x72,0xeb,0x47,0xe0,0x72,0xeb,0x47,0xe0,0x72,0xeb,0x47,
|
|
0xf4,0x19,0xe8,0x46,0xc6,0x72,0xeb,0x47,0x67,0xfb,0xe8,0x46,0xc5,0x72,0xeb,0x47,
|
|
0x67,0xfb,0xef,0x46,0xf4,0x72,0xeb,0x47,0xf4,0x19,0xef,0x46,0xdf,0x72,0xeb,0x47,
|
|
0xe9,0x0a,0x78,0x47,0xe4,0x72,0xeb,0x47,0x67,0xfb,0x16,0x47,0xe8,0x72,0xeb,0x47,
|
|
0xe9,0x0a,0x6f,0x47,0xe1,0x72,0xeb,0x47,0xf4,0x0d,0xee,0x46,0xe2,0x72,0xeb,0x47,
|
|
0x39,0x06,0xef,0x46,0xd4,0x72,0xeb,0x47,0x3f,0x06,0xef,0x46,0xa3,0x72,0xeb,0x47,
|
|
0xe0,0x72,0xeb,0x47,0xcb,0x72,0xeb,0x47,0xe9,0x0a,0x68,0x47,0xea,0x72,0xeb,0x47,
|
|
0xf4,0x19,0xee,0x46,0x37,0x72,0xeb,0x47,0x67,0xfb,0xee,0x46,0xdd,0x72,0xeb,0x47,
|
|
0xf4,0x19,0xed,0x46,0xe5,0x72,0xeb,0x47,0xf4,0x19,0xea,0x46,0xc9,0x72,0xeb,0x47,
|
|
0xe0,0x72,0xea,0x47,0xfe,0x71,0xeb,0x47,0x78,0xfb,0xee,0x46,0x59,0x72,0xeb,0x47,
|
|
0x78,0xfb,0xef,0x46,0xc7,0x72,0xeb,0x47,0x78,0xfb,0xe2,0x46,0xbf,0x66,0xeb,0x47,
|
|
0x78,0xfb,0xe8,0x46,0xca,0x72,0xeb,0x47,0x78,0xfb,0xeb,0x46,0xe1,0x72,0xeb,0x47,
|
|
0x78,0xfb,0x14,0x47,0xe1,0x72,0xeb,0x47,0xe0,0x72,0x7c,0x47,0xe1,0x72,0xeb,0x47,
|
|
0x78,0xfb,0xe9,0x46,0xe1,0x72,0xeb,0x47,0x52,0x69,0x63,0x68,0xe0,0x72,0xeb,0x47,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x50,0x45,0x00,0x00,0x64,0x86,0x07,0x00,0xf7,0x16,0xc9,0x6a,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0xf0,0x00,0x22,0x00,0x0b,0x02,0x0e,0x2c,0x00,0x06,0x7c,0x04,
|
|
0x00,0x28,0xcf,0x03,0x00,0x00,0x00,0x00,0xd0,0x91,0x1d,0x00,0x00,0x10,0x00,0x00,
|
|
0x00,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,
|
|
0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x80,0x4b,0x08,0x00,0x04,0x00,0x00,0x74,0x0a,0x13,0x06,0x02,0x00,0x60,0x81,
|
|
0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x40,0xde,0x65,0x05,0x50,0x02,0x00,0x00,
|
|
0x90,0xe0,0x65,0x05,0xb8,0x01,0x00,0x00,0x00,0x10,0x42,0x08,0x08,0xa8,0x00,0x00,
|
|
0x00,0x10,0x08,0x08,0x64,0xca,0x37,0x00,0x00,0xd2,0x12,0x06,0xd0,0x28,0x00,0x00,
|
|
0x00,0xc0,0x42,0x08,0xdc,0xb3,0x08,0x00,0x94,0x06,0x1c,0x05,0x54,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x80,0x08,0x1c,0x05,0x28,0x00,0x00,0x00,0x00,0xf2,0x7d,0x04,0x40,0x01,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x7c,0x04,0x08,0x17,0x00,0x00,
|
|
0x00,0xd9,0x65,0x05,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x74,0x65,0x78,0x74,0x00,0x00,0x00,
|
|
0x5c,0x04,0x7c,0x04,0x00,0x10,0x00,0x00,0x00,0x06,0x7c,0x04,0x00,0x04,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x60,
|
|
0x2e,0x72,0x64,0x61,0x74,0x61,0x00,0x00,0x24,0x10,0xea,0x00,0x00,0x20,0x7c,0x04,
|
|
0x00,0x12,0xea,0x00,0x00,0x0a,0x7c,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x2e,0x64,0x61,0x74,0x61,0x00,0x00,0x00,
|
|
0xe1,0xc5,0xa1,0x02,0x00,0x40,0x66,0x05,0x00,0x66,0x69,0x00,0x00,0x1c,0x66,0x05,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0xc0,
|
|
0x2e,0x70,0x64,0x61,0x74,0x61,0x00,0x00,0x64,0xca,0x37,0x00,0x00,0x10,0x08,0x08,
|
|
0x00,0xcc,0x37,0x00,0x00,0x82,0xcf,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x5f,0x52,0x44,0x41,0x54,0x41,0x00,0x00,
|
|
0xe0,0x24,0x02,0x00,0x00,0xe0,0x3f,0x08,0x00,0x26,0x02,0x00,0x00,0x4e,0x07,0x06,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x40,
|
|
0x2e,0x72,0x73,0x72,0x63,0x00,0x00,0x00,0x08,0xa8,0x00,0x00,0x00,0x10,0x42,0x08,
|
|
0x00,0xaa,0x00,0x00,0x00,0x74,0x09,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x2e,0x72,0x65,0x6c,0x6f,0x63,0x00,0x00,
|
|
0xdc,0xb3,0x08,0x00,0x00,0xc0,0x42,0x08,0x00,0xb4,0x08,0x00,0x00,0x1e,0x0a,0x06,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x42,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
};
|
|
static inline int gw_engine_original_main_header_matches(const void *header, size_t bytes)
|
|
{
|
|
const uint8_t *p=(const uint8_t *)header;
|
|
size_t i;
|
|
if(!p || bytes<GW_ENGINE_ORIGINAL_MAIN_HEADER_BYTES) return 0;
|
|
for(i=0;i<GW_ENGINE_ORIGINAL_MAIN_HEADER_BYTES;++i)
|
|
if(p[i]!=gw_engine_original_main_header_bytes[i]) return 0;
|
|
return 1;
|
|
}
|
|
#endif
|