ホーム › System.Diagnostics.Debug.Extensions › DEBUG_SYMBOL_ENTRY
DEBUG_SYMBOL_ENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ModuleBase | ULONGLONG | 8 | +0 | +0 | シンボルが属するモジュールの基底アドレス。 |
| Offset | ULONGLONG | 8 | +8 | +8 | シンボルのアドレス(または基底からのオフセット)。 |
| Id | ULONGLONG | 8 | +16 | +16 | シンボルを識別する内部ID。 |
| Arg64 | ULONGLONG | 8 | +24 | +24 | シンボル種別に応じた64ビット汎用引数。 |
| Size | DWORD | 4 | +32 | +32 | シンボルのバイトサイズ。 |
| Flags | DWORD | 4 | +36 | +36 | シンボルの属性フラグ(DEBUG_SYMBOL_*)。 |
| TypeId | DWORD | 4 | +40 | +40 | シンボルの型を識別するID。 |
| NameSize | DWORD | 4 | +44 | +44 | シンボル名文字列の必要バイト数。 |
| Token | DWORD | 4 | +48 | +48 | メタデータトークン(マネージドシンボル用)。 |
| Tag | DWORD | 4 | +52 | +52 | シンボルのタグ(SymTagEnum)を示す。 |
| Arg32 | DWORD | 4 | +56 | +56 | シンボル種別に応じた32ビット汎用引数。 |
| Reserved | DWORD | 4 | +60 | +60 | 予約フィールド。0が設定される。 |
各言語での定義
#include <windows.h>
// DEBUG_SYMBOL_ENTRY (x64 64 / x86 64 バイト)
typedef struct DEBUG_SYMBOL_ENTRY {
ULONGLONG ModuleBase;
ULONGLONG Offset;
ULONGLONG Id;
ULONGLONG Arg64;
DWORD Size;
DWORD Flags;
DWORD TypeId;
DWORD NameSize;
DWORD Token;
DWORD Tag;
DWORD Arg32;
DWORD Reserved;
} DEBUG_SYMBOL_ENTRY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_SYMBOL_ENTRY
{
public ulong ModuleBase;
public ulong Offset;
public ulong Id;
public ulong Arg64;
public uint Size;
public uint Flags;
public uint TypeId;
public uint NameSize;
public uint Token;
public uint Tag;
public uint Arg32;
public uint Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_SYMBOL_ENTRY
Public ModuleBase As ULong
Public Offset As ULong
Public Id As ULong
Public Arg64 As ULong
Public Size As UInteger
Public Flags As UInteger
Public TypeId As UInteger
Public NameSize As UInteger
Public Token As UInteger
Public Tag As UInteger
Public Arg32 As UInteger
Public Reserved As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DEBUG_SYMBOL_ENTRY(ctypes.Structure):
_fields_ = [
("ModuleBase", ctypes.c_ulonglong),
("Offset", ctypes.c_ulonglong),
("Id", ctypes.c_ulonglong),
("Arg64", ctypes.c_ulonglong),
("Size", wintypes.DWORD),
("Flags", wintypes.DWORD),
("TypeId", wintypes.DWORD),
("NameSize", wintypes.DWORD),
("Token", wintypes.DWORD),
("Tag", wintypes.DWORD),
("Arg32", wintypes.DWORD),
("Reserved", wintypes.DWORD),
]#[repr(C)]
pub struct DEBUG_SYMBOL_ENTRY {
pub ModuleBase: u64,
pub Offset: u64,
pub Id: u64,
pub Arg64: u64,
pub Size: u32,
pub Flags: u32,
pub TypeId: u32,
pub NameSize: u32,
pub Token: u32,
pub Tag: u32,
pub Arg32: u32,
pub Reserved: u32,
}import "golang.org/x/sys/windows"
type DEBUG_SYMBOL_ENTRY struct {
ModuleBase uint64
Offset uint64
Id uint64
Arg64 uint64
Size uint32
Flags uint32
TypeId uint32
NameSize uint32
Token uint32
Tag uint32
Arg32 uint32
Reserved uint32
}type
DEBUG_SYMBOL_ENTRY = record
ModuleBase: UInt64;
Offset: UInt64;
Id: UInt64;
Arg64: UInt64;
Size: DWORD;
Flags: DWORD;
TypeId: DWORD;
NameSize: DWORD;
Token: DWORD;
Tag: DWORD;
Arg32: DWORD;
Reserved: DWORD;
end;const DEBUG_SYMBOL_ENTRY = extern struct {
ModuleBase: u64,
Offset: u64,
Id: u64,
Arg64: u64,
Size: u32,
Flags: u32,
TypeId: u32,
NameSize: u32,
Token: u32,
Tag: u32,
Arg32: u32,
Reserved: u32,
};type
DEBUG_SYMBOL_ENTRY {.bycopy.} = object
ModuleBase: uint64
Offset: uint64
Id: uint64
Arg64: uint64
Size: uint32
Flags: uint32
TypeId: uint32
NameSize: uint32
Token: uint32
Tag: uint32
Arg32: uint32
Reserved: uint32struct DEBUG_SYMBOL_ENTRY
{
ulong ModuleBase;
ulong Offset;
ulong Id;
ulong Arg64;
uint Size;
uint Flags;
uint TypeId;
uint NameSize;
uint Token;
uint Tag;
uint Arg32;
uint Reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_SYMBOL_ENTRY サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ModuleBase : 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,上位
; Id : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Arg64 : 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 も可)
; NameSize : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Token : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; Tag : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; Arg32 : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; Reserved : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_SYMBOL_ENTRY
#field int64 ModuleBase
#field int64 Offset
#field int64 Id
#field int64 Arg64
#field int Size
#field int Flags
#field int TypeId
#field int NameSize
#field int Token
#field int Tag
#field int Arg32
#field int Reserved
#endstruct
stdim st, DEBUG_SYMBOL_ENTRY ; NSTRUCT 変数を確保
st->ModuleBase = 100
mes "ModuleBase=" + st->ModuleBase