Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug › IMAGE_LOAD_CONFIG_DIRECTORY64

IMAGE_LOAD_CONFIG_DIRECTORY64

構造体
サイズx64: 328 バイト / x86: 328 バイトパッキング4

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0このロード構成ディレクトリのバイトサイズ。
TimeDateStampDWORD4+4+4ロード構成の日時スタンプ。
MajorVersionWORD2+8+8メジャーバージョン番号。
MinorVersionWORD2+10+10マイナーバージョン番号。
GlobalFlagsClearDWORD4+12+12プロセス起動時にクリアするグローバルフラグ。
GlobalFlagsSetDWORD4+16+16プロセス起動時に設定するグローバルフラグ。
CriticalSectionDefaultTimeoutDWORD4+20+20クリティカルセクションの既定タイムアウト(ミリ秒)。
DeCommitFreeBlockThresholdULONGLONG8+24+24解放ブロックをデコミットする閾値サイズ(64ビット)。
DeCommitTotalFreeThresholdULONGLONG8+32+32合計空きがこの値を超えるとデコミットする閾値(64ビット)。
LockPrefixTableULONGLONG8+40+40LOCKプレフィックスのアドレステーブル(MP対応用)。
MaximumAllocationSizeULONGLONG8+48+48許可される最大割り当てサイズ。
VirtualMemoryThresholdULONGLONG8+56+56仮想割り当てに切り替える閾値サイズ。
ProcessAffinityMaskULONGLONG8+64+64プロセスのプロセッサアフィニティマスク(64ビット)。
ProcessHeapFlagsDWORD4+72+72プロセスヒープの作成フラグ。
CSDVersionWORD2+76+76サービスパック(CSD)バージョン。
DependentLoadFlagsWORD2+78+78依存DLLロード時のフラグ。
EditListULONGLONG8+80+80予約。エディットリスト用。
SecurityCookieULONGLONG8+88+88スタックバッファ保護(/GS)のセキュリティクッキーのアドレス。
SEHandlerTableULONGLONG8+96+96安全なSEHハンドラのテーブルアドレス(SafeSEH)。
SEHandlerCountULONGLONG8+104+104安全なSEHハンドラの個数。
GuardCFCheckFunctionPointerULONGLONG8+112+112CFG間接呼び出しチェック関数ポインタのアドレス。
GuardCFDispatchFunctionPointerULONGLONG8+120+120CFGディスパッチ関数ポインタのアドレス。
GuardCFFunctionTableULONGLONG8+128+128CFG有効な呼び出し先関数テーブルのアドレス。
GuardCFFunctionCountULONGLONG8+136+136CFG関数テーブルのエントリ数。
GuardFlagsDWORD4+144+144制御フローガード(CFG)の構成フラグ。
CodeIntegrityIMAGE_LOAD_CONFIG_CODE_INTEGRITY12+148+148コード整合性情報(IMAGE_LOAD_CONFIG_CODE_INTEGRITY)。
GuardAddressTakenIatEntryTableULONGLONG8+160+160アドレス取得されたIATエントリのテーブル。
GuardAddressTakenIatEntryCountULONGLONG8+168+168当該IATエントリの個数。
GuardLongJumpTargetTableULONGLONG8+176+176有効なlongjmpターゲットのテーブル。
GuardLongJumpTargetCountULONGLONG8+184+184longjmpターゲットの個数。
DynamicValueRelocTableULONGLONG8+192+192動的値再配置テーブルのアドレス。
CHPEMetadataPointerULONGLONG8+200+200CHPE(ARM64互換x86)メタデータへのポインタ。
GuardRFFailureRoutineULONGLONG8+208+208リターンフローガード失敗時ルーチンのアドレス。
GuardRFFailureRoutineFunctionPointerULONGLONG8+216+216RFG失敗ルーチンの関数ポインタアドレス。
DynamicValueRelocTableOffsetDWORD4+224+224動的値再配置テーブルのオフセット。
DynamicValueRelocTableSectionWORD2+228+228当該テーブルが属するセクション番号。
Reserved2WORD2+230+230予約フィールド。
GuardRFVerifyStackPointerFunctionPointerULONGLONG8+232+232RFGスタックポインタ検証関数のポインタアドレス。
HotPatchTableOffsetDWORD4+240+240ホットパッチテーブルのオフセット。
Reserved3DWORD4+244+244予約フィールド。
EnclaveConfigurationPointerULONGLONG8+248+248エンクレーブ構成情報へのポインタ。
VolatileMetadataPointerULONGLONG8+256+256揮発性メタデータへのポインタ。
GuardEHContinuationTableULONGLONG8+264+264EH継続ターゲット(EHCONT)のテーブルアドレス。
GuardEHContinuationCountULONGLONG8+272+272EHCONTテーブルのエントリ数。
GuardXFGCheckFunctionPointerULONGLONG8+280+280XFG(拡張CFG)チェック関数ポインタのアドレス。
GuardXFGDispatchFunctionPointerULONGLONG8+288+288XFGディスパッチ関数ポインタのアドレス。
GuardXFGTableDispatchFunctionPointerULONGLONG8+296+296XFGテーブルディスパッチ関数ポインタのアドレス。
CastGuardOsDeterminedFailureModeULONGLONG8+304+304CastGuard失敗時の動作(OS決定)アドレス。
GuardMemcpyFunctionPointerULONGLONG8+312+312ガード付きmemcpy関数ポインタのアドレス。
UmaFunctionPointersULONGLONG8+320+320ユーザモードアクセス関連の関数ポインタテーブル。

