いしな.net

PCEOYC .xyファイル形式

ファイルヘッダ

.xyファイルのヘッダは以下の24Byteとなる。
名称 説明
xyfType int32 0x59454350(リトルエンディアン), "PCEY"に設定されねばならない。
xyfVersion int32 0x00000001(リトルエンディアン)に設定されねばならない。
attributeOffset int32 モジュール属性領域のファイル先頭からのオフセット。
typeDefinitionOffset int32 型定義領域のファイル先頭からのオフセット。
dataOffset int32 データ領域のファイル先頭からのオフセット。
データ領域が存在しない場合はゼロ。
codeOffset int32 コード領域のファイル先頭からのオフセット。
2014/01/04(土)

モジュール属性領域

列挙値

FileType
value description
0x00(0) .xy(Executable for ycvm)
0x01(1) .xy(Executable for universal)
0x02(2) .xy(Executable for x86)
0x03(3) .xy(Executable for x86_64)
0x08(8) .dy(Shared Library for ycvm)
0x09(9) .dy(Shared Library for universal)
0x0a(10) .dy(Shared Library for x86)
0x0b(11) .dy(Shared Library for x86_64)
0x10(16) .dll(Windows DLL for x86)
0x11(17) .dll(Windows DLL for x86_64)
0x12(18) .dll(Windows DLL for i64)
0x20(32) .dylib(MacOS X universal)
0x21(33) .dylib(MacOS X for x86)
0x22(34) .dylib(MacOS X for x86_64)
0x40(64) .so(FreeBSD for x86)
0x41(65) .so(FreeBSD for x86_64)
0x80(128) .so(Linux for x86)
0x81(129) .so(Linux for x86_64)

使用する型

XYFModuleSpec
モジュールファイルの具体的な指定
名称 説明
filename string モジュールファイルの名前。
filetype int8 ファイルの種別を表すFileTypeの値
minVer int64 モジュールの最小バージョン
LinkedModule
リンクするモジュールの一覧。
countがゼロの場合、それ以降のデータは含まれない。
名称 説明
count int16 モジュールの数
fileSpecs XYFModuleSpec[] ファイル指定のリスト。
Signature
署名。
signSizeがゼロの場合、それ以降のデータは含まれない。
名称 説明
signSize int16 署名のバイト数。
signatureBody int8[] 署名のバイトデータ。
signType int8 署名の種別。とりあえずゼロ。
pubKeyURL String Public-KeyのURL。

モジュール属性

名称 説明
moduleVersion int64 モジュールのバージョン
fileType int8 モジュールの種別を表すFileType値
linkedModule LinkedModule リンクされるモジュール
signature Signature このモジュールの署名
2014/01/05(日), 2014/01/04(土)

型定義領域

列挙値

Scope
メソッドなどのスコープ範囲を示す。
Scope 0123456789101112
InScope 0122334445555
ExScope 0001010120123
ownerprivateinsideinstancexprivateprinstintectedxpropriprotectedinternalxpubpripubpropublic
モジュール内 クラス内 インスタンス内
他インスタンス ×××
継承クラス インスタンス内 ××
他インスタンス ××××××
他クラス 他インスタンス ×××××××××
別モジュール 継承クラス インスタンス内 ××××××
他インスタンス ××××××××××
他クラス 他インスタンス ××××××××××××
意味不明な名前がついているものは、おそらく使わない。
CallingConvention
呼出規約
説明
0x00(0) PCEOYC
PCEOYCの標準。引数を右側からスタックに積んで、呼び出し側で解放
0x01(1) CDECL_MS_x86
x86のCDECL(MS式)
0x02(2) STDCALL_MS_x86
x86のSTDCALL
0x03(3) THISCALL_MS_x86
x86のTHISCALL(MS式)
0x04(4) CDECL_GCC_x86
x86のCDECL(GCC式)
0x05(5) THISCALL_GCC_x86
x86のTHISCALL(GCC式)
0x06(6) CDECL_MS_x86_64
x86_64のCDECL(MS式)
0x07(7) STDCALL_MS_x86_64
x86_64のSTDCALL
0x08(8) THISCALL_MS_x86_64
x86_64のTHISCALL(MS式)
0x09(9) CDECL_GCC_x86_64
x86_64のCDECL(GCC式)
0x0A(10) THISCALL_GCC_x86_64
x86_64のTHISCALL(GCC式)
0x3f(63) UNKNOWN
不明

使用する型

