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

IMAGE_LOAD_CONFIG_DIRECTORY32

構造体
サイズx64: 196 バイト / x86: 196 バイト

サイズ=各フィールドのバイト数(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クリティカルセクションの既定タイムアウト(ミリ秒)。
DeCommitFreeBlockThresholdDWORD4+24+24解放ブロックをデコミットする閾値サイズ(32ビット)。
DeCommitTotalFreeThresholdDWORD4+28+28合計空きがこの値を超えるとデコミットする閾値(32ビット)。
LockPrefixTableDWORD4+32+32LOCKプレフィックスのアドレステーブル(MP対応用)。
MaximumAllocationSizeDWORD4+36+36許可される最大割り当てサイズ。
VirtualMemoryThresholdDWORD4+40+40仮想割り当てに切り替える閾値サイズ。
ProcessHeapFlagsDWORD4+44+44プロセスヒープの作成フラグ。
ProcessAffinityMaskDWORD4+48+48プロセスのプロセッサアフィニティマスク(32ビット)。
CSDVersionWORD2+52+52サービスパック(CSD)バージョン。
DependentLoadFlagsWORD2+54+54依存DLLロード時のフラグ。
EditListDWORD4+56+56予約。エディットリスト用。
SecurityCookieDWORD4+60+60スタックバッファ保護(/GS)のセキュリティクッキーのアドレス。
SEHandlerTableDWORD4+64+64安全なSEHハンドラのテーブルアドレス(SafeSEH)。
SEHandlerCountDWORD4+68+68安全なSEHハンドラの個数。
GuardCFCheckFunctionPointerDWORD4+72+72CFG間接呼び出しチェック関数ポインタのアドレス。
GuardCFDispatchFunctionPointerDWORD4+76+76CFGディスパッチ関数ポインタのアドレス。
GuardCFFunctionTableDWORD4+80+80CFG有効な呼び出し先関数テーブルのアドレス。
GuardCFFunctionCountDWORD4+84+84CFG関数テーブルのエントリ数。
GuardFlagsDWORD4+88+88制御フローガード(CFG)の構成フラグ。
CodeIntegrityIMAGE_LOAD_CONFIG_CODE_INTEGRITY12+92+92コード整合性情報(IMAGE_LOAD_CONFIG_CODE_INTEGRITY)。
GuardAddressTakenIatEntryTableDWORD4+104+104アドレス取得されたIATエントリのテーブル。
GuardAddressTakenIatEntryCountDWORD4+108+108当該IATエントリの個数。
GuardLongJumpTargetTableDWORD4+112+112有効なlongjmpターゲットのテーブル。
GuardLongJumpTargetCountDWORD4+116+116longjmpターゲットの個数。
DynamicValueRelocTableDWORD4+120+120動的値再配置テーブルのアドレス。
CHPEMetadataPointerDWORD4+124+124CHPE(ARM64互換x86)メタデータへのポインタ。
GuardRFFailureRoutineDWORD4+128+128リターンフローガード失敗時ルーチンのアドレス。
GuardRFFailureRoutineFunctionPointerDWORD4+132+132RFG失敗ルーチンの関数ポインタアドレス。
DynamicValueRelocTableOffsetDWORD4+136+136動的値再配置テーブルのオフセット。
DynamicValueRelocTableSectionWORD2+140+140当該テーブルが属するセクション番号。
Reserved2WORD2+142+142予約フィールド。
GuardRFVerifyStackPointerFunctionPointerDWORD4+144+144RFGスタックポインタ検証関数のポインタアドレス。
HotPatchTableOffsetDWORD4+148+148ホットパッチテーブルのオフセット。
Reserved3DWORD4+152+152予約フィールド。
EnclaveConfigurationPointerDWORD4+156+156エンクレーブ構成情報へのポインタ。
VolatileMetadataPointerDWORD4+160+160揮発性メタデータへのポインタ。
GuardEHContinuationTableDWORD4+164+164EH継続ターゲット(EHCONT)のテーブルアドレス。
GuardEHContinuationCountDWORD4+168+168EHCONTテーブルのエントリ数。
GuardXFGCheckFunctionPointerDWORD4+172+172XFG(拡張CFG)チェック関数ポインタのアドレス。
GuardXFGDispatchFunctionPointerDWORD4+176+176XFGディスパッチ関数ポインタのアドレス。
GuardXFGTableDispatchFunctionPointerDWORD4+180+180XFGテーブルディスパッチ関数ポインタのアドレス。
CastGuardOsDeterminedFailureModeDWORD4+184+184CastGuard失敗時の動作(OS決定)アドレス。
GuardMemcpyFunctionPointerDWORD4+188+188ガード付きmemcpy関数ポインタのアドレス。
UmaFunctionPointersDWORD4+192+192ユーザモードアクセス関連の関数ポインタテーブル。

各言語での定義

#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_DIRECTORY32  (x64 196 / x86 196 バイト)
typedef struct IMAGE_LOAD_CONFIG_DIRECTORY32 {
    DWORD Size;
    DWORD TimeDateStamp;
    WORD MajorVersion;
    WORD MinorVersion;
    DWORD GlobalFlagsClear;
    DWORD GlobalFlagsSet;
    DWORD CriticalSectionDefaultTimeout;
    DWORD DeCommitFreeBlockThreshold;
    DWORD DeCommitTotalFreeThreshold;
    DWORD LockPrefixTable;
    DWORD MaximumAllocationSize;
    DWORD VirtualMemoryThreshold;
    DWORD ProcessHeapFlags;
    DWORD ProcessAffinityMask;
    WORD CSDVersion;
    WORD DependentLoadFlags;
    DWORD EditList;
    DWORD SecurityCookie;
    DWORD SEHandlerTable;
    DWORD SEHandlerCount;
    DWORD GuardCFCheckFunctionPointer;
    DWORD GuardCFDispatchFunctionPointer;
    DWORD GuardCFFunctionTable;
    DWORD GuardCFFunctionCount;
    DWORD GuardFlags;
    IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;
    DWORD GuardAddressTakenIatEntryTable;
    DWORD GuardAddressTakenIatEntryCount;
    DWORD GuardLongJumpTargetTable;
    DWORD GuardLongJumpTargetCount;
    DWORD DynamicValueRelocTable;
    DWORD CHPEMetadataPointer;
    DWORD GuardRFFailureRoutine;
    DWORD GuardRFFailureRoutineFunctionPointer;
    DWORD DynamicValueRelocTableOffset;
    WORD DynamicValueRelocTableSection;
    WORD Reserved2;
    DWORD GuardRFVerifyStackPointerFunctionPointer;
    DWORD HotPatchTableOffset;
    DWORD Reserved3;
    DWORD EnclaveConfigurationPointer;
    DWORD VolatileMetadataPointer;
    DWORD GuardEHContinuationTable;
    DWORD GuardEHContinuationCount;
    DWORD GuardXFGCheckFunctionPointer;
    DWORD GuardXFGDispatchFunctionPointer;
    DWORD GuardXFGTableDispatchFunctionPointer;
    DWORD CastGuardOsDeterminedFailureMode;
    DWORD GuardMemcpyFunctionPointer;
    DWORD UmaFunctionPointers;
} IMAGE_LOAD_CONFIG_DIRECTORY32;
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, CharSet = CharSet.Unicode)]
public struct IMAGE_LOAD_CONFIG_DIRECTORY32
{
    public uint Size;
    public uint TimeDateStamp;
    public ushort MajorVersion;
    public ushort MinorVersion;
    public uint GlobalFlagsClear;
    public uint GlobalFlagsSet;
    public uint CriticalSectionDefaultTimeout;
    public uint DeCommitFreeBlockThreshold;
    public uint DeCommitTotalFreeThreshold;
    public uint LockPrefixTable;
    public uint MaximumAllocationSize;
    public uint VirtualMemoryThreshold;
    public uint ProcessHeapFlags;
    public uint ProcessAffinityMask;
    public ushort CSDVersion;
    public ushort DependentLoadFlags;
    public uint EditList;
    public uint SecurityCookie;
    public uint SEHandlerTable;
    public uint SEHandlerCount;
    public uint GuardCFCheckFunctionPointer;
    public uint GuardCFDispatchFunctionPointer;
    public uint GuardCFFunctionTable;
    public uint GuardCFFunctionCount;
    public uint GuardFlags;
    public IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;
    public uint GuardAddressTakenIatEntryTable;
    public uint GuardAddressTakenIatEntryCount;
    public uint GuardLongJumpTargetTable;
    public uint GuardLongJumpTargetCount;
    public uint DynamicValueRelocTable;
    public uint CHPEMetadataPointer;
    public uint GuardRFFailureRoutine;
    public uint GuardRFFailureRoutineFunctionPointer;
    public uint DynamicValueRelocTableOffset;
    public ushort DynamicValueRelocTableSection;
    public ushort Reserved2;
    public uint GuardRFVerifyStackPointerFunctionPointer;
    public uint HotPatchTableOffset;
    public uint Reserved3;
    public uint EnclaveConfigurationPointer;
    public uint VolatileMetadataPointer;
    public uint GuardEHContinuationTable;
    public uint GuardEHContinuationCount;
    public uint GuardXFGCheckFunctionPointer;
    public uint GuardXFGDispatchFunctionPointer;
    public uint GuardXFGTableDispatchFunctionPointer;
    public uint CastGuardOsDeterminedFailureMode;
    public uint GuardMemcpyFunctionPointer;
    public uint 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, CharSet:=CharSet.Unicode)>