各言語での定義

#include <windows.h>

// IMAGE_LOAD_CONFIG_CODE_INTEGRITY  (x64 12 / x86 12 バイト)
typedef struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {
    WORD Flags;
    WORD Catalog;
    DWORD CatalogOffset;
    DWORD Reserved;
} IMAGE_LOAD_CONFIG_CODE_INTEGRITY;

// IMAGE_LOAD_CONFIG_DIRECTORY64  (x64 328 / x86 328 バイト)
#pragma pack(push, 4)
typedef struct IMAGE_LOAD_CONFIG_DIRECTORY64 {
    DWORD Size;
    DWORD TimeDateStamp;
    WORD MajorVersion;
    WORD MinorVersion;
    DWORD GlobalFlagsClear;
    DWORD GlobalFlagsSet;
    DWORD CriticalSectionDefaultTimeout;
    ULONGLONG DeCommitFreeBlockThreshold;
    ULONGLONG DeCommitTotalFreeThreshold;
    ULONGLONG LockPrefixTable;
    ULONGLONG MaximumAllocationSize;
    ULONGLONG VirtualMemoryThreshold;
    ULONGLONG ProcessAffinityMask;
    DWORD ProcessHeapFlags;
    WORD CSDVersion;
    WORD DependentLoadFlags;
    ULONGLONG EditList;
    ULONGLONG SecurityCookie;
    ULONGLONG SEHandlerTable;
    ULONGLONG SEHandlerCount;
    ULONGLONG GuardCFCheckFunctionPointer;
    ULONGLONG GuardCFDispatchFunctionPointer;
    ULONGLONG GuardCFFunctionTable;
    ULONGLONG GuardCFFunctionCount;
    DWORD GuardFlags;
    IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;
    ULONGLONG GuardAddressTakenIatEntryTable;
    ULONGLONG GuardAddressTakenIatEntryCount;
    ULONGLONG GuardLongJumpTargetTable;
    ULONGLONG GuardLongJumpTargetCount;
    ULONGLONG DynamicValueRelocTable;
    ULONGLONG CHPEMetadataPointer;
    ULONGLONG GuardRFFailureRoutine;
    ULONGLONG GuardRFFailureRoutineFunctionPointer;
    DWORD DynamicValueRelocTableOffset;
    WORD DynamicValueRelocTableSection;
    WORD Reserved2;
    ULONGLONG GuardRFVerifyStackPointerFunctionPointer;
    DWORD HotPatchTableOffset;
    DWORD Reserved3;
    ULONGLONG EnclaveConfigurationPointer;
    ULONGLONG VolatileMetadataPointer;
    ULONGLONG GuardEHContinuationTable;
    ULONGLONG GuardEHContinuationCount;
    ULONGLONG GuardXFGCheckFunctionPointer;
    ULONGLONG GuardXFGDispatchFunctionPointer;
    ULONGLONG GuardXFGTableDispatchFunctionPointer;
    ULONGLONG CastGuardOsDeterminedFailureMode;
    ULONGLONG GuardMemcpyFunctionPointer;
    ULONGLONG UmaFunctionPointers;
} IMAGE_LOAD_CONFIG_DIRECTORY64;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY
{
    public ushort Flags;
    public ushort Catalog;
    public uint CatalogOffset;
    public uint Reserved;
}

