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

POINTER_SEARCH_PHYSICAL

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

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

フィールド

フィールドサイズx64x86説明
OffsetULONGLONG8+0+0ポインタ検索を行う物理メモリの開始オフセット。
LengthULONGLONG8+8+8検索対象範囲のバイト長。
PointerMinULONGLONG8+16+16一致とみなすポインタ値の下限。
PointerMaxULONGLONG8+24+24一致とみなすポインタ値の上限。
FlagsDWORD4+32+32検索動作を制御するフラグ。
MatchOffsetsULONGLONG*8/4+40+36一致が見つかったオフセットを格納する配列へのポインタ。
MatchOffsetsSizeDWORD4+48+40MatchOffsets配列の容量(要素数)。
MatchOffsetsCountDWORD4+52+44実際に見つかった一致件数(出力)。

各言語での定義

#include <windows.h>

// POINTER_SEARCH_PHYSICAL  (x64 56 / x86 48 バイト)
typedef struct POINTER_SEARCH_PHYSICAL {
    ULONGLONG Offset;
    ULONGLONG Length;
    ULONGLONG PointerMin;
    ULONGLONG PointerMax;
    DWORD Flags;
    ULONGLONG* MatchOffsets;
    DWORD MatchOffsetsSize;
    DWORD MatchOffsetsCount;
} POINTER_SEARCH_PHYSICAL;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTER_SEARCH_PHYSICAL
{
    public ulong Offset;
    public ulong Length;
    public ulong PointerMin;
    public ulong PointerMax;
    public uint Flags;
    public IntPtr MatchOffsets;
    public uint MatchOffsetsSize;
    public uint MatchOffsetsCount;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTER_SEARCH_PHYSICAL
    Public Offset As ULong
    Public Length As ULong
    Public PointerMin As ULong
    Public PointerMax As ULong
    Public Flags As UInteger
    Public MatchOffsets As IntPtr
    Public MatchOffsetsSize As UInteger
    Public MatchOffsetsCount As UInteger
End Structure
import ctypes
from ctypes import wintypes

class POINTER_SEARCH_PHYSICAL(ctypes.Structure):
    _fields_ = [
        ("Offset", ctypes.c_ulonglong),
        ("Length", ctypes.c_ulonglong),
        ("PointerMin", ctypes.c_ulonglong),
        ("PointerMax", ctypes.c_ulonglong),
        ("Flags", wintypes.DWORD),
        ("MatchOffsets", ctypes.c_void_p),
        ("MatchOffsetsSize", wintypes.DWORD),
        ("MatchOffsetsCount", wintypes.DWORD),
    ]
#[repr(C)]
pub struct POINTER_SEARCH_PHYSICAL {
    pub Offset: u64,
    pub Length: u64,
    pub PointerMin: u64,
    pub PointerMax: u64,
    pub Flags: u32,
    pub MatchOffsets: *mut core::ffi::c_void,
    pub MatchOffsetsSize: u32,
    pub MatchOffsetsCount: u32,
}
import "golang.org/x/sys/windows"

type POINTER_SEARCH_PHYSICAL struct {
	Offset uint64
	Length uint64
	PointerMin uint64
	PointerMax uint64
	Flags uint32
	MatchOffsets uintptr
	MatchOffsetsSize uint32
	MatchOffsetsCount uint32
}
type
  POINTER_SEARCH_PHYSICAL = record
    Offset: UInt64;
    Length: UInt64;
    PointerMin: UInt64;
    PointerMax: UInt64;
    Flags: DWORD;
    MatchOffsets: Pointer;
    MatchOffsetsSize: DWORD;
    MatchOffsetsCount: DWORD;
  end;
const POINTER_SEARCH_PHYSICAL = extern struct {
    Offset: u64,
    Length: u64,
    PointerMin: u64,
    PointerMax: u64,
    Flags: u32,
    MatchOffsets: ?*anyopaque,
    MatchOffsetsSize: u32,
    MatchOffsetsCount: u32,
};
type
  POINTER_SEARCH_PHYSICAL {.bycopy.} = object
    Offset: uint64
    Length: uint64
    PointerMin: uint64
    PointerMax: uint64
    Flags: uint32
    MatchOffsets: pointer
    MatchOffsetsSize: uint32
    MatchOffsetsCount: uint32
struct POINTER_SEARCH_PHYSICAL
{
    ulong Offset;
    ulong Length;
    ulong PointerMin;
    ulong PointerMax;
    uint Flags;
    void* MatchOffsets;
    uint MatchOffsetsSize;
    uint MatchOffsetsCount;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; POINTER_SEARCH_PHYSICAL サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Offset : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Length : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; PointerMin : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; PointerMax : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Flags : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; MatchOffsets : ULONGLONG* (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; MatchOffsetsSize : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; MatchOffsetsCount : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; POINTER_SEARCH_PHYSICAL サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Offset : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Length : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; PointerMin : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; PointerMax : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Flags : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; MatchOffsets : ULONGLONG* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; MatchOffsetsSize : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; MatchOffsetsCount : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global POINTER_SEARCH_PHYSICAL
    #field int64 Offset
    #field int64 Length
    #field int64 PointerMin
    #field int64 PointerMax
    #field int Flags
    #field intptr MatchOffsets
    #field int MatchOffsetsSize
    #field int MatchOffsetsCount
#endstruct

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