Public Structure IMAGE_LOAD_CONFIG_DIRECTORY32
    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 UInteger
    Public DeCommitTotalFreeThreshold As UInteger
    Public LockPrefixTable As UInteger
    Public MaximumAllocationSize As UInteger
    Public VirtualMemoryThreshold As UInteger
    Public ProcessHeapFlags As UInteger
    Public ProcessAffinityMask As UInteger
    Public CSDVersion As UShort
    Public DependentLoadFlags As UShort
    Public EditList As UInteger
    Public SecurityCookie As UInteger
    Public SEHandlerTable As UInteger
    Public SEHandlerCount As UInteger
    Public GuardCFCheckFunctionPointer As UInteger
    Public GuardCFDispatchFunctionPointer As UInteger
    Public GuardCFFunctionTable As UInteger
    Public GuardCFFunctionCount As UInteger
    Public GuardFlags As UInteger
    Public CodeIntegrity As IMAGE_LOAD_CONFIG_CODE_INTEGRITY
    Public GuardAddressTakenIatEntryTable As UInteger
    Public GuardAddressTakenIatEntryCount As UInteger
    Public GuardLongJumpTargetTable As UInteger
    Public GuardLongJumpTargetCount As UInteger
    Public DynamicValueRelocTable As UInteger
    Public CHPEMetadataPointer As UInteger
    Public GuardRFFailureRoutine As UInteger
    Public GuardRFFailureRoutineFunctionPointer As UInteger
    Public DynamicValueRelocTableOffset As UInteger
    Public DynamicValueRelocTableSection As UShort
    Public Reserved2 As UShort
    Public GuardRFVerifyStackPointerFunctionPointer As UInteger
    Public HotPatchTableOffset As UInteger
    Public Reserved3 As UInteger
    Public EnclaveConfigurationPointer As UInteger
    Public VolatileMetadataPointer As UInteger
    Public GuardEHContinuationTable As UInteger
    Public GuardEHContinuationCount As UInteger
    Public GuardXFGCheckFunctionPointer As UInteger
    Public GuardXFGDispatchFunctionPointer As UInteger
    Public GuardXFGTableDispatchFunctionPointer As UInteger
    Public CastGuardOsDeterminedFailureMode As UInteger
    Public GuardMemcpyFunctionPointer As UInteger
    Public UmaFunctionPointers As UInteger
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_DIRECTORY32(ctypes.Structure):
    _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", wintypes.DWORD),
        ("DeCommitTotalFreeThreshold", wintypes.DWORD),
        ("LockPrefixTable", wintypes.DWORD),
        ("MaximumAllocationSize", wintypes.DWORD),
        ("VirtualMemoryThreshold", wintypes.DWORD),
        ("ProcessHeapFlags", wintypes.DWORD),
        ("ProcessAffinityMask", wintypes.DWORD),
        ("CSDVersion", ctypes.c_ushort),
        ("DependentLoadFlags", ctypes.c_ushort),
        ("EditList", wintypes.DWORD),
        ("SecurityCookie", wintypes.DWORD),
        ("SEHandlerTable", wintypes.DWORD),
        ("SEHandlerCount", wintypes.DWORD),
        ("GuardCFCheckFunctionPointer", wintypes.DWORD),
        ("GuardCFDispatchFunctionPointer", wintypes.DWORD),
        ("GuardCFFunctionTable", wintypes.DWORD),
        ("GuardCFFunctionCount", wintypes.DWORD),
        ("GuardFlags", wintypes.DWORD),
        ("CodeIntegrity", IMAGE_LOAD_CONFIG_CODE_INTEGRITY),
        ("GuardAddressTakenIatEntryTable", wintypes.DWORD),
        ("GuardAddressTakenIatEntryCount", wintypes.DWORD),
        ("GuardLongJumpTargetTable", wintypes.DWORD),
        ("GuardLongJumpTargetCount", wintypes.DWORD),
        ("DynamicValueRelocTable", wintypes.DWORD),
        ("CHPEMetadataPointer", wintypes.DWORD),
        ("GuardRFFailureRoutine", wintypes.DWORD),
        ("GuardRFFailureRoutineFunctionPointer", wintypes.DWORD),
        ("DynamicValueRelocTableOffset", wintypes.DWORD),
        ("DynamicValueRelocTableSection", ctypes.c_ushort),
        ("Reserved2", ctypes.c_ushort),
        ("GuardRFVerifyStackPointerFunctionPointer", wintypes.DWORD),
        ("HotPatchTableOffset", wintypes.DWORD),
        ("Reserved3", wintypes.DWORD),
        ("EnclaveConfigurationPointer", wintypes.DWORD),
        ("VolatileMetadataPointer", wintypes.DWORD),
        ("GuardEHContinuationTable", wintypes.DWORD),
        ("GuardEHContinuationCount", wintypes.DWORD),
        ("GuardXFGCheckFunctionPointer", wintypes.DWORD),
        ("GuardXFGDispatchFunctionPointer", wintypes.DWORD),
        ("GuardXFGTableDispatchFunctionPointer", wintypes.DWORD),
        ("CastGuardOsDeterminedFailureMode", wintypes.DWORD),
        ("GuardMemcpyFunctionPointer", wintypes.DWORD),
        ("UmaFunctionPointers", wintypes.DWORD),
    ]
