ホーム › Security.Authentication.Identity › USER_SESSION_KEY
USER_SESSION_KEY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| data | CYPHER_BLOCK | 16 | +0 | +0 | ユーザーセッションキーを構成する暗号ブロック配列。 |
各言語での定義
#include <windows.h>
// CYPHER_BLOCK (x64 8 / x86 8 バイト)
typedef struct CYPHER_BLOCK {
CHAR data[8];
} CYPHER_BLOCK;
// USER_SESSION_KEY (x64 16 / x86 16 バイト)
typedef struct USER_SESSION_KEY {
CYPHER_BLOCK data[2];
} USER_SESSION_KEY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CYPHER_BLOCK
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public sbyte[] data;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USER_SESSION_KEY
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public CYPHER_BLOCK[] data;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CYPHER_BLOCK
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public data() As SByte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure USER_SESSION_KEY
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public data() As CYPHER_BLOCK
End Structureimport ctypes
from ctypes import wintypes
class CYPHER_BLOCK(ctypes.Structure):
_fields_ = [
("data", ctypes.c_byte * 8),
]
class USER_SESSION_KEY(ctypes.Structure):
_fields_ = [
("data", CYPHER_BLOCK * 2),
]#[repr(C)]
pub struct CYPHER_BLOCK {
pub data: [i8; 8],
}
#[repr(C)]
pub struct USER_SESSION_KEY {
pub data: [CYPHER_BLOCK; 2],
}import "golang.org/x/sys/windows"
type CYPHER_BLOCK struct {
data [8]int8
}
type USER_SESSION_KEY struct {
data [2]CYPHER_BLOCK
}type
CYPHER_BLOCK = record
data: array[0..7] of Shortint;
end;
USER_SESSION_KEY = record
data: array[0..1] of CYPHER_BLOCK;
end;const CYPHER_BLOCK = extern struct {
data: [8]i8,
};
const USER_SESSION_KEY = extern struct {
data: [2]CYPHER_BLOCK,
};type
CYPHER_BLOCK {.bycopy.} = object
data: array[8, int8]
USER_SESSION_KEY {.bycopy.} = object
data: array[2, CYPHER_BLOCK]struct CYPHER_BLOCK
{
byte[8] data;
}
struct USER_SESSION_KEY
{
CYPHER_BLOCK[2] data;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; USER_SESSION_KEY サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; data : CYPHER_BLOCK (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CYPHER_BLOCK
#field byte data 8
#endstruct
#defstruct global USER_SESSION_KEY
#field CYPHER_BLOCK data 2
#endstruct
stdim st, USER_SESSION_KEY ; NSTRUCT 変数を確保