Skip to content

Commit

Permalink
rename references to AutoAttributes in frontend (#189)
Browse files Browse the repository at this point in the history
* rename references to AutoAttributes in frontend

* change GUI display version to match OFRAK's

* strip "AttributeType" from displayed attributes names

Co-authored-by: edward <[email protected]>
  • Loading branch information
EdwardLarson and Edward-Larson authored Jan 26, 2023
1 parent 85a3c7a commit 054e887
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,5 @@
{/if}

<div class="bottomright">
<p><a href="https://ofrak.com" target="_blank" rel="noreferrer">v0.6.0</a></p>
<p><a href="https://ofrak.com" target="_blank" rel="noreferrer">v2.1.1</a></p>
</div>
12 changes: 6 additions & 6 deletions frontend/src/AssemblyView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
blocks.sort((a, b) => {
const aAddress =
a[0]?.model?.attributes[
"ofrak.model._auto_attributes.AddressableAutoAttributes"
"ofrak.model._auto_attributes.AttributesType[Addressable]"
]?.virtual_address;
const bAddress =
b[0]?.model?.attributes[
"ofrak.model._auto_attributes.AddressableAutoAttributes"
"ofrak.model._auto_attributes.AttributesType[Addressable]"
]?.virtual_address;
return aAddress - bAddress;
});
Expand Down Expand Up @@ -97,7 +97,7 @@
{instructionOrDataWord
.get_attributes()
[
"ofrak.model._auto_attributes.AddressableAutoAttributes"
"ofrak.model._auto_attributes.AttributesType[Addressable]"
].virtual_address.toString(16)
.padStart(8, "0") + ":"}
</div>
Expand Down Expand Up @@ -130,11 +130,11 @@
{#each block as instruction}
<div>
{instruction.get_attributes()[
"ofrak.model._auto_attributes.InstructionAutoAttributes"
"ofrak.model._auto_attributes.AttributesType[Instruction]"
].mnemonic +
" " +
instruction.get_attributes()[
"ofrak.model._auto_attributes.InstructionAutoAttributes"
"ofrak.model._auto_attributes.AttributesType[Instruction]"
].operands}
</div>
{/each}
Expand All @@ -150,7 +150,7 @@
<!-- unpacked data word value not yet available as attribute -->
<!-- 0x{dataWord-->
<!-- .get_attributes()-->
<!-- .DataWordAutoAttributes.unpacked.toString(16)}-->
<!-- .AttributesType[DataWord].unpacked.toString(16)}-->
[literal]
</div>
{/each}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ResourceTreeToolbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
a.target = "_blank";
a.download =
rootResource.get_attributes()[
"ofrak.model._auto_attributes.FilesystemEntryAutoAttributes"
"ofrak.model._auto_attributes.AttributesType[FilesystemEntry]"
]?.name || "";
a.click();
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export function hexToByteArray(hex) {
*/
export function cleanOfrakType(t) {
const elements = t.split(".");
return elements[elements.length - 1];
const last = elements[elements.length - 1];
return last.replace(/AttributesType\[(.*)\]/, "$1");
}

/***
Expand Down
4 changes: 4 additions & 0 deletions ofrak_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased](https://github.com/redballoonsecurity/ofrak/tree/master)

## [2.1.1](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v2.1.0...ofrak-v2.1.1) - 2023-01-25
### Fixed
- GUI uses correct attribute class names again (not *AutoAttributes)

## [2.1.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v2.0.0...ofrak-v2.1.0) - 2023-01-20
### Added
- `LiefAddSegmentConfig` now has an optional `physical_address` argument.
Expand Down
2 changes: 1 addition & 1 deletion ofrak_core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def run(self):

setuptools.setup(
name="ofrak",
version="2.1.0",
version="2.1.1",
description="A binary analysis and modification platform",
packages=setuptools.find_packages(exclude=["test_ofrak", "test_ofrak.*"]),
package_data={
Expand Down

0 comments on commit 054e887

Please sign in to comment.