« 小数点以下の拡大 | メイン | アルファ付き減色ツール »
2012年10月23日
吉里吉里Java:: TJS2 バイトコードファイルフォーマット
Tweet @jin1016をフォロー基本構造
0 | 1 | 2 | 3 | 備考 | |
0 | 'T' | 'J' | 'S' | '2' | シグネチャ |
1 | '1' | '0' | '0' | \0 | バージョン |
2 | file size | ||||
3 | 'D' | 'A' | 'T' | 'A' | |
4 | data area size | ForuCC含む | |||
5 | data... | ||||
6 | 'O' | 'B' | 'J' | 'S' | |
7 | objects area size | ForuCC含む | |||
8 | top level object index | -1の時はnull | |||
9 | number of objects | ||||
10 | objects... |
data area - 最初に個数があり、その後配列がある形
count | byte... | 4バイトアライメント |
count | short... | 4バイトアライメント |
count | int... | |
count | long... | 8バイト |
count | double... | IEEE 754 浮動小数点の「ダブルフォーマット (double format)」ビットレイアウト |
count | string... | length + char array 4バイトアライメント |
count | octet... | length + byte array 4バイトアライメント |
object area
0 | 1 | 2 | 3 | 型 | 備考 | |
0 | 'T' | 'J' | 'S' | '2' | ||
1 | object area size | 整数直値 | ||||
2 | parent index | object index | ||||
3 | name | 文字列(data index) | ||||
4 | context type | 整数直値 | クラスや関数等の種類 | |||
5 | max variable count | 整数直値 | 固定変数の数 | |||
6 | variable reserve count | 整数直値 | 固定変数予備 - context type によって決まるので不要だが | |||
7 | max frame count | 整数直値 | レジスタ数 | |||
8 | func decl arg count | 整数直値 | 定義時の関数の引数の数 | |||
9 | func decl unnamed arg array base | 整数直値 | 無名配列引数より前に定義されている引数の数 | |||
10 | func decl collapse base | 整数直値 | 名前付き配列引数より前定義されている引数の数 | |||
11 | prop setter | object index | プロパティセッターオブジェクト、context type が property の時に持つ | |||
12 | prop getter | object index | プロパティゲッターオブジェクト、context type が property の時に持つ | |||
13 | super class getter | object index | スーパークラスを取得するためのオブジェクト | |||
15 | source pos array | コード位置配列とソース位置配列 | デバッグ用、現状省略される | |||
16 | code array | short の配列 | バイトコード実体 | |||
17 | data array | type と index のペアの配列 | 定数配列 ( Variant 型 ) | |||
18 | super class getter pointer array | int の配列 | スーパークラスゲッターのバイトコードオフセット配列 | |||
19 | property object array | 名前とオブジェクトのペアの配列 | 関数等のメンバー登録するオブジェクト配列 |
この説明だけではわからないと思うが、一応ここに記しておく。
投稿者 Takenori : 2012年10月23日 03:44
comments powered by Disqus