Questions tagged [python]

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

50 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
948 views

How do I perform concolic execution with Angr and collect constraints on input?

I have a program that takes a string (with some structure) as input. My aim is to collect information on what values each character in input is compared to as it gets parsed using concolic execution. ...
Rahul Gopinath's user avatar
5 votes
0 answers
923 views

Python library for linux to demangle MSVC decorated names

I am looking for a python library for linux which can demangle the function names which are mangled by MSVC. for example : Project!??0?$allocator@D@std@@QAE@XZ to Project!public: __thiscall ...
in3o's user avatar
  • 265
4 votes
1 answer
500 views

How to make IDA processor for file format with tree structure

Most of file formats IDA handles are structured in a linear way, for example EXE or ELF or Java's Class file and so on. However when it comes to tree-structured file format, I can't come up with a ...
Misty's user avatar
  • 428
3 votes
0 answers
143 views

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 ...
bcarroll14's user avatar
3 votes
0 answers
3k views

How to decompile python ELF file (Compiled with Nuitka)?

I have some files that compiled with nuitka. formats are .bin. I could get shell access to running process with pyrasite same as this guide. but I cannot decompile function codes or anything else, and ...
Purya's user avatar
  • 31
3 votes
0 answers
147 views

Z3 and If-logic

Z3 is a fantastic tool which helped me a lot! But sometimes I'm stuck on the binary code which implements custom If-logic. Recursive factorial function is good example of it: def fact(x): if x == ...
eXp's user avatar
  • 111
3 votes
0 answers
9k views

Plugin directory in IDA?

According to IDA docs, we can put a Python plugin into $HOME/.idapro/plugins/ directory. But when I copied my Python plugin there & restart IDA, IDA still do not see that. What can go wrong, and ...
user311703's user avatar
2 votes
0 answers
68 views

Angr considers REP instruction as the end of a basic block

I'm developing a python script for angr that has to find all the basic blocks present in each function in a binary. I have noticed that angr splits the basic blocks when it finds a REP instruction, I'...
Luca's user avatar
  • 121
2 votes
0 answers
63 views

Why the global string varable exploitation using angr doesn't work?

To learn the angr module, I have made a simple C code like follows. test.c #include <stdio.h> #include <string.h> char input[6]; int main(void) { scanf("%s", input); ...
doldom's user avatar
  • 55
2 votes
0 answers
131 views

Does AnyOne knows how to reverse python file that is encoded into elf binary .cpython-310.so extension? Please Help me Out

Following is the link to the file that I want to reverse. This is the python file that is encoded in cpython or cython and it is now a binary file. Please help me to decode it as it is very important ...
Jameel Safdar's user avatar
2 votes
0 answers
283 views

neovim: pwntools process automatically stops when trying to invoke interactive shell

I'm using python pwntools. I'm using python 3.10.x This line of code should open a shell for me: io.interactive() But while running this file from vim using !./% it doesn't open the shell doesn't ...
NobinPegasus's user avatar
2 votes
0 answers
212 views

Convert instructions to op code bytes in python script for IDA Pro

I need to convert into op code bytes the instructions that I have disassembled but I can't find a function that lets me do it, I've tried idc.get_bytes but it doesn't seem to work. This is my python ...
Luca's user avatar
  • 121
2 votes
0 answers
103 views

Ghidra python - retrieve the name of the called method

I am using Ghidra to build the function call graph of a method in java and therefore I am analyzing the bytecode of java and when I read an "invoke" instruction I have to go back to the name ...
alelib's user avatar
  • 21
2 votes
1 answer
2k views

How do I Decompile .Pyd file made with python, cython and pyinstaller 3.6

I created an app in 2018 with python and then used Cython and pyinstaller v 3.6. I am wondering how to decompile it. I have tried uncompyle6 + pyinstxtractor however this only works for python files,...
Cave Johnson123's user avatar
2 votes
0 answers
168 views

Call function from dll

I am writing a program and I have injected "mydll" file into the program, but I cannot call the hello function in it. How can I call the hello function? My code: import os from ctypes import ...
Furkan125's user avatar
2 votes
0 answers
128 views

Twitter scraping using Python

