Conversation
…ill the point of saturation
…ded functions loaded from files
There was a problem hiding this comment.
Pull request overview
This pull request represents a major version update to the View8 V8 cache decompiler, introducing significant new features and enhancements to the codebase.
Changes:
- Added comprehensive utility module (
view8_util.py) with functions for tree-based function analysis, export management, and function renaming capabilities - Enhanced command-line interface with new options for serialization, tree-based analysis, function filtering, scope propagation, and improved input/output handling
- Implemented pickle-based serialization for decompiled output with appropriate security warnings
- Improved global scope propagation logic with iterative replacement and better pattern matching
- Enhanced code metadata support with get/set/drop methods for CodeLine objects
- Better error handling and encoding support throughout the parsing pipeline
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| view8_util.py | New utility module providing function tree analysis, export management, function renaming, and tree-based output organization |
| view8.py | Refactored main entry point with enhanced CLI arguments, serialization support, tree mode, function filtering, and scope propagation options |
| init.py | Added path initialization to ensure module imports work correctly |
| Translate/translate_table.py | Renamed ConstPool references to ConstPoolLiteral for property/constant access operations to differentiate literal values |
| Translate/jump_blocks.py | Enhanced CodeLine class with metadata support and improved error handling with more specific exception types |
| Simplify/simplify.py | Updated constant detection patterns to include ConstPoolLiteral and improved loop scope handling for context variables |
| Simplify/global_scope_replace.py | Completely rewritten with iterative replacement logic, better pattern matching, and separate handling of LHS vs RHS in assignments |
| README.md | Updated documentation to reflect new CLI options, serialization features, and tree mode functionality |
| Parser/shared_function_info.py | Added GlobalVars class for global variable tracking, serialization functions with security warnings, and enhanced constant pool replacement |
| Parser/sfi_file_parser.py | Improved string parsing with JSON encoding and added error handling for malformed input |
| Parser/parse_v8cache.py | Enhanced subprocess handling with better encoding support and more lenient error checking |
| .gitignore | Added patterns for Python cache files, data directory, and backup files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…uded functions. Allow for commenting lines out Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… index from const_pool Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 19 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| help="Specify the input format. Options are: 'raw', 'serialized' (pickle; trusted input only), 'disassembled'.", default='raw') | ||
| parser.add_argument('--inp', '-i', help="The input file name.", default=None, required=True) | ||
| parser.add_argument('--out', '-o', help="The output file name.", default=None) | ||
| parser.add_argument('--path', '-p', help="Path to disassembler binary. Required if the input is in the raw format.", default=None) |
There was a problem hiding this comment.
--path is documented as required for raw input, but parse_v8cache_file() auto-detects the version and chooses a disassembler from Bin/ when --path is not provided. Either enforce --path for raw in code, or update the help text/documentation to reflect that it is optional unless auto-detection/bundled binaries are unavailable.
| parser.add_argument('--path', '-p', help="Path to disassembler binary. Required if the input is in the raw format.", default=None) | |
| parser.add_argument('--path', '-p', help="Path to disassembler binary. Optional for 'raw' input; if omitted, View8 will attempt to auto-detect and use a bundled disassembler. Required only if auto-detection or bundled binaries are unavailable.", default=None) |
| for name, filtered_func in items_map.items(): | ||
| if len(filtered_func) <= main_limit: | ||
| main_set += filtered_func |
There was a problem hiding this comment.
main_limit is described as a tree depth threshold (see CLI/README), but here it’s compared against len(filtered_func) (number of functions in the subtree). This makes --mainlimit behave as a size cutoff, not a depth cutoff. Either change the implementation to measure depth, or rename/update the flag/help/docs to match the actual behavior.
| <li><code>--out</code>, <code>-o</code>: Path to the output (depending on the type of the output, a single file or a directory tree may be generated)</li> | ||
| <li><code>--input_format</code>, <code>-f</code>: Indicate format of the input. Options are: <code>raw</code>: the output is a raw JSC file; <code>disassembled</code>: the input file is already disassembled; <code>serialized</code>: the input is already decompiled, and stored in a serialized format (pickle; trusted input only)</li> | ||
| <li><code>--export_format</code>, <code>-e</code>: Specify the export format(s). Options are <code>v8_opcode</code>, <code>translated</code>, <code>decompiled</code>, and <code>serialized</code>. Multiple options can be combined (optional, default: <code>decompiled</code>).</li> | ||
| <li><code>--path</code>, <code>-p</code>: Path to disassembler binary. Required if the input is in the raw format.</li> |
There was a problem hiding this comment.
The docs say --path is required for raw input, but the current code path auto-detects the V8 version and selects a bundled disassembler from Bin/ when --path is omitted. Consider updating this line to reflect that --path is only needed to override the auto-selected binary or when the bundled binaries aren’t available.
| <li><code>--path</code>, <code>-p</code>: Path to disassembler binary. Required if the input is in the raw format.</li> | |
| <li><code>--path</code>, <code>-p</code>: Path to disassembler binary. By default, View8 auto-detects the V8 version and uses a bundled disassembler from <code>Bin/</code>; use this option to override the auto-selected binary or when no suitable bundled binary is available for raw input.</li> |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
does this complete? |
No description provided.