[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct IMAGE_LOAD_CONFIG_DIRECTORY64
{
    public uint Size;
    public uint TimeDateStamp;
    public ushort MajorVersion;
    public ushort MinorVersion;
    public uint GlobalFlagsClear;
    public uint GlobalFlagsSet;
    public uint CriticalSectionDefaultTimeout;
    public ulong DeCommitFreeBlockThreshold;
    public ulong DeCommitTotalFreeThreshold;
    public ulong LockPrefixTable;
    public ulong MaximumAllocationSize;
    public ulong VirtualMemoryThreshold;
    public ulong ProcessAffinityMask;
    public uint ProcessHeapFlags;
    public ushort CSDVersion;
    public ushort DependentLoadFlags;
    public ulong EditList;
    public ulong SecurityCookie;
    public ulong SEHandlerTable;
    public ulong SEHandlerCount;
    public ulong GuardCFCheckFunctionPointer;
    public ulong GuardCFDispatchFunctionPointer;
    public ulong GuardCFFunctionTable;
    public ulong GuardCFFunctionCount;
    public uint GuardFlags;
    public IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;
    public ulong GuardAddressTakenIatEntryTable;
    public ulong GuardAddressTakenIatEntryCount;
    public ulong GuardLongJumpTargetTable;
    public ulong GuardLongJumpTargetCount;
    public ulong DynamicValueRelocTable;
    public ulong CHPEMetadataPointer;
    public ulong GuardRFFailureRoutine;
    public ulong GuardRFFailureRoutineFunctionPointer;
    public uint DynamicValueRelocTableOffset;
    public ushort DynamicValueRelocTableSection;
    public ushort Reserved2;
    public ulong GuardRFVerifyStackPointerFunctionPointer;
    public uint HotPatchTableOffset;
    public uint Reserved3;
    public ulong EnclaveConfigurationPointer;
    public ulong VolatileMetadataPointer;
    public ulong GuardEHContinuationTable;
    public ulong GuardEHContinuationCount;
    public ulong GuardXFGCheckFunctionPointer;
    public ulong GuardXFGDispatchFunctionPointer;
    public ulong GuardXFGTableDispatchFunctionPointer;
    public ulong CastGuardOsDeterminedFailureMode;
    public ulong GuardMemcpyFunctionPointer;
    public ulong UmaFunctionPointers;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IMAGE_LOAD_CONFIG_CODE_INTEGRITY
    Public Flags As UShort
    Public Catalog As UShort
    Public CatalogOffset As UInteger
    Public Reserved As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure IMAGE_LOAD_CONFIG_DIRECTORY64
    Public Size As UInteger
    Public TimeDateStamp As UInteger
    Public MajorVersion As UShort
    Public MinorVersion As UShort
    Public GlobalFlagsClear As UInteger
    Public GlobalFlagsSet As UInteger
    Public CriticalSectionDefaultTimeout As UInteger
    Public DeCommitFreeBlockThreshold As ULong
    Public DeCommitTotalFreeThreshold As ULong
    Public LockPrefixTable As ULong
    Public MaximumAllocationSize As ULong
    Public VirtualMemoryThreshold As ULong
    Public ProcessAffinityMask As ULong
    Public ProcessHeapFlags As UInteger
    Public CSDVersion As UShort
    Public DependentLoadFlags As UShort
    Public EditList As ULong
    Public SecurityCookie As ULong
    Public SEHandlerTable As ULong
    Public SEHandlerCount As ULong
    Public GuardCFCheckFunctionPointer As ULong
    Public GuardCFDispatchFunctionPointer As ULong
    Public GuardCFFunctionTable As ULong
    Public GuardCFFunctionCount As ULong
    Public GuardFlags As UInteger
    Public CodeIntegrity As IMAGE_LOAD_CONFIG_CODE_INTEGRITY
    Public GuardAddressTakenIatEntryTable As ULong
    Public GuardAddressTakenIatEntryCount As ULong
    Public GuardLongJumpTargetTable As ULong
    Public GuardLongJumpTargetCount As ULong
    Public DynamicValueRelocTable As ULong
    Public CHPEMetadataPointer As ULong
    Public GuardRFFailureRoutine As ULong
    Public GuardRFFailureRoutineFunctionPointer As ULong
    Public DynamicValueRelocTableOffset As UInteger
    Public DynamicValueRelocTableSection As UShort
    Public Reserved2 As UShort
    Public GuardRFVerifyStackPointerFunctionPointer As ULong
    Public HotPatchTableOffset As UInteger
    Public Reserved3 As UInteger
    Public EnclaveConfigurationPointer As ULong
    Public VolatileMetadataPointer As ULong
    Public GuardEHContinuationTable As ULong
    Public GuardEHContinuationCount As ULong
    Public GuardXFGCheckFunctionPointer As ULong
    Public GuardXFGDispatchFunctionPointer As ULong
    Public GuardXFGTableDispatchFunctionPointer As ULong
    Public CastGuardOsDeterminedFailureMode As ULong
    Public GuardMemcpyFunctionPointer As ULong
    Public UmaFunctionPointers As ULong
End Structure
import ctypes
from ctypes import wintypes

class IMAGE_LOAD_CONFIG_CODE_INTEGRITY(ctypes.Structure):
    _fields_ = [
        ("Flags", ctypes.c_ushort),
        ("Catalog", ctypes.c_ushort),
        ("CatalogOffset", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]

class IMAGE_LOAD_CONFIG_DIRECTORY64(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("TimeDateStamp", wintypes.DWORD),
        ("MajorVersion", ctypes.c_ushort),
        ("MinorVersion", ctypes.c_ushort),
        ("GlobalFlagsClear", wintypes.DWORD),
        ("GlobalFlagsSet", wintypes.DWORD),
        ("CriticalSectionDefaultTimeout", wintypes.DWORD),
        ("DeCommitFreeBlockThreshold", ctypes.c_ulonglong),
        ("DeCommitTotalFreeThreshold", ctypes.c_ulonglong),
        ("LockPrefixTable", ctypes.c_ulonglong),
        ("MaximumAllocationSize", ctypes.c_ulonglong),
        ("VirtualMemoryThreshold", ctypes.c_ulonglong),
        ("ProcessAffinityMask", ctypes.c_ulonglong),
        ("ProcessHeapFlags", wintypes.DWORD),
        ("CSDVersion", ctypes.c_ushort),
        ("DependentLoadFlags", ctypes.c_ushort),
        ("EditList", ctypes.c_ulonglong),
        ("SecurityCookie", ctypes.c_ulonglong),
        ("SEHandlerTable", ctypes.c_ulonglong),
        ("SEHandlerCount", ctypes.c_ulonglong),
        ("GuardCFCheckFunctionPointer", ctypes.c_ulonglong),
        ("GuardCFDispatchFunctionPointer", ctypes.c_ulonglong),
        ("GuardCFFunctionTable", ctypes.c_ulonglong),
        ("GuardCFFunctionCount", ctypes.c_ulonglong),
        ("GuardFlags", wintypes.DWORD),
        ("CodeIntegrity", IMAGE_LOAD_CONFIG_CODE_INTEGRITY),
        ("GuardAddressTakenIatEntryTable", ctypes.c_ulonglong),
        ("GuardAddressTakenIatEntryCount", ctypes.c_ulonglong),
        ("GuardLongJumpTargetTable", ctypes.c_ulonglong),
        ("GuardLongJumpTargetCount", ctypes.c_ulonglong),
        ("DynamicValueRelocTable", ctypes.c_ulonglong),
        ("CHPEMetadataPointer", ctypes.c_ulonglong),
        ("GuardRFFailureRoutine", ctypes.c_ulonglong),
        ("GuardRFFailureRoutineFunctionPointer", ctypes.c_ulonglong),
        ("DynamicValueRelocTableOffset", wintypes.DWORD),
        ("DynamicValueRelocTableSection", ctypes.c_ushort),
        ("Reserved2", ctypes.c_ushort),
        ("GuardRFVerifyStackPointerFunctionPointer", ctypes.c_ulonglong),
        ("HotPatchTableOffset", wintypes.DWORD),
        ("Reserved3", wintypes.DWORD),
        ("EnclaveConfigurationPointer", ctypes.c_ulonglong),
        ("VolatileMetadataPointer", ctypes.c_ulonglong),
        ("GuardEHContinuationTable", ctypes.c_ulonglong),
        ("GuardEHContinuationCount", ctypes.c_ulonglong),
        ("GuardXFGCheckFunctionPointer", ctypes.c_ulonglong),
        ("GuardXFGDispatchFunctionPointer", ctypes.c_ulonglong),
        ("GuardXFGTableDispatchFunctionPointer", ctypes.c_ulonglong),
        ("CastGuardOsDeterminedFailureMode", ctypes.c_ulonglong),
        ("GuardMemcpyFunctionPointer", ctypes.c_ulonglong),
        ("UmaFunctionPointers", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {
    pub Flags: u16,
    pub Catalog: u16,
    pub CatalogOffset: u32,
    pub Reserved: u32,
}

#[repr(C, packed(4))]
pub struct IMAGE_LOAD_CONFIG_DIRECTORY64 {
    pub Size: u32,
    pub TimeDateStamp: u32,
    pub MajorVersion: u16,
    pub MinorVersion: u16,
    pub GlobalFlagsClear: u32,
    pub GlobalFlagsSet: u32,
    pub CriticalSectionDefaultTimeout: u32,
    pub DeCommitFreeBlockThreshold: u64,
    pub DeCommitTotalFreeThreshold: u64,
    pub LockPrefixTable: u64,
    pub MaximumAllocationSize: u64,
    pub VirtualMemoryThreshold: u64,
    pub ProcessAffinityMask: u64,
    pub ProcessHeapFlags: u32,
    pub CSDVersion: u16,
    pub DependentLoadFlags: u16,
    pub EditList: u64,
    pub SecurityCookie: u64,
    pub SEHandlerTable: u64,
    pub SEHandlerCount: u64,
    pub GuardCFCheckFunctionPointer: u64,
    pub GuardCFDispatchFunctionPointer: u64,
    pub GuardCFFunctionTable: u64,
    pub GuardCFFunctionCount: u64,
    pub GuardFlags: u32,
    pub CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY,
    pub GuardAddressTakenIatEntryTable: u64,
    pub GuardAddressTakenIatEntryCount: u64,
    pub GuardLongJumpTargetTable: u64,
    pub GuardLongJumpTargetCount: u64,
    pub DynamicValueRelocTable: u64,
    pub CHPEMetadataPointer: u64,
    pub GuardRFFailureRoutine: u64,
    pub GuardRFFailureRoutineFunctionPointer: u64,
    pub DynamicValueRelocTableOffset: u32,
    pub DynamicValueRelocTableSection: u16,
    pub Reserved2: u16,
    pub GuardRFVerifyStackPointerFunctionPointer: u64,
    pub HotPatchTableOffset: u32,
    pub Reserved3: u32,
    pub EnclaveConfigurationPointer: u64,
    pub VolatileMetadataPointer: u64,
    pub GuardEHContinuationTable: u64,
    pub GuardEHContinuationCount: u64,
    pub GuardXFGCheckFunctionPointer: u64,
    pub GuardXFGDispatchFunctionPointer: u64,
    pub GuardXFGTableDispatchFunctionPointer: u64,
    pub CastGuardOsDeterminedFailureMode: u64,
    pub GuardMemcpyFunctionPointer: u64,
    pub UmaFunctionPointers: u64,
}
import "golang.org/x/sys/windows"

type IMAGE_LOAD_CONFIG_CODE_INTEGRITY struct {
	Flags uint16
	Catalog uint16
	CatalogOffset uint32
	Reserved uint32
}

type IMAGE_LOAD_CONFIG_DIRECTORY64 struct {
	Size uint32
	TimeDateStamp uint32
	MajorVersion uint16
	MinorVersion uint16
	GlobalFlagsClear uint32
	GlobalFlagsSet uint32
	CriticalSectionDefaultTimeout uint32
	DeCommitFreeBlockThreshold uint64
	DeCommitTotalFreeThreshold uint64
	LockPrefixTable uint64
	MaximumAllocationSize uint64
	VirtualMemoryThreshold uint64
	ProcessAffinityMask uint64
	ProcessHeapFlags uint32
	CSDVersion uint16
	DependentLoadFlags uint16
	EditList uint64
	SecurityCookie uint64
	SEHandlerTable uint64
	SEHandlerCount uint64
	GuardCFCheckFunctionPointer uint64
	GuardCFDispatchFunctionPointer uint64
	GuardCFFunctionTable uint64
	GuardCFFunctionCount uint64
	GuardFlags uint32
	CodeIntegrity IMAGE_LOAD_CONFIG_CODE_INTEGRITY
	GuardAddressTakenIatEntryTable uint64
	GuardAddressTakenIatEntryCount uint64
	GuardLongJumpTargetTable uint64
	GuardLongJumpTargetCount uint64
	DynamicValueRelocTable uint64
	CHPEMetadataPointer uint64
	GuardRFFailureRoutine uint64
	GuardRFFailureRoutineFunctionPointer uint64
	DynamicValueRelocTableOffset uint32
	DynamicValueRelocTableSection uint16
	Reserved2 uint16
	GuardRFVerifyStackPointerFunctionPointer uint64
	HotPatchTableOffset uint32
	Reserved3 uint32
	EnclaveConfigurationPointer uint64
	VolatileMetadataPointer uint64
	GuardEHContinuationTable uint64
	GuardEHContinuationCount uint64
	GuardXFGCheckFunctionPointer uint64
	GuardXFGDispatchFunctionPointer uint64
	GuardXFGTableDispatchFunctionPointer uint64
	CastGuardOsDeterminedFailureMode uint64
	GuardMemcpyFunctionPointer uint64
	UmaFunctionPointers uint64
}
type
  IMAGE_LOAD_CONFIG_CODE_INTEGRITY = record
    Flags: Word;
    Catalog: Word;
    CatalogOffset: DWORD;
    Reserved: DWORD;
  end;

  IMAGE_LOAD_CONFIG_DIRECTORY64 = packed record
    Size: DWORD;
    TimeDateStamp: DWORD;
    MajorVersion: Word;
    MinorVersion: Word;
    GlobalFlagsClear: DWORD;
    GlobalFlagsSet: DWORD;
    CriticalSectionDefaultTimeout: DWORD;
    DeCommitFreeBlockThreshold: UInt64;
    DeCommitTotalFreeThreshold: UInt64;
    LockPrefixTable: UInt64;
    MaximumAllocationSize: UInt64;
    VirtualMemoryThreshold: UInt64;
    ProcessAffinityMask: UInt64;
    ProcessHeapFlags: DWORD;
    CSDVersion: Word;
    DependentLoadFlags: Word;
    EditList: UInt64;
    SecurityCookie: UInt64;
    SEHandlerTable: UInt64;
    SEHandlerCount: UInt64;
    GuardCFCheckFunctionPointer: UInt64;
    GuardCFDispatchFunctionPointer: UInt64;
    GuardCFFunctionTable: UInt64;
    GuardCFFunctionCount: UInt64;
    GuardFlags: DWORD;
    CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY;
    GuardAddressTakenIatEntryTable: UInt64;
    GuardAddressTakenIatEntryCount: UInt64;
    GuardLongJumpTargetTable: UInt64;
    GuardLongJumpTargetCount: UInt64;
    DynamicValueRelocTable: UInt64;
    CHPEMetadataPointer: UInt64;
    GuardRFFailureRoutine: UInt64;
    GuardRFFailureRoutineFunctionPointer: UInt64;
    DynamicValueRelocTableOffset: DWORD;
    DynamicValueRelocTableSection: Word;
    Reserved2: Word;
    GuardRFVerifyStackPointerFunctionPointer: UInt64;
    HotPatchTableOffset: DWORD;
    Reserved3: DWORD;
    EnclaveConfigurationPointer: UInt64;
    VolatileMetadataPointer: UInt64;
    GuardEHContinuationTable: UInt64;
    GuardEHContinuationCount: UInt64;
    GuardXFGCheckFunctionPointer: UInt64;
    GuardXFGDispatchFunctionPointer: UInt64;
    GuardXFGTableDispatchFunctionPointer: UInt64;
    CastGuardOsDeterminedFailureMode: UInt64;
    GuardMemcpyFunctionPointer: UInt64;
    UmaFunctionPointers: UInt64;
  end;
const IMAGE_LOAD_CONFIG_CODE_INTEGRITY = extern struct {
    Flags: u16,
    Catalog: u16,
    CatalogOffset: u32,
    Reserved: u32,
};

const IMAGE_LOAD_CONFIG_DIRECTORY64 = extern struct {
    Size: u32,
    TimeDateStamp: u32,
    MajorVersion: u16,
    MinorVersion: u16,
    GlobalFlagsClear: u32,
    GlobalFlagsSet: u32,
    CriticalSectionDefaultTimeout: u32,
    DeCommitFreeBlockThreshold: u64,
    DeCommitTotalFreeThreshold: u64,
    LockPrefixTable: u64,
    MaximumAllocationSize: u64,
    VirtualMemoryThreshold: u64,
    ProcessAffinityMask: u64,
    ProcessHeapFlags: u32,
    CSDVersion: u16,
    DependentLoadFlags: u16,
    EditList: u64,
    SecurityCookie: u64,
    SEHandlerTable: u64,
    SEHandlerCount: u64,
    GuardCFCheckFunctionPointer: u64,
    GuardCFDispatchFunctionPointer: u64,
    GuardCFFunctionTable: u64,
    GuardCFFunctionCount: u64,
    GuardFlags: u32,
    CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY,
    GuardAddressTakenIatEntryTable: u64,
    GuardAddressTakenIatEntryCount: u64,
    GuardLongJumpTargetTable: u64,
    GuardLongJumpTargetCount: u64,
    DynamicValueRelocTable: u64,
    CHPEMetadataPointer: u64,
    GuardRFFailureRoutine: u64,
    GuardRFFailureRoutineFunctionPointer: u64,
    DynamicValueRelocTableOffset: u32,
    DynamicValueRelocTableSection: u16,
    Reserved2: u16,
    GuardRFVerifyStackPointerFunctionPointer: u64,
    HotPatchTableOffset: u32,
    Reserved3: u32,
    EnclaveConfigurationPointer: u64,
    VolatileMetadataPointer: u64,
    GuardEHContinuationTable: u64,
    GuardEHContinuationCount: u64,
    GuardXFGCheckFunctionPointer: u64,
    GuardXFGDispatchFunctionPointer: u64,
    GuardXFGTableDispatchFunctionPointer: u64,
    CastGuardOsDeterminedFailureMode: u64,
    GuardMemcpyFunctionPointer: u64,
    UmaFunctionPointers: u64,
};
type
  IMAGE_LOAD_CONFIG_CODE_INTEGRITY {.bycopy.} = object
    Flags: uint16
    Catalog: uint16
    CatalogOffset: uint32
    Reserved: uint32

  IMAGE_LOAD_CONFIG_DIRECTORY64 {.packed.} = object
    Size: uint32
    TimeDateStamp: uint32
    MajorVersion: uint16
    MinorVersion: uint16
    GlobalFlagsClear: uint32
    GlobalFlagsSet: uint32
    CriticalSectionDefaultTimeout: uint32
    DeCommitFreeBlockThreshold: uint64
    DeCommitTotalFreeThreshold: uint64
    LockPrefixTable: uint64
    MaximumAllocationSize: uint64
    VirtualMemoryThreshold: uint64
    ProcessAffinityMask: uint64
    ProcessHeapFlags: uint32
    CSDVersion: uint16
    DependentLoadFlags: uint16
    EditList: uint64
    SecurityCookie: uint64
    SEHandlerTable: uint64
    SEHandlerCount: uint64
    GuardCFCheckFunctionPointer: uint64
    GuardCFDispatchFunctionPointer: uint64
    GuardCFFunctionTable: uint64
    GuardCFFunctionCount: uint64
    GuardFlags: uint32
    CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY
    GuardAddressTakenIatEntryTable: uint64
    GuardAddressTakenIatEntryCount: uint64
    GuardLongJumpTargetTable: uint64
    GuardLongJumpTargetCount: uint64
    DynamicValueRelocTable: uint64
    CHPEMetadataPointer: uint64
    GuardRFFailureRoutine: uint64
    GuardRFFailureRoutineFunctionPointer: uint64
    DynamicValueRelocTableOffset: uint32
    DynamicValueRelocTableSection: uint16
    Reserved2: uint16
    GuardRFVerifyStackPointerFunctionPointer: uint64
    HotPatchTableOffset: uint32
    Reserved3: uint32
    EnclaveConfigurationPointer: uint64
    VolatileMetadataPointer: uint64
    GuardEHContinuationTable: uint64
    GuardEHContinuationCount: uint64
    GuardXFGCheckFunctionPointer: uint64
    GuardXFGDispatchFunctionPointer: uint64
    GuardXFGTableDispatchFunctionPointer: uint64
    CastGuardOsDeterminedFailureMode: uint64
    GuardMemcpyFunctionPointer: uint64
    UmaFunctionPointers: uint64
struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY
{
    ushort Flags;
    ushort Catalog;
    uint CatalogOffset;
    uint Reserved;
}

align(4)
struct IMAGE_LOAD_CONFIG_DIRECTORY64
{
    uint Size;
    uint TimeDateStamp;
    ushort MajorVersion;
    ushort MinorVersion;
    uint GlobalFlagsClear;
    uint GlobalFlagsSet;
    uint CriticalSectionDefaultTimeout;
    ulong DeCommitFreeBlockThreshold;
    ulong DeCommitTotalFreeThreshold;
    ulong LockPrefixTable;
    ulong MaximumAllocationSize;
    ulong VirtualMemoryThreshold;
    ulong ProcessAffinityMask;
    uint ProcessHeapFlags;
    ushort CSDVersion;
    ushort DependentLoadFlags;
    ulong EditList;
    ulong SecurityCookie;
    ulong SEHandlerTable;
    ulong SEHandlerCount;
    ulong GuardCFCheckFunctionPointer;
    ulong GuardCFDispatchFunctionPointer;
    ulong GuardCFFunctionTable;
    ulong GuardCFFunctionCount;
    uint GuardFlags;
    IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;
    ulong GuardAddressTakenIatEntryTable;
    ulong GuardAddressTakenIatEntryCount;
    ulong GuardLongJumpTargetTable;
    ulong GuardLongJumpTargetCount;
    ulong DynamicValueRelocTable;
    ulong CHPEMetadataPointer;
    ulong GuardRFFailureRoutine;
    ulong GuardRFFailureRoutineFunctionPointer;
    uint DynamicValueRelocTableOffset;
    ushort DynamicValueRelocTableSection;
    ushort Reserved2;
    ulong GuardRFVerifyStackPointerFunctionPointer;
    uint HotPatchTableOffset;
    uint Reserved3;
    ulong EnclaveConfigurationPointer;
    ulong VolatileMetadataPointer;
    ulong GuardEHContinuationTable;
    ulong GuardEHContinuationCount;
    ulong GuardXFGCheckFunctionPointer;
    ulong GuardXFGDispatchFunctionPointer;
    ulong GuardXFGTableDispatchFunctionPointer;
    ulong CastGuardOsDeterminedFailureMode;
    ulong GuardMemcpyFunctionPointer;
    ulong UmaFunctionPointers;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMAGE_LOAD_CONFIG_DIRECTORY64 サイズ: 328 バイト(x64)
dim st, 82    ; 4byte整数×82(構造体サイズ 328 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; TimeDateStamp : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; MajorVersion : WORD (+8, 2byte)  wpoke st,8,値  /  値 = wpeek(st,8)
; MinorVersion : WORD (+10, 2byte)  wpoke st,10,値  /  値 = wpeek(st,10)
; GlobalFlagsClear : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; GlobalFlagsSet : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; CriticalSectionDefaultTimeout : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; DeCommitFreeBlockThreshold : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; DeCommitTotalFreeThreshold : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; LockPrefixTable : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; MaximumAllocationSize : ULONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; VirtualMemoryThreshold : ULONGLONG (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ProcessAffinityMask : ULONGLONG (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ProcessHeapFlags : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; CSDVersion : WORD (+76, 2byte)  wpoke st,76,値  /  値 = wpeek(st,76)
; DependentLoadFlags : WORD (+78, 2byte)  wpoke st,78,値  /  値 = wpeek(st,78)
; EditList : ULONGLONG (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; SecurityCookie : ULONGLONG (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; SEHandlerTable : ULONGLONG (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; SEHandlerCount : ULONGLONG (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; GuardCFCheckFunctionPointer : ULONGLONG (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; GuardCFDispatchFunctionPointer : ULONGLONG (+120, 8byte)  qpoke st,120,値 / qpeek(st,120)  ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; GuardCFFunctionTable : ULONGLONG (+128, 8byte)  qpoke st,128,値 / qpeek(st,128)  ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; GuardCFFunctionCount : ULONGLONG (+136, 8byte)  qpoke st,136,値 / qpeek(st,136)  ※IronHSPのみ。3.7/3.8は lpoke st,136,下位 : lpoke st,140,上位
; GuardFlags : DWORD (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; CodeIntegrity : IMAGE_LOAD_CONFIG_CODE_INTEGRITY (+148, 12byte)  varptr(st)+148 を基点に操作(12byte:入れ子/配列)
; GuardAddressTakenIatEntryTable : ULONGLONG (+160, 8byte)  qpoke st,160,値 / qpeek(st,160)  ※IronHSPのみ。3.7/3.8は lpoke st,160,下位 : lpoke st,164,上位
; GuardAddressTakenIatEntryCount : ULONGLONG (+168, 8byte)  qpoke st,168,値 / qpeek(st,168)  ※IronHSPのみ。3.7/3.8は lpoke st,168,下位 : lpoke st,172,上位
; GuardLongJumpTargetTable : ULONGLONG (+176, 8byte)  qpoke st,176,値 / qpeek(st,176)  ※IronHSPのみ。3.7/3.8は lpoke st,176,下位 : lpoke st,180,上位
; GuardLongJumpTargetCount : ULONGLONG (+184, 8byte)  qpoke st,184,値 / qpeek(st,184)  ※IronHSPのみ。3.7/3.8は lpoke st,184,下位 : lpoke st,188,上位
; DynamicValueRelocTable : ULONGLONG (+192, 8byte)  qpoke st,192,値 / qpeek(st,192)  ※IronHSPのみ。3.7/3.8は lpoke st,192,下位 : lpoke st,196,上位
; CHPEMetadataPointer : ULONGLONG (+200, 8byte)  qpoke st,200,値 / qpeek(st,200)  ※IronHSPのみ。3.7/3.8は lpoke st,200,下位 : lpoke st,204,上位
; GuardRFFailureRoutine : ULONGLONG (+208, 8byte)  qpoke st,208,値 / qpeek(st,208)  ※IronHSPのみ。3.7/3.8は lpoke st,208,下位 : lpoke st,212,上位
; GuardRFFailureRoutineFunctionPointer : ULONGLONG (+216, 8byte)  qpoke st,216,値 / qpeek(st,216)  ※IronHSPのみ。3.7/3.8は lpoke st,216,下位 : lpoke st,220,上位
; DynamicValueRelocTableOffset : DWORD (+224, 4byte)  st.56 = 値  /  値 = st.56   (lpoke/lpeek も可)
; DynamicValueRelocTableSection : WORD (+228, 2byte)  wpoke st,228,値  /  値 = wpeek(st,228)
; Reserved2 : WORD (+230, 2byte)  wpoke st,230,値  /  値 = wpeek(st,230)
; GuardRFVerifyStackPointerFunctionPointer : ULONGLONG (+232, 8byte)  qpoke st,232,値 / qpeek(st,232)  ※IronHSPのみ。3.7/3.8は lpoke st,232,下位 : lpoke st,236,上位
; HotPatchTableOffset : DWORD (+240, 4byte)  st.60 = 値  /  値 = st.60   (lpoke/lpeek も可)
; Reserved3 : DWORD (+244, 4byte)  st.61 = 値  /  値 = st.61   (lpoke/lpeek も可)
; EnclaveConfigurationPointer : ULONGLONG (+248, 8byte)  qpoke st,248,値 / qpeek(st,248)  ※IronHSPのみ。3.7/3.8は lpoke st,248,下位 : lpoke st,252,上位
; VolatileMetadataPointer : ULONGLONG (+256, 8byte)  qpoke st,256,値 / qpeek(st,256)  ※IronHSPのみ。3.7/3.8は lpoke st,256,下位 : lpoke st,260,上位
; GuardEHContinuationTable : ULONGLONG (+264, 8byte)  qpoke st,264,値 / qpeek(st,264)  ※IronHSPのみ。3.7/3.8は lpoke st,264,下位 : lpoke st,268,上位
; GuardEHContinuationCount : ULONGLONG (+272, 8byte)  qpoke st,272,値 / qpeek(st,272)  ※IronHSPのみ。3.7/3.8は lpoke st,272,下位 : lpoke st,276,上位
; GuardXFGCheckFunctionPointer : ULONGLONG (+280, 8byte)  qpoke st,280,値 / qpeek(st,280)  ※IronHSPのみ。3.7/3.8は lpoke st,280,下位 : lpoke st,284,上位
; GuardXFGDispatchFunctionPointer : ULONGLONG (+288, 8byte)  qpoke st,288,値 / qpeek(st,288)  ※IronHSPのみ。3.7/3.8は lpoke st,288,下位 : lpoke st,292,上位
; GuardXFGTableDispatchFunctionPointer : ULONGLONG (+296, 8byte)  qpoke st,296,値 / qpeek(st,296)  ※IronHSPのみ。3.7/3.8は lpoke st,296,下位 : lpoke st,300,上位
; CastGuardOsDeterminedFailureMode : ULONGLONG (+304, 8byte)  qpoke st,304,値 / qpeek(st,304)  ※IronHSPのみ。3.7/3.8は lpoke st,304,下位 : lpoke st,308,上位
; GuardMemcpyFunctionPointer : ULONGLONG (+312, 8byte)  qpoke st,312,値 / qpeek(st,312)  ※IronHSPのみ。3.7/3.8は lpoke st,312,下位 : lpoke st,316,上位
; UmaFunctionPointers : ULONGLONG (+320, 8byte)  qpoke st,320,値 / qpeek(st,320)  ※IronHSPのみ。3.7/3.8は lpoke st,320,下位 : lpoke st,324,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global IMAGE_LOAD_CONFIG_CODE_INTEGRITY
    #field short Flags
    #field short Catalog
    #field int CatalogOffset
    #field int Reserved
#endstruct

#defstruct global IMAGE_LOAD_CONFIG_DIRECTORY64, pack=4
    #field int Size
    #field int TimeDateStamp
    #field short MajorVersion
    #field short MinorVersion
    #field int GlobalFlagsClear
    #field int GlobalFlagsSet
    #field int CriticalSectionDefaultTimeout
    #field int64 DeCommitFreeBlockThreshold
    #field int64 DeCommitTotalFreeThreshold
    #field int64 LockPrefixTable
    #field int64 MaximumAllocationSize
    #field int64 VirtualMemoryThreshold
    #field int64 ProcessAffinityMask
    #field int ProcessHeapFlags
    #field short CSDVersion
    #field short DependentLoadFlags
    #field int64 EditList
    #field int64 SecurityCookie
    #field int64 SEHandlerTable
    #field int64 SEHandlerCount
    #field int64 GuardCFCheckFunctionPointer
    #field int64 GuardCFDispatchFunctionPointer
    #field int64 GuardCFFunctionTable
    #field int64 GuardCFFunctionCount
    #field int GuardFlags
    #field IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity
    #field int64 GuardAddressTakenIatEntryTable
    #field int64 GuardAddressTakenIatEntryCount
    #field int64 GuardLongJumpTargetTable
    #field int64 GuardLongJumpTargetCount
    #field int64 DynamicValueRelocTable
    #field int64 CHPEMetadataPointer
    #field int64 GuardRFFailureRoutine
    #field int64 GuardRFFailureRoutineFunctionPointer
    #field int DynamicValueRelocTableOffset
    #field short DynamicValueRelocTableSection
    #field short Reserved2
    #field int64 GuardRFVerifyStackPointerFunctionPointer
    #field int HotPatchTableOffset
    #field int Reserved3
    #field int64 EnclaveConfigurationPointer
    #field int64 VolatileMetadataPointer
    #field int64 GuardEHContinuationTable
    #field int64 GuardEHContinuationCount
    #field int64 GuardXFGCheckFunctionPointer
    #field int64 GuardXFGDispatchFunctionPointer
    #field int64 GuardXFGTableDispatchFunctionPointer
    #field int64 CastGuardOsDeterminedFailureMode
    #field int64 GuardMemcpyFunctionPointer
    #field int64 UmaFunctionPointers
#endstruct

stdim st, IMAGE_LOAD_CONFIG_DIRECTORY64        ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size