I've been working on a project to reverse-enginner twitter's app to scrape public posts from Twitter using an unofficial API, with Python. (I want to create an "alternative" app, which is ...
TripleS's user avatar
  • 21
2 votes
0 answers
278 views

Automating binary patching in Hopper Disassembler using python

I am curious to know if anyone has done anything similar to what I am looking to achieve... I have a .ipa file (iOS application) that I load into to Hopper Disassembler. I search for a string to ...
user35324's user avatar
2 votes
0 answers
156 views

Restore function key

I have a simple function which looks like that: keyAlphabet = [-1, 16, 32, 127, 61, -32, -31, 43, 0, 88, 2, 5, 7, 112, 64, 69, 96] key = ??? # only keyAlphabet values p = 0x1337 for i in key: ...p*=i ...
desu's user avatar
  • 238
2 votes
0 answers
229 views

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 ...
user2743's user avatar
  • 211
2 votes
1 answer
67 views

Capture and Replay

I was wondering if it was possible to create a python script that is able to capture and replay the instructions executed by a windows program for in depth analysis.
jjprince's user avatar
1 vote
0 answers
122 views

How can I extract the timestamp from this bytestring?

I am missing a piece of the puzzle that is the TCP protocol the Battlefield Bad Company games use to transfer dogtag records to/from the FESL backend. The general packet structure is quite clear and I ...
cetteup's user avatar
  • 11
1 vote
0 answers
56 views

Radare2: How to Create a Custom Scripted Panel?

TLDR: How do I get a panel in radare2 to correctly show the output of a radare2 command piped to an external script? e.g. afvd | python var_displayer.py This is my current view. Multiple panels, ...
Khalid's user avatar
  • 11
1 vote
0 answers
44 views

Where can I get source code for ASCII graph parser?

My plan is to see source code graph in vim of doxygen. I almost use TUI on Linux. So, Where can I get C, Python based source code for ASCII graph parser?
user3881835's user avatar
1 vote
0 answers
87 views

Implementing syscalls under Miasm

I'd like to use Miasm's DSE on a binary. This binary makes use of 2 syscalls: exit and ptrace. Miasm provides an implementation of some syscalls, but unfortunately, not of those two. So I tried to ...
Katoptriss's user avatar
1 vote
0 answers
576 views

How do I convert an adress to little endian such that I can feed it to my exploit?

I'm doing a small exploit exercise. For this purpose, I have the following file: #include <stdio.h> void secretFunction() { printf("Congratulations!\n"); printf("...
Grazosi's user avatar
  • 111
1 vote
0 answers
261 views

Counting how many times a function is called

I want to change context (Rdx, Rax etc.) everytime a specific function gets called. My solution: I seted up a breakpoint at function event.get_thread().set_context({"Rdx" : "bla bla&...
Yusuf2020's user avatar
1 vote
0 answers
70 views

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 ...
fsteff's user avatar
  • 111
1 vote
0 answers
34 views

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 ...
Santhosh Dhaipule Chandrakanth's user avatar
1 vote
1 answer
2k views

Extract PYZ Error

I successfully recovered some PYC files from an ELF built by PyInstaller (https://github.com/extremecoders-re/pyinstxtractor/wiki/Extracting-Linux-ELF-binaries). There is a PYZ archive in the dump. I ...
armor's user avatar
  • 119
1 vote
0 answers
2k views

Reversing PyArmor + Pyinstaller

Created an application, protected by PyArmor and used pyinstaller. I'm trying to reverse engineer it. So far I've decompiled the exe into pyc files but it's still pyarmor encrypted I can only see the ...
Cromen's user avatar
  • 19
1 vote
0 answers
341 views

Angr Use argv as initialstate

I am currently trying to use angr, and I need to find a string "Done!" which results in the "good termination" of the program. The input is 32 bits and I need to know the input which leads to the "...
Scriptguy's user avatar
1 vote
0 answers
213 views

Parse / statically analyzing .NET binaries using python

Which libraries do you use to parse and statically analyze .NET binaries? Is there a python module, or do I have to use a .NET library such as dnlib? Does it make sense to write a python wrapper for ...
langlauf.io's user avatar
  • 1,550
1 vote
0 answers
478 views

Can't install sasquatch tool

Ubuntu 16.04 LTS. I'm trying to install sasquatch tool (which should apply patches to the standard unsquashfs utility), but got the issue, every time build process show error in one place: ./build.sh:...
minto's user avatar
  • 215
1 vote
0 answers
783 views

Illegal instruction fault in stack based buffer overflow

I wrote this short C program to practice buffer overflow exploits: #include <stdio.h> #include <string.h> #include <stddef.h> #include <inttypes.h> char *decode(char *s){ ...
corporateWhore's user avatar
1 vote
1 answer
255 views

IDA Pro 7.5 Breakpoint Python Script: 'invalid non-printable character U+FEFF'

I'm trying to set a python condition breakpoint, but it throws me a weird error and I don't understand what happens: Even if I just return True, it throws the same error when I compile or when press &...
defaultuser001's user avatar
0 votes
1 answer
147 views

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. ...
Dan's user avatar
  • 1
0 votes
1 answer
60 views

IDA Pro Debugging GDB SendDbgCommand

I'm following this tutorial here https://www.triplefault.io/2017/07/loading-kernel-symbols-vmm-debugging.html to load kernel symbols with debugging. Setting up the debug environment with IDA Pro using ...
Ballers's user avatar
  • 49
0 votes
0 answers
615 views

Basic buffer-overflow on a remote program with Python/pwntools

I work on a online program in which I should do a buffer Overflow. When I run the program, I have to complete a sum of two numbers generated randomly) : >>> 451389913 + 1587598959 = If I put ...
Julien's user avatar
  • 101
0 votes
0 answers
204 views

What is this CRC32 algorithm (written in C), and how can it be written in Java or Python?

I've been trying to convert this CRC32 algorithm to Java or Python, but I haven't been successful, I believe it's because I'm not familiar enough with c. Note that I believe DAT_804818d0 is the seed, ...
Gamebuster19901's user avatar
0 votes
0 answers
1k views

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 ...
Kyogin's user avatar
  • 1
0 votes
0 answers
490 views

Decompiling exe to python source code

I've recently tried to decompile a .exe to .py source code. It partly went well as the majority of the .pyc got translated into python code but partly also failed. Like the following part: --- This ...
Eva's user avatar
  • 1
0 votes
0 answers
285 views

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 ...
SKulibin's user avatar
  • 101
0 votes
0 answers
1k views

Decoding messages sent/received by Python websocket client

I am using the websocket module for my client in python3, and I am trying to troubleshoot some errors I am getting that lead to the client disconnecting after seemingly random intervals. When I ...
FlackOverstow's user avatar
0 votes
0 answers
2k views

Reverse exe file compiled by pyinstaller

I am trying to get python source code from only exe file compiled by pyinstaller. I used the pyinstxtractor.py and got extracted folder. And then what or how should I do? Or could you explain other ...
jis0324's user avatar
  • 101
0 votes
0 answers
205 views

Debug dll file used in python script IDA

I am fairly new to RE on windows. I have a python script which via ctypes uses functions from a dll. I don't know if it's possible, but I would like to debug the dll used in the python script (the dll ...
 dl11's user avatar
0 votes
0 answers
43 views

help about methodology

I am a beginner in reverse engineering. For a challenge I need to reverse a code in python this code use enigma algorithm : To found the good configuration to decode the enigma code received. The ...
gaby developement's user avatar
0 votes
0 answers
49 views

Python based static c analysis tools

I want to analyze some open-source C code, and I'm looking for a static analysis python library for C, preferably open-source. Any ideas/suggestions, based on your experience?
macro_controller's user avatar
0 votes
0 answers
3k views

How to generate exe from compiled Python files?

I have extracted compiled files from exe (executable in windows) using PyInstaller Extractor script. In Resultant folder, i have got was pyc files bundled in pyz folder. Then I decompiled files (...
RS Gamer's user avatar
-1 votes
1 answer
1k views

Reversing a TXT obfuscated with pyArmor

Ok, so. PyArmor. Apparently, my friend used it to protect some script, except it's not a python script, it's a few TXT files. Is it possible to reverse engineer it so I can see whats in the actual TXT ...
Jack Reeve's user avatar
-1 votes
1 answer
101 views

can a stdout captured at a parameter to python script

I'm working on a CTF challenge that is find a secret password.This secret password base on the username and password that i input and the hash value had print out after hash calculation and i want to ...
y_man's user avatar
  • 1