ホーム › System.Antimalware › AMSI_UAC_REQUEST_COM_INFO
AMSI_UAC_REQUEST_COM_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ulLength | DWORD | 4 | +0 | +0 | この構造体のバイト長。 |
| lpwszServerBinary | LPWSTR | 8/4 | +8 | +4 | 昇格対象のCOMサーバーバイナリのパス文字列。 |
| lpwszRequestor | LPWSTR | 8/4 | +16 | +8 | 昇格を要求した呼び出し元を示す文字列。 |
| Clsid | GUID | 16 | +24 | +12 | 対象COMオブジェクトのクラスID(CLSID)。 |
各言語での定義
#include <windows.h>
// AMSI_UAC_REQUEST_COM_INFO (x64 40 / x86 28 バイト)
typedef struct AMSI_UAC_REQUEST_COM_INFO {
DWORD ulLength;
LPWSTR lpwszServerBinary;
LPWSTR lpwszRequestor;
GUID Clsid;
} AMSI_UAC_REQUEST_COM_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AMSI_UAC_REQUEST_COM_INFO
{
public uint ulLength;
public IntPtr lpwszServerBinary;
public IntPtr lpwszRequestor;
public Guid Clsid;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AMSI_UAC_REQUEST_COM_INFO
Public ulLength As UInteger
Public lpwszServerBinary As IntPtr
Public lpwszRequestor As IntPtr
Public Clsid As Guid
End Structureimport ctypes
from ctypes import wintypes
class AMSI_UAC_REQUEST_COM_INFO(ctypes.Structure):
_fields_ = [
("ulLength", wintypes.DWORD),
("lpwszServerBinary", ctypes.c_void_p),
("lpwszRequestor", ctypes.c_void_p),
("Clsid", GUID),
]#[repr(C)]
pub struct AMSI_UAC_REQUEST_COM_INFO {
pub ulLength: u32,
pub lpwszServerBinary: *mut core::ffi::c_void,
pub lpwszRequestor: *mut core::ffi::c_void,
pub Clsid: GUID,
}import "golang.org/x/sys/windows"
type AMSI_UAC_REQUEST_COM_INFO struct {
ulLength uint32
lpwszServerBinary uintptr
lpwszRequestor uintptr
Clsid windows.GUID
}type
AMSI_UAC_REQUEST_COM_INFO = record
ulLength: DWORD;
lpwszServerBinary: Pointer;
lpwszRequestor: Pointer;
Clsid: TGUID;
end;const AMSI_UAC_REQUEST_COM_INFO = extern struct {
ulLength: u32,
lpwszServerBinary: ?*anyopaque,
lpwszRequestor: ?*anyopaque,
Clsid: GUID,
};type
AMSI_UAC_REQUEST_COM_INFO {.bycopy.} = object
ulLength: uint32
lpwszServerBinary: pointer
lpwszRequestor: pointer
Clsid: GUIDstruct AMSI_UAC_REQUEST_COM_INFO
{
uint ulLength;
void* lpwszServerBinary;
void* lpwszRequestor;
GUID Clsid;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; AMSI_UAC_REQUEST_COM_INFO サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; ulLength : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpwszServerBinary : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpwszRequestor : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Clsid : GUID (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AMSI_UAC_REQUEST_COM_INFO サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; ulLength : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpwszServerBinary : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lpwszRequestor : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Clsid : GUID (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global AMSI_UAC_REQUEST_COM_INFO
#field int ulLength
#field intptr lpwszServerBinary
#field intptr lpwszRequestor
#field GUID Clsid
#endstruct
stdim st, AMSI_UAC_REQUEST_COM_INFO ; NSTRUCT 変数を確保
st->ulLength = 100
mes "ulLength=" + st->ulLength