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

IMAGE_FUNCTION_ENTRY

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

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

フィールド

フィールドサイズx64x86説明
StartingAddressDWORD4+0+0関数の開始アドレス(RVA)。
EndingAddressDWORD4+4+4関数の終了アドレス(RVA)。
EndOfPrologueDWORD4+8+8プロローグ終了位置のアドレス。

各言語での定義

#include <windows.h>

// IMAGE_FUNCTION_ENTRY  (x64 12 / x86 12 バイト)
typedef struct IMAGE_FUNCTION_ENTRY {
    DWORD StartingAddress;
    DWORD EndingAddress;
    DWORD EndOfPrologue;
} IMAGE_FUNCTION_ENTRY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IMAGE_FUNCTION_ENTRY
{
    public uint StartingAddress;
    public uint EndingAddress;
    public uint EndOfPrologue;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IMAGE_FUNCTION_ENTRY
    Public StartingAddress As UInteger
    Public EndingAddress As UInteger
    Public EndOfPrologue As UInteger
End Structure
import ctypes
from ctypes import wintypes

class IMAGE_FUNCTION_ENTRY(ctypes.Structure):
    _fields_ = [
        ("StartingAddress", wintypes.DWORD),
        ("EndingAddress", wintypes.DWORD),
        ("EndOfPrologue", wintypes.DWORD),
    ]
#[repr(C)]
pub struct IMAGE_FUNCTION_ENTRY {
    pub StartingAddress: u32,
    pub EndingAddress: u32,
    pub EndOfPrologue: u32,
}
import "golang.org/x/sys/windows"

type IMAGE_FUNCTION_ENTRY struct {
	StartingAddress uint32
	EndingAddress uint32
	EndOfPrologue uint32
}
type
  IMAGE_FUNCTION_ENTRY = record
    StartingAddress: DWORD;
    EndingAddress: DWORD;
    EndOfPrologue: DWORD;
  end;
const IMAGE_FUNCTION_ENTRY = extern struct {
    StartingAddress: u32,
    EndingAddress: u32,
    EndOfPrologue: u32,
};
type
  IMAGE_FUNCTION_ENTRY {.bycopy.} = object
    StartingAddress: uint32
    EndingAddress: uint32
    EndOfPrologue: uint32
struct IMAGE_FUNCTION_ENTRY
{
    uint StartingAddress;
    uint EndingAddress;
    uint EndOfPrologue;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMAGE_FUNCTION_ENTRY サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; StartingAddress : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; EndingAddress : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; EndOfPrologue : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IMAGE_FUNCTION_ENTRY
    #field int StartingAddress
    #field int EndingAddress
    #field int EndOfPrologue
#endstruct

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