Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to debug binary located in path that contains å, ä or ö #24

Open
gurka opened this issue Aug 16, 2024 · 1 comment
Open

Unable to debug binary located in path that contains å, ä or ö #24

gurka opened this issue Aug 16, 2024 · 1 comment

Comments

@gurka
Copy link

gurka commented Aug 16, 2024

Windows 11
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Pybag 2.2.12

Using the following code:

from pybag import *
dbg = UserDbg()
dbg.create(path)

If path is "C:\Test\Test.exe" everything works OK, but if path is "C:\Testö\Test.exe" there is an exception:

CommandLine: C:\Testö\Test.exe
Cannot execute 'C:\Testö\Test.exe', Win32 error 0n2
    ""
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python312\Lib\site-packages\pybag\userdbg.py", line 38, in create
    self._client.CreateProcess(path, DbgEng.DEBUG_PROCESS)
  File "C:\Python312\Lib\site-packages\pybag\dbgeng\idebugclient.py", line 141, in CreateProcess
    exception.check_err(hr)
  File "C:\Python312\Lib\site-packages\pybag\dbgeng\exception.py", line 60, in check_err
    raise err
OSError: -2147024894

I'm not sure if this is a character encoding issue or what's going on. I noticed it when I tried to use a binary within my Windows user folder (which is named SimonSandström).

@dshikashio
Copy link
Owner

A lot of the underlying methods in the various COM objects initially only supported ascii strings and later added wide string variants. Unfortunately Pybag is only using the ascii versions.

TO-DO: Convert Python strings to Windows wide strings and use W-apis were possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants