ホーム › System.Diagnostics.Debug › IMAGE_FUNCTION_ENTRY
IMAGE_FUNCTION_ENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| StartingAddress | DWORD | 4 | +0 | +0 | 関数の開始アドレス(RVA)。 |
| EndingAddress | DWORD | 4 | +4 | +4 | 関数の終了アドレス(RVA)。 |
| EndOfPrologue | DWORD | 4 | +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 Structureimport 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: uint32struct 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