#[repr(C)]
pub struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {
    pub Flags: u16,
    pub Catalog: u16,
    pub CatalogOffset: u32,
    pub Reserved: u32,
}

#[repr(C)]
pub struct IMAGE_LOAD_CONFIG_DIRECTORY32 {
    pub Size: u32,
    pub TimeDateStamp: u32,
    pub MajorVersion: u16,
    pub MinorVersion: u16,
    pub GlobalFlagsClear: u32,
    pub GlobalFlagsSet: u32,
    pub CriticalSectionDefaultTimeout: u32,
    pub DeCommitFreeBlockThreshold: u32,
    pub DeCommitTotalFreeThreshold: u32,
    pub LockPrefixTable: u32,
    pub MaximumAllocationSize: u32,
    pub VirtualMemoryThreshold: u32,
    pub ProcessHeapFlags: u32,
    pub ProcessAffinityMask: u32,
    pub CSDVersion: u16,
    pub DependentLoadFlags: u16,
    pub EditList: u32,
    pub SecurityCookie: u32,
    pub SEHandlerTable: u32,
    pub SEHandlerCount: u32,
    pub GuardCFCheckFunctionPointer: u32,
    pub GuardCFDispatchFunctionPointer: u32,
    pub GuardCFFunctionTable: u32,
    pub GuardCFFunctionCount: u32,
    pub GuardFlags: u32,
    pub CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY,
    pub GuardAddressTakenIatEntryTable: u32,
    pub GuardAddressTakenIatEntryCount: u32,
    pub GuardLongJumpTargetTable: u32,
    pub GuardLongJumpTargetCount: u32,
    pub DynamicValueRelocTable: u32,
    pub CHPEMetadataPointer: u32,
    pub GuardRFFailureRoutine: u32,
    pub GuardRFFailureRoutineFunctionPointer: u32,
    pub DynamicValueRelocTableOffset: u32,
    pub DynamicValueRelocTableSection: u16,
    pub Reserved2: u16,
    pub GuardRFVerifyStackPointerFunctionPointer: u32,
    pub HotPatchTableOffset: u32,
    pub Reserved3: u32,
    pub EnclaveConfigurationPointer: u32,
    pub VolatileMetadataPointer: u32,
    pub GuardEHContinuationTable: u32,
    pub GuardEHContinuationCount: u32,
    pub GuardXFGCheckFunctionPointer: u32,
    pub GuardXFGDispatchFunctionPointer: u32,
    pub GuardXFGTableDispatchFunctionPointer: u32,
    pub CastGuardOsDeterminedFailureMode: u32,
    pub GuardMemcpyFunctionPointer: u32,
    pub UmaFunctionPointers: u32,
}
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_DIRECTORY32 struct {
	Size uint32
	TimeDateStamp uint32
	MajorVersion uint16
	MinorVersion uint16
	GlobalFlagsClear uint32
	GlobalFlagsSet uint32
	CriticalSectionDefaultTimeout uint32
	DeCommitFreeBlockThreshold uint32
	DeCommitTotalFreeThreshold uint32
	LockPrefixTable uint32
	MaximumAllocationSize uint32
	VirtualMemoryThreshold uint32
	ProcessHeapFlags uint32
	ProcessAffinityMask uint32
	CSDVersion uint16
	DependentLoadFlags uint16
	EditList uint32
	SecurityCookie uint32
	SEHandlerTable uint32
	SEHandlerCount uint32
	GuardCFCheckFunctionPointer uint32
	GuardCFDispatchFunctionPointer uint32
	GuardCFFunctionTable uint32
	GuardCFFunctionCount uint32
	GuardFlags uint32
	CodeIntegrity IMAGE_LOAD_CONFIG_CODE_INTEGRITY
	GuardAddressTakenIatEntryTable uint32
	GuardAddressTakenIatEntryCount uint32
	GuardLongJumpTargetTable uint32
	GuardLongJumpTargetCount uint32
	DynamicValueRelocTable uint32
	CHPEMetadataPointer uint32
	GuardRFFailureRoutine uint32
	GuardRFFailureRoutineFunctionPointer uint32
	DynamicValueRelocTableOffset uint32
	DynamicValueRelocTableSection uint16
	Reserved2 uint16
	GuardRFVerifyStackPointerFunctionPointer uint32
	HotPatchTableOffset uint32
	Reserved3 uint32
	EnclaveConfigurationPointer uint32
	VolatileMetadataPointer uint32
	GuardEHContinuationTable uint32
	GuardEHContinuationCount uint32
	GuardXFGCheckFunctionPointer uint32
	GuardXFGDispatchFunctionPointer uint32
	GuardXFGTableDispatchFunctionPointer uint32
	CastGuardOsDeterminedFailureMode uint32
	GuardMemcpyFunctionPointer uint32
	UmaFunctionPointers uint32
}
type
  IMAGE_LOAD_CONFIG_CODE_INTEGRITY = record
    Flags: Word;
    Catalog: Word;
    CatalogOffset: DWORD;
    Reserved: DWORD;
  end;

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

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

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

