-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement SecurityCapabilities in rbx_binary (#361)
This PR implements `SecurityCapabilities` parsing in rbx_binary. I chose to use `read_interleaved_i64_array` and `write_interleaved_i64_array` because Roblox appears to serialize it this way, and it's straightforward enough to cast between `u64` and `i64`.
- Loading branch information
1 parent
75aefbc
commit c925260
Showing
10 changed files
with
251 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...snapshots/rbx_binary__tests__util__number-values-with-security-capabilities__decoded.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
source: rbx_binary/src/tests/util.rs | ||
expression: decoded_viewed | ||
--- | ||
- referent: referent-0 | ||
name: Hmmm | ||
class: NumberValue | ||
properties: | ||
Attributes: | ||
Attributes: {} | ||
Capabilities: | ||
SecurityCapabilities: 0 | ||
DefinesCapabilities: | ||
Bool: false | ||
SourceAssetId: | ||
Int64: -1 | ||
Tags: | ||
Tags: [] | ||
Value: | ||
Float64: 2.71828182846 | ||
children: [] | ||
- referent: referent-1 | ||
name: WhereIs | ||
class: NumberValue | ||
properties: | ||
Attributes: | ||
Attributes: {} | ||
Capabilities: | ||
SecurityCapabilities: 2882400000 | ||
DefinesCapabilities: | ||
Bool: false | ||
SourceAssetId: | ||
Int64: -1 | ||
Tags: | ||
Tags: [] | ||
Value: | ||
Float64: 2.71828182846 | ||
children: [] | ||
|
72 changes: 72 additions & 0 deletions
72
...snapshots/rbx_binary__tests__util__number-values-with-security-capabilities__encoded.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
source: rbx_binary/src/tests/util.rs | ||
expression: text_roundtrip | ||
--- | ||
num_types: 1 | ||
num_instances: 2 | ||
chunks: | ||
- Inst: | ||
type_id: 0 | ||
type_name: NumberValue | ||
object_format: 0 | ||
referents: | ||
- 0 | ||
- 1 | ||
- Prop: | ||
type_id: 0 | ||
prop_name: AttributesSerialize | ||
prop_type: String | ||
values: | ||
- "" | ||
- "" | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Capabilities | ||
prop_type: SecurityCapabilities | ||
values: | ||
- 0 | ||
- 2882400000 | ||
- Prop: | ||
type_id: 0 | ||
prop_name: DefinesCapabilities | ||
prop_type: Bool | ||
values: | ||
- false | ||
- false | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Name | ||
prop_type: String | ||
values: | ||
- Hmmm | ||
- WhereIs | ||
- Prop: | ||
type_id: 0 | ||
prop_name: SourceAssetId | ||
prop_type: Int64 | ||
values: | ||
- -1 | ||
- -1 | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Tags | ||
prop_type: String | ||
values: | ||
- "" | ||
- "" | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Value | ||
prop_type: Float64 | ||
values: | ||
- 2.71828182846 | ||
- 2.71828182846 | ||
- Prnt: | ||
version: 0 | ||
links: | ||
- - 0 | ||
- -1 | ||
- - 1 | ||
- -1 | ||
- End | ||
|
76 changes: 76 additions & 0 deletions
76
...s/snapshots/rbx_binary__tests__util__number-values-with-security-capabilities__input.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
source: rbx_binary/src/tests/util.rs | ||
expression: text_decoded | ||
--- | ||
num_types: 1 | ||
num_instances: 2 | ||
chunks: | ||
- Meta: | ||
entries: | ||
- - ExplicitAutoJoints | ||
- "true" | ||
- Inst: | ||
type_id: 0 | ||
type_name: NumberValue | ||
object_format: 0 | ||
referents: | ||
- 0 | ||
- 1 | ||
- Prop: | ||
type_id: 0 | ||
prop_name: AttributesSerialize | ||
prop_type: String | ||
values: | ||
- "" | ||
- "" | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Capabilities | ||
prop_type: SecurityCapabilities | ||
values: | ||
- 0 | ||
- 2882400000 | ||
- Prop: | ||
type_id: 0 | ||
prop_name: DefinesCapabilities | ||
prop_type: Bool | ||
values: | ||
- false | ||
- false | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Name | ||
prop_type: String | ||
values: | ||
- Hmmm | ||
- WhereIs | ||
- Prop: | ||
type_id: 0 | ||
prop_name: SourceAssetId | ||
prop_type: Int64 | ||
values: | ||
- -1 | ||
- -1 | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Tags | ||
prop_type: String | ||
values: | ||
- "" | ||
- "" | ||
- Prop: | ||
type_id: 0 | ||
prop_name: Value | ||
prop_type: Float64 | ||
values: | ||
- 2.71828182846 | ||
- 2.71828182846 | ||
- Prnt: | ||
version: 0 | ||
links: | ||
- - 0 | ||
- -1 | ||
- - 1 | ||
- -1 | ||
- End | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters