Questions tagged [python]

General-purpose and high-level programming language. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming styles.

Python is a general-purpose, high-level programming language. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming styles. It features a fully dynamic type system and automatic memory management.

Python is often used as a scripting language, but is also used in a wide range of non-scripting contexts. Using third-party tools, Python code can be packaged into standalone executable programs.

There are two versions of Python that are most commonly used - 2.x and 3.x

Python Interpreters

Python Decompilers

227 questions
18
votes
2 answers

Is it possible to get python bytecode without using co_code?

I posted this a while back on stackoverflow (too old to migrate though). Say I am in the python interpreter and define a function as follows: def h(a): return a If I want to look at the bytecode (not a disassembly using dis), I can typically use…
mikeazo
  • 1,072
  • 8
  • 16
10
votes
1 answer

Reverse Engineering program written in Python, compiled with "freeze"

I am attempting to reverse engineer an EXE compiled using the utility "Freeze" or "pfreeze" that ships with Python (not to get confused with "cx_freeze"). Inside the EXE there is an array of memory called PyImport_FrozenModules. When the program…
ThatOneGuy
  • 111
  • 2
  • 6
4
votes
1 answer

Logging lpRect and uFormat from DrawTextA

Using APIMonitor from Rohitab I found that DrawTextA has some additional arguments I would like to log using Python and Pydbg (I'm currently logging lpchText, se below). My current hooking code looks something like this: def DrawTextHook(dbg,…
Jonas Lejon
  • 163
  • 7
3
votes
0 answers

Brute Force USB Fuzzing

I am working to reverse engineer a USB based robot arm, but the operating system for the robot won't allow me to create simple enough moves that I can isolate the commands with a USB Sniffer like Wireshark. So I am looking for two new options. Is…
bcarroll14
  • 41
  • 2
3
votes
2 answers

The structure of the Python's marshaled code object (or .pyc file)

Help me to decipher the Python's marshaled code object. The .pyc files are almost the same: The structure of .pyc files. I have: The code object compiled from the source. The marshaled representation of this code object. The recursive disassembly…
MiniMax
  • 141
  • 1
  • 6
2
votes
1 answer

Reverse Engineering a python mac application compiled with "freeze"

(Note)I have already seen this post: Reverse Engineering program written in Python, compiled with "freeze" Would anyone know how to do what is done in the link above using the PyCommand but with a mac app? The program I am trying to reverse engineer…
2
votes
0 answers

ResumeThread doesn't work after attaching to the process using vTrace

In an effort to learn vtrace I've been trying to attach to a process and hook the import address table and then resume the main thread of a process. When I don't attach to the process the ResumeThread() call works fine. But when I do it spins up a…
user2743
  • 211
  • 2
  • 3
1
vote
0 answers

How to derive a state diagram from existing source code

to;dr; What tools or smart method can I use to derive a state (transition) overview from source code with 10 binary and three 16-bit input variables, and several output variables, both 16-bit and binary. All input variables can change with every…
fsteff
  • 111
  • 1
1
vote
0 answers

Need help understanding the flow of a python script on github repository

OpenDroneMap is an open source command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images, here's their github link OpenDroneMap/ODM Was pointed out to a file ODM/blob/master/stages/odm_app.py, which…
1
vote
1 answer

How to turn .pyd files generated by pyinstaller into source?

I have decompiled a pyinstaller exe and then decompiled the .pyc source inside it. only problem is the source is this import secretmodule secretmodule.main() Annoying, I know. i found secretmodule but it is a .pyd and the decompiler I use only…
user14118720
  • 51
  • 1
  • 1
  • 4
1
vote
1 answer

Reverse Python Bytecode

I try reverse python bytecode (Content in a .pyc file). I do not want to decompile the code, just understand the Python bytecode :) The LOAD_NAME statement, pushes the value associated with co_names (tuple of names of local variables...) [namei]…
jukebox
  • 193
  • 1
  • 7
0
votes
1 answer

Unable to decompile .pyc file

There is a huge problem with decompiling pyinstaller exe file,I tired uncompyle6, uncompyle3, decompyle++. Always main section is not decompiled. I wonder what's the problem. The program is working. Exe file i'm trying to…
Dan
  • 1
0
votes
1 answer

How to change the Equations in string format to normal equations in Python?

I have a set of equations in string format as given below. Need to assign some value to the left-hand side variable (In the below example: rsp, esp). Then have to calculate and store the results on the right-hand side variable (i.e., rax, esp,…
0
votes
0 answers

Reversing PYARMOR (?)

I have already decompiled an .exe file and reached to a .py but it is obfuscated using PyArmor. I have already used ''https://github.com/nlscc/unpyarmor'' to try it, but could not figure it out how to use it correctly. I've searched a lot for some…
Kyogin
  • 1
  • 1
0
votes
0 answers

Help me please decode the string (looks like gzip but it is not)

The software sends to the main server such string: \x1f\xe2\x80\xb9\x08\x00\x00\x00\x00\x00\x04\x00E...\x03\x00\x00" decode_gzip(body) Later I've tried to decode it through different online decoders and in python like bz2, zip and rar string -…
SKulibin
  • 101
  • 1
1
2