struct IMAGE_LOAD_CONFIG_DIRECTORY32
{
    uint Size;
    uint TimeDateStamp;
    ushort MajorVersion;
    ushort MinorVersion;
    uint GlobalFlagsClear;
    uint GlobalFlagsSet;
    uint CriticalSectionDefaultTimeout;
    uint DeCommitFreeBlockThreshold;
    uint DeCommitTotalFreeThreshold;
    uint LockPrefixTable;
    uint MaximumAllocationSize;
    uint VirtualMemoryThreshold;
    uint ProcessHeapFlags;
    uint ProcessAffinityMask;
    ushort CSDVersion;
    ushort DependentLoadFlags;
    uint EditList;
    uint SecurityCookie;
    uint SEHandlerTable;
    uint SEHandlerCount;
    uint GuardCFCheckFunctionPointer;
    uint GuardCFDispatchFunctionPointer;
    uint GuardCFFunctionTable;
    uint GuardCFFunctionCount;
    uint GuardFlags;
    IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;
    uint GuardAddressTakenIatEntryTable;
    uint GuardAddressTakenIatEntryCount;
    uint GuardLongJumpTargetTable;
    uint GuardLongJumpTargetCount;
    uint DynamicValueRelocTable;
    uint CHPEMetadataPointer;
    uint GuardRFFailureRoutine;
    uint GuardRFFailureRoutineFunctionPointer;
    uint DynamicValueRelocTableOffset;
    ushort DynamicValueRelocTableSection;
    ushort Reserved2;
    uint GuardRFVerifyStackPointerFunctionPointer;
    uint HotPatchTableOffset;
    uint Reserved3;
    uint EnclaveConfigurationPointer;
    uint VolatileMetadataPointer;
    uint GuardEHContinuationTable;
    uint GuardEHContinuationCount;
    uint GuardXFGCheckFunctionPointer;
    uint GuardXFGDispatchFunctionPointer;
    uint GuardXFGTableDispatchFunctionPointer;
    uint CastGuardOsDeterminedFailureMode;
    uint GuardMemcpyFunctionPointer;
    uint 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_DIRECTORY32 サイズ: 196 バイト(x64)
dim st, 49    ; 4byte整数×49(構造体サイズ 196 / 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 : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; DeCommitTotalFreeThreshold : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; LockPrefixTable : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; MaximumAllocationSize : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; VirtualMemoryThreshold : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ProcessHeapFlags : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ProcessAffinityMask : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; CSDVersion : WORD (+52, 2byte)  wpoke st,52,値  /  値 = wpeek(st,52)
; DependentLoadFlags : WORD (+54, 2byte)  wpoke st,54,値  /  値 = wpeek(st,54)
; EditList : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; SecurityCookie : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; SEHandlerTable : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; SEHandlerCount : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; GuardCFCheckFunctionPointer : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; GuardCFDispatchFunctionPointer : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; GuardCFFunctionTable : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; GuardCFFunctionCount : DWORD (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; GuardFlags : DWORD (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; CodeIntegrity : IMAGE_LOAD_CONFIG_CODE_INTEGRITY (+92, 12byte)  varptr(st)+92 を基点に操作(12byte:入れ子/配列)
; GuardAddressTakenIatEntryTable : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; GuardAddressTakenIatEntryCount : DWORD (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; GuardLongJumpTargetTable : DWORD (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; GuardLongJumpTargetCount : DWORD (+116, 4byte)  st.29 = 値  /  値 = st.29   (lpoke/lpeek も可)
; DynamicValueRelocTable : DWORD (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; CHPEMetadataPointer : DWORD (+124, 4byte)  st.31 = 値  /  値 = st.31   (lpoke/lpeek も可)
; GuardRFFailureRoutine : DWORD (+128, 4byte)  st.32 = 値  /  値 = st.32   (lpoke/lpeek も可)
; GuardRFFailureRoutineFunctionPointer : DWORD (+132, 4byte)  st.33 = 値  /  値 = st.33   (lpoke/lpeek も可)
; DynamicValueRelocTableOffset : DWORD (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; DynamicValueRelocTableSection : WORD (+140, 2byte)  wpoke st,140,値  /  値 = wpeek(st,140)
; Reserved2 : WORD (+142, 2byte)  wpoke st,142,値  /  値 = wpeek(st,142)
; GuardRFVerifyStackPointerFunctionPointer : DWORD (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; HotPatchTableOffset : DWORD (+148, 4byte)  st.37 = 値  /  値 = st.37   (lpoke/lpeek も可)
; Reserved3 : DWORD (+152, 4byte)  st.38 = 値  /  値 = st.38   (lpoke/lpeek も可)
; EnclaveConfigurationPointer : DWORD (+156, 4byte)  st.39 = 値  /  値 = st.39   (lpoke/lpeek も可)
; VolatileMetadataPointer : DWORD (+160, 4byte)  st.40 = 値  /  値 = st.40   (lpoke/lpeek も可)
; GuardEHContinuationTable : DWORD (+164, 4byte)  st.41 = 値  /  値 = st.41   (lpoke/lpeek も可)
; GuardEHContinuationCount : DWORD (+168, 4byte)  st.42 = 値  /  値 = st.42   (lpoke/lpeek も可)
; GuardXFGCheckFunctionPointer : DWORD (+172, 4byte)  st.43 = 値  /  値 = st.43   (lpoke/lpeek も可)
; GuardXFGDispatchFunctionPointer : DWORD (+176, 4byte)  st.44 = 値  /  値 = st.44   (lpoke/lpeek も可)
; GuardXFGTableDispatchFunctionPointer : DWORD (+180, 4byte)  st.45 = 値  /  値 = st.45   (lpoke/lpeek も可)
; CastGuardOsDeterminedFailureMode : DWORD (+184, 4byte)  st.46 = 値  /  値 = st.46   (lpoke/lpeek も可)
; GuardMemcpyFunctionPointer : DWORD (+188, 4byte)  st.47 = 値  /  値 = st.47   (lpoke/lpeek も可)
; UmaFunctionPointers : DWORD (+192, 4byte)  st.48 = 値  /  値 = st.48   (lpoke/lpeek も可)
; ※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_DIRECTORY32
    #field int Size
    #field int TimeDateStamp
    #field short MajorVersion
    #field short MinorVersion
    #field int GlobalFlagsClear
    #field int GlobalFlagsSet
    #field int CriticalSectionDefaultTimeout
    #field int DeCommitFreeBlockThreshold
    #field int DeCommitTotalFreeThreshold
    #field int LockPrefixTable
    #field int MaximumAllocationSize
    #field int VirtualMemoryThreshold
    #field int ProcessHeapFlags
    #field int ProcessAffinityMask
    #field short CSDVersion
    #field short DependentLoadFlags
    #field int EditList
    #field int SecurityCookie
    #field int SEHandlerTable
    #field int SEHandlerCount
    #field int GuardCFCheckFunctionPointer
    #field int GuardCFDispatchFunctionPointer
    #field int GuardCFFunctionTable
    #field int GuardCFFunctionCount
    #field int GuardFlags
    #field IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity
    #field int GuardAddressTakenIatEntryTable
    #field int GuardAddressTakenIatEntryCount
    #field int GuardLongJumpTargetTable
    #field int GuardLongJumpTargetCount
    #field int DynamicValueRelocTable
    #field int CHPEMetadataPointer
    #field int GuardRFFailureRoutine
    #field int GuardRFFailureRoutineFunctionPointer
    #field int DynamicValueRelocTableOffset
    #field short DynamicValueRelocTableSection
    #field short Reserved2
    #field int GuardRFVerifyStackPointerFunctionPointer
    #field int HotPatchTableOffset
    #field int Reserved3
    #field int EnclaveConfigurationPointer
    #field int VolatileMetadataPointer
    #field int GuardEHContinuationTable
    #field int GuardEHContinuationCount
    #field int GuardXFGCheckFunctionPointer
    #field int GuardXFGDispatchFunctionPointer
    #field int GuardXFGTableDispatchFunctionPointer
    #field int CastGuardOsDeterminedFailureMode
    #field int GuardMemcpyFunctionPointer
    #field int UmaFunctionPointers
#endstruct

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