0cyn / ktool

pip install k2l | Mach-O + Obj-C analysis TUI / CLI kit and library. Zero compiled deps, runs anywhere with a python interpreter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ktool open OSError: Invalid argument

BiteFoo opened this issue · comments

commented

As title,when I ran command ktool open /path/to/macho file ,which an error was occured as below.

ktool.exe  open   CTPocket
Hard fault in GUI due to uncaught exception:
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\aaa\AppData\Local\Programs\Python\Python311\Scripts\ktool.exe\__main__.py", line 7, in <module>
  File "C:\Users\Jaaaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\ktool_script.py", line 409, in main
    args.func(args)
  File "C:\Users\aaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\ktool_script.py", line 489, in _open
    raise ex
  File "C:\Users\aaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\ktool_script.py", line 481, in _open
    screen.load_file(args.filename, MMAP_ENABLED)
  File "C:\Users\aaaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\window.py", line 2230, in load_file
    raise ex
  File "C:\Users\Jaaaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\window.py", line 2214, in load_file
    for item in KToolMachOLoader.contents_for_file(fd, self.update_load_status, mmap):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\window.py", line 1597, in contents_for_file
    machofile = MachOFile(fd, use_mmaped_io=mmap)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\macho.py", line 122, in __init__
    self.file = BackingFile(file, use_mmaped_io)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aaa\AppData\Local\Programs\Python\Python311\Lib\site-packages\ktool\macho.py", line 59, in __init__
    f.seek(old_file_position)
OSError: [Errno 22] Invalid argument

my env

windows10 python3.10