ホーム › 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 | 関数の開始位置のイメージアドレスです。 |
| EndingAddress | DWORD | 4 | +4 | +4 | 関数の終了位置のイメージアドレスです。 |
| EndOfPrologue | DWORD | 4 | +8 | +8 | プロローグコードの終了位置のイメージアドレスです。 |
公式ドキュメント
関数テーブル内のエントリを表します。
解説(Remarks)
64 ビットをサポートするために、次の定義が用意されています。
typedef struct _IMAGE_FUNCTION_ENTRY64 {
ULONGLONG StartingAddress;
ULONGLONG EndingAddress;
union {
ULONGLONG EndOfPrologue;
ULONGLONG UnwindInfoAddress;
};
} IMAGE_FUNCTION_ENTRY64, *PIMAGE_FUNCTION_ENTRY64;
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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