TypeIdentifier
型の識別情報
名称 説明
name String 型の名前。
paramCount int16 テンプレートパラメタの数
templateParameters String[] テンプレートパラメタ
Argument
引数の情報
名称 説明
type TypeIdentifier 引数の型
name String 引数名
Attribute
属性
名称 説明
name TypeIdentifier 属性名
length int16 属性値のサイズ
data int8[] 属性の値
Type
名称 説明
type int8 型の種別
説明
1列挙型
enum
2値型(構造体)
struct
3インタフェース型
interface
4オブジェクト型
class
EnumValue
名称 説明
name String 値の名前
value int32
EnumType
名称 説明
flags int32
bit 名前 説明
0-1bit ExScope 外部スコープ範囲
2-27bit reserved ゼロに予約されている
28-30bit typeCategory 必ず1(0b001)
31bit isDeprecated 1のとき、非推奨であることを表す。
name String 型の名前。
attributeCount int16 属性の数。
attribute Attribute[] 属性の一覧。attributeCountがゼロのとき、このフィールドのサイズは0Byteである。
valueCount int16 値の数。
values EnumValue[] 値の一覧。valueCountがゼロのとき、このフィールドのサイズは0Byteである。
StructType
名称 説明
flags int32
bit 名前 説明
0-1bit ExScope 外部スコープ範囲
2-27bit reserved ゼロに予約されている
28-30bit typeCategory 必ず2(0b010)
31bit isDeprecated 1のとき、非推奨であることを表す。
name String 型の名前。
attributeCount int16 属性の数。
attribute Attribute[] 属性の一覧。attributeCountがゼロのとき、このフィールドのサイズは0Byteである。
methodCount int16 含まれるメソッドの数。
methods Method[] メソッドの一覧。
methodCountがゼロの場合、このフィールドのサイズは0Byteである。
PropertyCount int16 プロパティの数。0~65535
properties Property[] プロパティの一覧。
propertyCountがゼロの場合、このフィールドのサイズは0Byteである。
size int16 型のインスタンスが必要とするバイト数。
InterfaceType
名称 説明
flags int32
bit 名前 説明
0-1bit ExScope 外部スコープ範囲
2bit generic 1のとき、ジェネリック
3-27bit reserved ゼロに予約されている
28-30bit typeCategory 必ず3(0b011)
31bit isDeprecated 1のとき、非推奨であることを表す。
name String 型の名前。
attributeCount int16 属性の数。
attribute Attribute[] 属性の一覧。attributeCountがゼロのとき、このフィールドのサイズは0Byteである。
methodCount int16 含まれるメソッドの数。
methods Method[] メソッドの一覧。
methodCountがゼロの場合、このフィールドのサイズは0Byteである。
PropertyCount int16 プロパティの数。0~65535
properties Property[] プロパティの一覧。
propertyCountがゼロの場合、このフィールドのサイズは0Byteである。
inheritCount int16 継承元の数
inheritList TypeIdentifier[] 継承・実装元の型の一覧。inheritCountがゼロのとき、このフィールドのサイズは0Byteである。
ClassType
名称 説明
flags int32
bit 名前 説明
0-1bit ExScope 外部スコープ範囲
2bit generic 1のとき、ジェネリック
3bit sealed 1のとき、継承不可。
4-27bit reserved ゼロに予約されている
28-30bit typeCategory 必ず4(0b100)
31bit isDeprecated 1のとき、非推奨であることを表す。
name String 型の名前。
attributeCount int16 属性の数。
attribute Attribute[] 属性の一覧。attributeCountがゼロのとき、このフィールドのサイズは0Byteである。
methodCount int16 含まれるメソッドの数。
methods Method[] メソッドの一覧。
methodCountがゼロの場合、このフィールドのサイズは0Byteである。
PropertyCount int16 プロパティの数。0~65535
properties Property[] プロパティの一覧。
propertyCountがゼロの場合、このフィールドのサイズは0Byteである。
inheritCount int16 継承元の数
inheritList TypeIdentifier[] 継承・実装元の型の一覧。inheritCountがゼロのとき、このフィールドのサイズは0Byteである。
size int16 型のインスタンスが必要とするバイト数。
Method
クラスなどのメソッドを表す。
名称 説明
name String メソッド名。
result TypeIdentifier 戻り値の型のID
argCount int16 引数の数。
args Argument[] 引数の型の一覧
argCountがゼロの場合、このフィールドのサイズは0Byteである。
flags int32
bit 名前 説明
0-1bit ExScope 外部スコープ範囲
2bit isGeneric 1のとき、ジェネリック
3bit isSealed 1のとき、オーバーライド禁止
4bit isVirtual 1のとき、仮想メソッド。
5bit isAbstract 1のとき、Abstractメソッド。
6bit isStatic 1のとき、静的メソッド。
7-12bit CallingConvention 呼出規約。CallingConventionを参照
8-30bit reserved ゼロに予約されている
31bit isDeprecated 1のとき、非推奨であることを表す。
※ 非仮想メソッドでもオーバーライド可能
attributeCount int16 属性の数
attribute Attribute[] 属性の一覧。attributeCountがゼロのとき、このフィールドのサイズは0Byteである。
Property
クラスなどのプロパティを表す。
名称 説明
name String メソッド名。
typeID TypeIdentifier プロパティの型のID
getFlags int32
bit 名前 説明
0-1bit ExScope 外部スコープ範囲
2bit isGeneric 1のとき、ジェネリック
3bit isSealed 1のとき、オーバーライド禁止
4bit isVirtual 1のとき、仮想。
5bit isAbstract 1のとき、Abstract。
6bit isStatic 1のとき、静的。
7-30bit reserved ゼロに予約されている
31bit isDeprecated 1のとき、非推奨であることを表す。
※ 非仮想メソッドでもオーバーライド可能
setFlags int32
bit 名前 説明
0-1bit ExScope 外部スコープ範囲
2bit isGeneric 1のとき、ジェネリック
3bit isSealed 1のとき、オーバーライド禁止
4bit isVirtual 1のとき、仮想。
5bit isAbstract 1のとき、Abstract。
6bit isStatic 1のとき、静的。
7-30bit reserved ゼロに予約されている
31bit isDeprecated 1のとき、非推奨であることを表す。
※ 非仮想メソッドでもオーバーライド可能
attributeCount int16 属性の数
attribute Attribute[] 属性の一覧。attributeCountがゼロのとき、このフィールドのサイズは0Byteである。

型定義

名称 説明
typeCount int16 モジュール内に定義される型の数
typeList Type[] Typeの一覧
2014/01/05(日), 2014/01/04(土)

データ領域

この領域では性的でも政敵でもなくて、静的なデータを扱う。

使用する型

dataItem
データの定義
名称 説明
name String データ項目の名前。
typeID sha256 データの型のID。
data int8[] データ本体

データ

名称 説明
dataCount int32 モジュール内に定義されるデータの数
dataList Data[] StaticDataの一覧