ホーム › Devices.Dvd › AACS_SERIAL_NUMBER
AACS_SERIAL_NUMBER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| PrerecordedSerialNumber | BYTE | 16 | +0 | +0 | プリレコードされたシリアル番号を保持するバイト配列。 |
| MAC | BYTE | 16 | +16 | +16 | シリアル番号の完全性を検証するメッセージ認証コードを保持するバイト配列。 |
各言語での定義
#include <windows.h>
// AACS_SERIAL_NUMBER (x64 32 / x86 32 バイト)
typedef struct AACS_SERIAL_NUMBER {
BYTE PrerecordedSerialNumber[16];
BYTE MAC[16];
} AACS_SERIAL_NUMBER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AACS_SERIAL_NUMBER
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] PrerecordedSerialNumber;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] MAC;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AACS_SERIAL_NUMBER
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public PrerecordedSerialNumber() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public MAC() As Byte
End Structureimport ctypes
from ctypes import wintypes
class AACS_SERIAL_NUMBER(ctypes.Structure):
_fields_ = [
("PrerecordedSerialNumber", ctypes.c_ubyte * 16),
("MAC", ctypes.c_ubyte * 16),
]#[repr(C)]
pub struct AACS_SERIAL_NUMBER {
pub PrerecordedSerialNumber: [u8; 16],
pub MAC: [u8; 16],
}import "golang.org/x/sys/windows"
type AACS_SERIAL_NUMBER struct {
PrerecordedSerialNumber [16]byte
MAC [16]byte
}type
AACS_SERIAL_NUMBER = record
PrerecordedSerialNumber: array[0..15] of Byte;
MAC: array[0..15] of Byte;
end;const AACS_SERIAL_NUMBER = extern struct {
PrerecordedSerialNumber: [16]u8,
MAC: [16]u8,
};type
AACS_SERIAL_NUMBER {.bycopy.} = object
PrerecordedSerialNumber: array[16, uint8]
MAC: array[16, uint8]struct AACS_SERIAL_NUMBER
{
ubyte[16] PrerecordedSerialNumber;
ubyte[16] MAC;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AACS_SERIAL_NUMBER サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; PrerecordedSerialNumber : BYTE (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MAC : BYTE (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AACS_SERIAL_NUMBER
#field byte PrerecordedSerialNumber 16
#field byte MAC 16
#endstruct
stdim st, AACS_SERIAL_NUMBER ; NSTRUCT 変数を確保