Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run any OFRAK Component in the GUI (#287)
* Revert sending script in primary response * associate RID with tag/attribute, unable to find any attributes * Add get_script method * working resource selector generator * Fetch script during certain frontend actions * store scripts by session * Move root getting into SB, begin adding var names * Add var name replacement to action strings * Add name generation * Consoldiated ScriptBuilder code * Update var naming code with marcs interface for sessions * VSCode bad import paths :/ * Code runs, attempts to get non-existant var name * Server runs without error * Add root cache * Some missing awaits and what not * Trying to make things work * added _add_action_to_session * fixes * Fix script spacing issues * Clean up script, everything has 1 extra tab * Exported script runs * Working patches in gui script * Add script gui pane * dedent returns list not string * Add initial syntax highlighting * Fix highlighting, CSS, and lint * Fix close button, minor lint things * Script download button * Black and remove resutl from some strings * Added comments to script footer to guide users on backends * Add to Changelog * Changes based on feedback from PR * Move script_builder to gui * Changed json back to orjson and removed debug message in exception decorator * Fix dimensions and minify new icon SVG * get_all_components_for_resource works, get_config_for_component does not * Update ofrak_core/ofrak/gui/server.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Get config working * Add initial component + config support to frontend * Run generic component * oops forgot to save in vscode * Forgot to save again * Auto generate component fields and send request * Reformat config from server * Some stuff got reverted when i messed up my merge * Send full name of config class * Add orjson back, remove debug print * Send config type the right way * Component query * Broke out fields to new component * Add Dropdown to Component View * Open Config view on Run * Connect ComponentsView to ConfigView * Add icon * Fixes based on PR feedback * Swap ordereddict for list, remote update_script * Handle config=None, some boilerplate fresh componet after run code and check config field types * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Edward Larson <wasabiofip@gmail.com> * Fix missed get_script call, remove old comment * Updates from feedback, plus add json import back * Slightly more sane ordering of methods * Auto refresh after run component * Updated selectable attributes exception * Recursive component config fields, some issues * Fix button bar CSS * Add filtering to Run Components * Mostly working config types * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Some html formatting * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/cli/command/gui.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/server.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Apply changes to feedback * Fix script sharing across sessions * Update ofrak_core/ofrak/gui/script_builder.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Fill out comments on public methods * Modify css on component filter * Ensure actions update script, fix up doc strings * Fix up comments, hex strings, update on delete * Fix up find & replace and add tag doc strings * Select on vaddr * Make add_action last step in route handlers * Revert backendurl/this.uri changes * Added bytes to type checking * Update ofrak_core/ofrak/gui/server.py Co-authored-by: Edward Larson <wasabiofip@gmail.com> * Handle SelectableAttrErr in add_variable * Make MyPy happy * Remove unused methods, add get_script test * Remove local version of notebook file * Revert notebook files * Missing spaces * Improve error message in script * Revert helper_functions * Revert helper functions part deux * Script queue and commit wrapping actual ofrak calls * Add test case for selectable attr err * Add dtb selectable attributes and some formatting * Add cmake back to Dockerstub * Revert Dockerstub * Make MyPy happy again * Add missing commit script, always return script * Remove unnecessary call to hex() * Dequeue script on exception * Minor formatting/accuracy changes * Fix IDs in test case * Add clear queue test - this is currently failing * Index missing resource names * removed backend url from new routes * Some small fixes after merging * Aesthetic changes to Component Config view * Improve component visuals * Highlight modified resources * Add error message to component config view * Disable shortscuts in views w text inputs * Clear indicator when packed * Fix up test * Add styling to Add Element button * Remove duplicate lines from merge conflict * Change all CC type hints to ComponentConfig and beginings of serializer specific inputs from gui * Optional and Enum working * Make optional default to null * Add targetable tag filter to run component view * Added filter to components view and tests * CHANGELOG for PR #287 * Add script to run component, remove NoneType refs * Run pre-commit hook * Remove EnumType * Update ofrak_core/CHANGELOG.md Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Update frontend/src/stores.js Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Simple mods from PR * add back orjson * Make union type select a dropdown * Better handle elipsis * Support alternative checkbox alignment * Adjust component filter CSS * Lint * Refactor componentsview code * Refactor ComponentConfig into ComponentView * Clean up Component View CSS * Further improve component config style Plus small quality of life improvements * Make show all components button do what it says * change typing.get_args to typing_inspect.get_args * Add/Remove dict/list elements * Make Optional behave like Union * Fix enums * Force SourceBundle to underlying dict type * Add button bar to box with X to remove * Fix button bar * Change add button to a + icon * Remove underscores and capitalize names * Added typing.Iterable * Minor fixes * Some edits after merge * frontend linter after update * newline in svg file * working toolchain selection in frontend * SourceBundle file browser and etc. * Make dicts work properly and remove calculator so remove button works for ints * add SourceBundle serializer * small cleanups * Add color to var * frontend linting * Make mypy smile * Update frontend/src/ComponentConfigNode.svelte Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Addressing comments by Jacob from PR * Test fix ups * Simplify modifier view hotkey conditional * Re-Add Calculator to Int input * Lint * Hide run component behind experimental featues * lint.. again * Add missing test for ofrak server * Test status only on get_tags_and_num_components test * delete unused function, better test for SourceBundle serializer * update changelog * Update disassemblers/ofrak_capstone/ofrak_capstone/components.py Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> * Take wyatts suggestion on capstone typing. --------- Co-authored-by: Marc Zalik <marc.zalik@gmail.com> Co-authored-by: Dan Pesce <dan@redballoonsecurity.com> Co-authored-by: Jacob Strieb <99368685+rbs-jacob@users.noreply.github.com> Co-authored-by: Edward Larson <wasabiofip@gmail.com> Co-authored-by: edward <edward@redballoonsecurity.com>
- Loading branch information