ホーム › System.Diagnostics.Debug.Extensions › DEBUG_TYPED_DATA
DEBUG_TYPED_DATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ModBase | ULONGLONG | 8 | +0 | +0 | 型情報が属するモジュールの基底アドレス。 |
| Offset | ULONGLONG | 8 | +8 | +8 | データのアドレスまたはオフセット。 |
| EngineHandle | ULONGLONG | 8 | +16 | +16 | エンジン内部の型データハンドル。 |
| Data | ULONGLONG | 8 | +24 | +24 | データ値(即値またはアドレス参照)。 |
| Size | DWORD | 4 | +32 | +32 | データのバイトサイズ。 |
| Flags | DWORD | 4 | +36 | +36 | 型付きデータの属性フラグ。 |
| TypeId | DWORD | 4 | +40 | +40 | データの型を識別するID。 |
| BaseTypeId | DWORD | 4 | +44 | +44 | ポインタ/配列等の基底型のID。 |
| Tag | DWORD | 4 | +48 | +48 | シンボルのタグ(SymTagEnum)を示す。 |
| Register | DWORD | 4 | +52 | +52 | 値が格納されているレジスタ番号(該当時)。 |
| Internal | ULONGLONG | 72 | +56 | +56 | エンジン内部用の予約値。 |
各言語での定義
#include <windows.h>
// DEBUG_TYPED_DATA (x64 128 / x86 128 バイト)
typedef struct DEBUG_TYPED_DATA {
ULONGLONG ModBase;
ULONGLONG Offset;
ULONGLONG EngineHandle;
ULONGLONG Data;
DWORD Size;
DWORD Flags;
DWORD TypeId;
DWORD BaseTypeId;
DWORD Tag;
DWORD Register;
ULONGLONG Internal[9];
} DEBUG_TYPED_DATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_TYPED_DATA
{
public ulong ModBase;
public ulong Offset;
public ulong EngineHandle;
public ulong Data;
public uint Size;
public uint Flags;
public uint TypeId;
public uint BaseTypeId;
public uint Tag;
public uint Register;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)] public ulong[] Internal;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_TYPED_DATA
Public ModBase As ULong
Public Offset As ULong
Public EngineHandle As ULong
Public Data As ULong
Public Size As UInteger
Public Flags As UInteger
Public TypeId As UInteger
Public BaseTypeId As UInteger
Public Tag As UInteger
Public Register As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=9)> Public Internal() As ULong
End Structureimport ctypes
from ctypes import wintypes
class DEBUG_TYPED_DATA(ctypes.Structure):
_fields_ = [
("ModBase", ctypes.c_ulonglong),
("Offset", ctypes.c_ulonglong),
("EngineHandle", ctypes.c_ulonglong),
("Data", ctypes.c_ulonglong),
("Size", wintypes.DWORD),
("Flags", wintypes.DWORD),
("TypeId", wintypes.DWORD),
("BaseTypeId", wintypes.DWORD),
("Tag", wintypes.DWORD),
("Register", wintypes.DWORD),
("Internal", ctypes.c_ulonglong * 9),
]#[repr(C)]
pub struct DEBUG_TYPED_DATA {
pub ModBase: u64,
pub Offset: u64,
pub EngineHandle: u64,
pub Data: u64,
pub Size: u32,
pub Flags: u32,
pub TypeId: u32,
pub BaseTypeId: u32,
pub Tag: u32,
pub Register: u32,
pub Internal: [u64; 9],
}import "golang.org/x/sys/windows"
type DEBUG_TYPED_DATA struct {
ModBase uint64
Offset uint64
EngineHandle uint64
Data uint64
Size uint32
Flags uint32
TypeId uint32
BaseTypeId uint32
Tag uint32
Register uint32
Internal [9]uint64
}type
DEBUG_TYPED_DATA = record
ModBase: UInt64;
Offset: UInt64;
EngineHandle: UInt64;
Data: UInt64;
Size: DWORD;
Flags: DWORD;
TypeId: DWORD;
BaseTypeId: DWORD;
Tag: DWORD;
Register: DWORD;
Internal: array[0..8] of UInt64;
end;const DEBUG_TYPED_DATA = extern struct {
ModBase: u64,
Offset: u64,
EngineHandle: u64,
Data: u64,
Size: u32,
Flags: u32,
TypeId: u32,
BaseTypeId: u32,
Tag: u32,
Register: u32,
Internal: [9]u64,
};type
DEBUG_TYPED_DATA {.bycopy.} = object
ModBase: uint64
Offset: uint64
EngineHandle: uint64
Data: uint64
Size: uint32
Flags: uint32
TypeId: uint32
BaseTypeId: uint32
Tag: uint32
Register: uint32
Internal: array[9, uint64]struct DEBUG_TYPED_DATA
{
ulong ModBase;
ulong Offset;
ulong EngineHandle;
ulong Data;
uint Size;
uint Flags;
uint TypeId;
uint BaseTypeId;
uint Tag;
uint Register;
ulong[9] Internal;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_TYPED_DATA サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; ModBase : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Offset : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; EngineHandle : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Data : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Size : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Flags : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; TypeId : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; BaseTypeId : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Tag : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; Register : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; Internal : ULONGLONG (+56, 72byte) varptr(st)+56 を基点に操作(72byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_TYPED_DATA
#field int64 ModBase
#field int64 Offset
#field int64 EngineHandle
#field int64 Data
#field int Size
#field int Flags
#field int TypeId
#field int BaseTypeId
#field int Tag
#field int Register
#field int64 Internal 9
#endstruct
stdim st, DEBUG_TYPED_DATA ; NSTRUCT 変数を確保
st->ModBase = 100
mes "ModBase=" + st->ModBase