0

I have a .so file that has some functions in it (about inferencing model of deep learning) The .pyx file accidently got deleted during compile. I imported it in my python code regularly. I want to debug it with any tools possible even x64 Ida etc. I cannot access the .pyx or .pi nor any other meta file when compiled it anymore. Any kind of help would be appreciated.

As far as I know, the .so file is non managed C like code I want to debug it with x64 or Ida-pro (if it is possible with pdb or any high-level debugger). I've already tried to debug it with pdb and gdb without any success.

my code shown in below for trying pdb debugging:

import pdb
pdb.set_trace()

import sys
from pathlib import Path
sys.path.append(Path(__file__) / 'deepspeech.pytorch')

import inference_core
print(inference_core)

when I run it set_trace() stop the program for debugging. when I step into inference_core The information it gives me is just some frozen importlib with numbers:

(Pdb) next
next
> /opt/cpInfrenece/cpInference.py(5)<module>()
-> sys.path.append(Path(__file__) / 'deepspeech.pytorch')
(Pdb) next
next
> /opt/cpInfrenece/cpInference.py(7)<module>()
-> import inference_core
(Pdb) step
step
--Call--
   > <frozen importlib._bootstrap>(966)_find_and_load()
(Pdb) step
step
   > <frozen importlib._bootstrap>(968)_find_and_load()
(Pdb) step
step
   --Call--
   > <frozen importlib._bootstrap>(143)__init__()
(Pdb) 

I actually didn't surprised because of .so file's nature. after failing on this I'm trying to make my python file an exe file with PyInstaller. maybe it work's well with x64dbg or Ida. in the meantime any other kind of help would be appreciated.

  • What have you tried? Show us some command lines that didn't work. – Tim Roberts Jul 22 '23 at 20:55
  • the question needs sufficient code for a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – D.L Jul 22 '23 at 21:10
  • @TimRoberts in debugging subject I just tried pdb. it show me just some frozen lib with number. I update the question with code – Ali aalami Jul 23 '23 at 08:02
  • Of course you can't debug C code with a Python debugger. You would have to use gdb, if you're on Linux. But what are you ultimately trying to do here? `inferene_core.py` is open source. You can go browse the git repository. – Tim Roberts Jul 23 '23 at 17:47

0 Answers0