ErezAmihud / dearmor

This is a repo to deobfuscate pyarmor files
Apache License 2.0
25 stars 7 forks source link

problem with dearmor executable #18

Open Sa1tama228 opened 2 months ago

Sa1tama228 commented 2 months ago

here is error:

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\User\AppData\Local\Programs\Python\Python312\Scripts\dearmor.exe\__main__.py", line 7, in <module>
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmor\__main__.py", line 51, in main_cli
    dearmor_main(parser.parse_args().file)
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmor\__main__.py", line 20, in dearmor_main
    p = subprocess.Popen(
        ^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 193] %1 не является приложением Win32 (Translate: is not Win32)
Sa1tama228 commented 2 months ago

btw the soft that i wanted deobfuscate written in python 3.8 if its important

ErezAmihud commented 2 months ago

What is the command line you run?

Sa1tama228 commented 2 months ago

What is the command line you run?

just with flag -i, i tried to run it with cmd, ps and pycharm terminal

ErezAmihud commented 2 months ago

What is the command line you run?

just with flag -i, i tried to run it with cmd, ps and pycharm terminal

What did you write in the terminal...

Sa1tama228 commented 2 months ago

What is the command line you run?

just with flag -i, i tried to run it with cmd, ps and pycharm terminal

What did you write in the terminal...

dearmor -i main.pyc...

ErezAmihud commented 2 months ago

What is the command line you run?

just with flag -i, i tried to run it with cmd, ps and pycharm terminal

What did you write in the terminal...

dearmor -i main.pyc...

Ok so the problem is you tried to run it with pyc and not with py file. To run pyc file you have to have the exact same 0ython version and in the __main__.py file in this repo it is not really supported. Instead, decompile the pyc to py and then run dearmor

Sa1tama228 commented 2 months ago

ty, ill try and report if smth is wrong

Sa1tama228 commented 2 months ago

now there is something with the pid

`Traceback (most recent call last): File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 727, in wrapper return fun(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 989, in create_time _user, _system, created = cext.proc_times(self.pid) ^^^^^^^^^^^^^^^^^^^^^^^^^ ProcessLookupError: [Errno 3] assume no such process (originated from GetExitCodeProcess != STILL_ACTIVE)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil__init.py", line 355, in _init self.create_time() File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil\init__.py", line 757, in create_time self._create_time = self._proc.create_time() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 729, in wrapper raise convert_oserror(err, pid=self.pid, name=self._name) psutil.NoSuchProcess: process no longer exists (pid=5568)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Scripts\dearmor.exe__main.py", line 7, in File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmor__main__.py", line 51, in main_cli dearmor_main(parser.parse_args().file) File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmor__main.py", line 30, in dearmor_main current_process = psutil.Process(p.pid) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil\init.py", line 319, in init__ self._init(pid) File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil\init__.py", line 368, in _init raise NoSuchProcess(pid, msg=msg) psutil.NoSuchProcess: process PID not found (pid=5568)`

ErezAmihud commented 2 months ago

now there is something with the pid

`Traceback (most recent call last): File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 727, in wrapper return fun(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 989, in create_time _user, _system, created = cext.proc_times(self.pid) ^^^^^^^^^^^^^^^^^^^^^^^^^ ProcessLookupError: [Errno 3] assume no such process (originated from GetExitCodeProcess != STILL_ACTIVE)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutilinit.py", line 355, in _init self.create_time() File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutilinit.py", line 757, in create_time self._create_time = self._proc.create_time() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 729, in wrapper raise convert_oserror(err, pid=self.pid, name=self._name) psutil.NoSuchProcess: process no longer exists (pid=5568)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Scripts\dearmor.exemain.py", line 7, in File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmormain.py", line 51, in main_cli dearmor_main(parser.parse_args().file) File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmormain.py", line 30, in dearmor_main current_process = psutil.Process(p.pid) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutilinit.py", line 319, in init self._init(pid) File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutilinit.py", line 368, in _init raise NoSuchProcess(pid, msg=msg) psutil.NoSuchProcess: process PID not found (pid=5568)`

The python program should run atleast a few seconds - otherwise there is a race condition between the process creation and the attach that happens. You can clone the repo and change the sleep or remove it to try to do it.

Sa1tama228 commented 2 months ago

now there is something with the pid Traceback (most recent call last): File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 727, in wrapper return fun(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 989, in create_time _user, _system, created = cext.proc_times(self.pid) ^^^^^^^^^^^^^^^^^^^^^^^^^ ProcessLookupError: [Errno 3] assume no such process (originated from GetExitCodeProcess != STILL_ACTIVE) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil__init__.py", line 355, in _init self.create_time() File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil__init__.py", line 757, in create_time self._create_time = self._proc.create_time() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil_pswindows.py", line 729, in wrapper raise convert_oserror(err, pid=self.pid, name=self._name) psutil.NoSuchProcess: process no longer exists (pid=5568) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Scripts\dearmor.exe__main__.py", line 7, in File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmor__main__.py", line 51, in main_cli dearmor_main(parser.parse_args().file) File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\dearmor__main__.py", line 30, in dearmor_main current_process = psutil.Process(p.pid) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil__init__.py", line 319, in **init** self._init(pid) File "C:\Users\danil\AppData\Local\Programs\Python\Python312\Lib\site-packages\psutil__init__.py", line 368, in _init raise NoSuchProcess(pid, msg=msg) psutil.NoSuchProcess: process PID not found (pid=5568)

The python program should run atleast a few seconds - otherwise there is a race condition between the process creation and the attach that happens. You can clone the repo and change the sleep or remove it to try to do it.

and this is the problem, i extracted program with puinstxtractor, and after that the extracted version won't loads properly, it says that: bad magic number in 'pytransform': b'U\r\r\n'