Releases: 0cyn/ktool
Releases · 0cyn/ktool
Release 0.20.1
Tool
- Initial file load in the GUI is now near-instant thanks to a refactor in how headers are loaded.
- non-mmaped processing now operates at a reasonable speed.
Library
- rewrite bio (non-mmap) backend stuff to use a bytearray buffer loaded at init instead of repeated seek()->read() calls.
- non-mmap now automatically kicks in if mmap fails
- GUI now supports a target-function-based lazy loading string buffer, which is used for header lazy-loading
Release 0.20.0
Tool
open
now has--hard-fail
flag, which will cause open to fail (and print a backtrace) if it hits any exceptions loading content- GUI: objc header generation now functions on platforms without semaphore implementations
Library
Symbol
- Class now conforms to
Constructable
class..from_image()
when loading from an nlist(32/64) struct.from_values
when loading from values we've already decoded elsewhere
.addr
->.address
.ext
->.external
.types
- new array of strings containing different types, if they're specified in an nlist64 entry (from a symtab)
Table Refactor
Essentially, table rendering in the GUI is now instant, with zero load time/freezing and no lag while scrolling large tables. This includes Hex Dumps
Class
- Added
.dividers: bool
attribute; when set toTrue
, a real "table" with outlined cells/columns will be drawn. - Refactored entire class to lazily process, render, and cache the dumps as the buffer is scrolled instead of every time it gets loaded. This makes everything with tables nearly instance
Hex Dump Tables
- HexDumpTables now override the fetch() method of Table, and lazily load/replace the .rows() attribute through only decoding the bytes we need at the time; and disables the cache, instead of loading all of the bytes into the decoding function at once.
Table Rendering Logic
ScrollingDisplayBuffer().process_lines()
no longer handles rendering tables; instead wefetch()
the needed content inrendered_lines_from()
every time an update is requested- Pinning is no longer properly implemented
Release 0.19.4
Library
- Added support for loading/parsing/dumping 32-bit binaries. (tested on armv7, should work on x86 (32) as well)
- General Code Cleanup
Release 0.19.3
Mainly bugfixes, and a refactor that can potentially cut objc loading speed in half.
Tool
- GUI: Better multithreading for the objc header syntax highlighting in the objc loader.
Library
- Fix a lot of potential recursion/class-loading errors in objc
- FIx method/property sorting in public API
- Implement a Queueing system for loading Classes/Protocols/Categories
- Implement a Cache for loaded Classes/Protocols/Categories
- Update Repo Address
Release 0.19.0
This release includes a few bugfixes, along with a massive internal refactor that shouldn't affect any of the API or process.
Tool
- GUI
- Fix Exit button
- Fix crash regression when image has no UUID
- add
--membench
global arg (benchmarks memory allocations across program) - Add
--use-stab-for-sel
dump
arg, which will force using the symtab to get selectors for methods, instead of using the actual selector strings.
Library
Bugfixes
- Fix a crash when unrecognized load commands are read
- Fix a crash when symtab is entirely empty (poorly extracted dyld binaries)
- Fix a crash when class/protocol pointers are bad (poorly extracted dyld binaries)
Refactors
Constructable
Abstract Base Class - Renamedfrom_bytes
tofrom_image
Image
- Remove deprecated.linked
attribute (replaced with.linked_images
)Image
- Add.import_table: Dict[int, Symbol]
, which is a lookup table for imported symbolsImage
- Add.export_table: Dict[int, Symbol]
, which is a lookup table for exported symbols_VirtualMemoryMap
- Add.vm_check(vm_address) -> bool
.objc
- ImplementConstructable
API inObjCImage
,Class
,Protocol
,Category
,Method
,Property
, andIvar
. This will allow api-compatible loading and header dumping of values obtained at runtime, not from an image.
Release 0.18.0
Tool
- Should run a lot faster due to internal Library changes. Benchmarks have shown anywhere from 30-60% reductions in runtime.
- GUI
- Moved Imports and Exports out of "Binding" group and merge the imports tables
Library
- Massive Speedups
- Refactor almost all of the internals in the Struct class to speed things up
- Added some caches for some other huge speedups
- Loaded struct cache
- Loaded CString cache
- Typeresolver cache
- Finished implementing MethodList, implemented to avoid duplicate code blocks in objc.py
- Stopped using structs in MethodList parsing to make things a bit faster
- Expansive Refactor in the
Image
class..linked
->.linked_images
- Binding tables merged, moved to new
.imports: List[Symbol]
- Exports moved to new
.exports: List[Symbol]
, Export Trie object moved to.export_trie
- Added .attr to Symbol class, to be used with import symbols
- New
LD64
class; holds methods for editing linking information, etc.- Moved load command editing functions to this class
Release 0.17.3
Library
- Implemented the code and fixed some issues to allow loading (and patching) BytesIO objects (raw bytes in memory that dont exist on disk).
Example usage of this can be seen here: https://gist.github.com/KritantaDev/b577dafe844d26350b051b482bb71268#file-script-py-L20
Release 0.17.2
Library
- Add
macho_combine(slices: List[Slice]) -> BytesIO
to public API - Add
ignore.OBJC_ERRORS
to util class (used in ObjC header gen). Default isTrue
, setting it toFalse
will crash the program when an error is encountered loading any objc metadata.
Tool
- Setting
--hard-fail
on the CLIdump
command will toggle the aboveignore.OBJC_ERRORS
to True, crashing the program whenever an error is encountered loading OBJC metadata.
Release 0.17.1
Library
Image
class now has attributes.base_name
and.install_name
, designed to replace the ambiguous.name
attribute, which is now deprecated..install_name
will be the Install name of the image, or""
if one isn't specified..base_name
will be the base name (not including path) of the install name, or basename of the filename if one isn't included. the.name
attribute is now deprecated and shouldn't be used.- This should fix any issues with header gen, GUI related things, etc, regarding non-library images.
Tool
info
command now shows full Install name instead of a basename of the install name on Libraries.- GUI should now always restore terminal even when exceptions break out of the window.py file.
- Fixed a minor range issue in GUI flavor text, updated the "welcome" GUI text.
- GUI now uses cleaner basenames of Install names or Image paths when displaying them.
- The debug menu in the GUI (click ktool in the top left corner), which shows the output of
log
, now highlights errors and warnings.
Release 0.17.0
CLI Tool changes
- Missing flags error message will now show the original flag text (
--headers
instead ofdo_headers
) - Always attempt to tear down curses GUI after it closes (not just after caught exceptions)
- Implement the new public library API in the CLI tool
- Update some docstrings
- Add
--no-mmap
global flag, which loads a binary without using the mmap module (this is beyond horribly slow at the moment).
Library changes
- Add a new public API
- highly limit the classes imported via the init script in the ktool module (to a few classes, and the new public api
- Make log error output redirectable, and by default pipe it to stderr
- move the Table class to .util, since it can be used for both .window and CLI output
- Add the base structure for fixup processing (not yet implemented, but the pieces are there now.)
- A ton of project cleanup