Questions tagged [python]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
59 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 ...
user avatar
0 votes
0 answers
128 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 ...
user avatar
  • 101
0 votes
1 answer
208 views

Frida hook multiple processes

There was such a situation. I run the frida hook on the process like this: frida -f '..\hack2\hackme.exe' -l .\start.js In the script itself I do this var moduleData = Process.getModuleByName("...
user avatar
  • 13
1 vote
0 answers
55 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 ...
user avatar
0 votes
0 answers
28 views

Pattern search for binary data

I know that I can use regex to search binary to find magic byte sequences. But I want to have something more sophisticated and versatile to perform the search like: if there's dword which is non zero, ...
user avatar
  • 1,750
1 vote
1 answer
233 views

Is there a way to install Python 3 modules into IDAPython with pip?

I would like to use regular python packages in my IDAPython scripts, but I can't figure out how to install them into IDA's Python environment. I don't even know where this python environment is, or ...
user avatar
0 votes
1 answer
199 views

IDAPython - How can I read the value of a function argument? (IDA 7.6)

I'm trying to automate some of my debugging with a python script that automatically places breakpoints at the first and last instructions of the functions I want to analyze. I'm using the breakpoint's ...
user avatar
1 vote
2 answers
78 views

C++, Windows UI Automation and DaVinci Resolve

I've been researching this topic for a while, but the information is extremely limited and very confusing. DaVinci Resolve is an editing and color grading software, its tools are so many and so ...
user avatar
0 votes
0 answers
64 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("...
user avatar
  • 101
0 votes
0 answers
68 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, ...
user avatar
0 votes
0 answers
82 views

Put pwntools in DEBUG mode when using library

When using pwntools as a library (that is, not importing everything as an exploit kit, just individual libraries), how can I turn on debug mode, so that tubes print to the screen everything they read ...
user avatar
1 vote
1 answer
284 views

How to get function signature using IDA Python in IDA Pro

I open .exe file in IDA with .pdb attached to it, so IDA scans .pdb and shows function names. I need to get signature strings of many functions. I can't do it manually so I want to use built-it IDA ...
user avatar
  • 11
1 vote
0 answers
60 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&...
user avatar
0 votes
1 answer
85 views

PEDA: Don't show context

gdb-peda shows a very useful context each time it stops (b, si, etc.), but sometimes I don't want it. Is there any way to quiet it so it won't show the context automatically (unless prompted context)?...
user avatar
2 votes
1 answer
161 views

Hooking IAT in remote process with Python?

I'm trying to hook a win32 function call (CreateFileW) inside of a notepad process to have the function do additional actions before returning what it should do. Ultimately, this will assist me in ...
user avatar
1 vote
0 answers
35 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 ...
user avatar
  • 111
0 votes
1 answer
68 views

Creating table with IDAPython

I'd like to create the table like below, I could not found any clue while googling it. Is it possible to make table with IDAPython, especially with idaapi.simplecustviewer_t class? Any advises would ...
user avatar
  • 123
0 votes
0 answers
47 views

Execute Python code/script inside a game with statically linked Python lib

I'm playing a game that's made in C++ and embeds Python (2.7) for the client interface and most of its functions. At first, this game used to have dynamically linked Python lib for embedding. So I ...
user avatar
  • 1
1 vote
1 answer
136 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 &...
user avatar
0 votes
1 answer
139 views

uncompyle6 gives success message but output is not readable

I am trying to use uncompyle6 to decompile a .pyc code. I even tried --verify option. It says Successfully decompiled file but the output only contains strings like \xe0\xb3\x0bh\x90. What should I ...
user avatar
1 vote
0 answers
28 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 ...
user avatar
3 votes
1 answer
161 views

Sharing variable between scripts

I wrote some Python scripts to help me disassemble one given file (only one), and I'd like to share some variables between differents scripts (or between 2 different executions of the same script). Is ...
user avatar
0 votes
0 answers
559 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 ...
user avatar
  • 1
3 votes
1 answer
337 views

Printing all strings in a Ghidra project with python

I got the string objects from a Ghidra project using this code: l = list() def callback(s): l.append(s) ss = StringSearcher(currentProgram, 5, 1, False, True) ss.search(None, callback, True, ...
user avatar
  • 41
0 votes
0 answers
227 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 ...
user avatar
  • 1
0 votes
1 answer
409 views

How can I reverse this python code (obfuscated by b64, gzip and many more)

How can I Deobfuscate this python code Link to code I tried to replace eval places by print. but it won't work and output is also obfuscated Head of the code looks like this can anyone please help me
user avatar
0 votes
0 answers
129 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 ...
user avatar
  • 101
2 votes
0 answers
923 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 ...
user avatar
  • 21
0 votes
2 answers
189 views

convert code to python

i have snippet code that i want to convert to python to understand the types that ghidra use such *(byte *) and *(code *) and *(uchar *) etc.. the first code: void one(int param_1,int param_2) { int ...
user avatar
2 votes
0 answers
93 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 ...
user avatar
  • 21
3 votes
2 answers
252 views

On reverse engineering an udp protocol to control a drone

My goal is to control my drone with my raspberry pi using python and not the app that is being delivered together with it. First I connected the app to the drone, flew and used aircrack-ng to get the ...
user avatar
-1 votes
1 answer
590 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 ...
user avatar
0 votes
1 answer
45 views

How to use two commands in python -c?

I am wanting to execute python command by using python -c but it contain in string library so i need import it. While reading man i find this: when called with -c command, it executes the ...
user avatar
  • 13
0 votes
1 answer
187 views

Need starter-help on reverse-engineering a game algorithm

I've got a dataset of about 1700 attacks in this game. A subset of the data is provided here. It consists of 9 columns: modifier Astr Aspd Adex Adef Dstr Dspd Ddex Ddef The modifier is in a range of ...
user avatar
  • 1
2 votes
1 answer
389 views

How do I get the all the basic binary blocks containing a special instruction like 'CALL' or 'RET' using python in Ghidra?

I am using Ghidra to do reverse engineering of an ARM binary. I want to print the disassembly of all blocks across all functions containing a specific instruction like 'CALL' or 'RET'. How do I do ...
user avatar
1 vote
0 answers
160 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 ...
user avatar
-1 votes
1 answer
34 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 ...
user avatar
  • 1
1 vote
1 answer
912 views

Ghidra python - get string x-refs in a binary

In Ghidra, there is Defined Strings window, that lists all the strings in the binary and their location. I want to access the strings from Ghidra Python, and to get all the x-refs to those strings. ...
user avatar
2 votes
1 answer
332 views

How to reverse engineer cx_Freeze exe's?

How to reverse engineer Python scripts turned into binaries with cx_Freeze?
user avatar
1 vote
1 answer
6k views

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 ...
user avatar
0 votes
0 answers
475 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 ...
user avatar
1 vote
1 answer
1k views

How can I debug Ghidra plugin Python scripts in IDE?

I'd like to debug Ghidra plugin scripts written in python using an IDE such as Eclipse. I have installed Pydev and the GhidraDev plugin (from Ghidra open a script in Eclipse to autoinstall the plugin)...
user avatar
  • 13
0 votes
0 answers
1k 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 ...
user avatar
  • 101
1 vote
1 answer
2k views

Buffer overflow: pwntools does not give me a shell, despite exploit working without pwntools

Recently, I've been trying to learn how to use the pwntools library. I am trying to exploit the following program using pwntools: #include <stdio.h> #include <stdlib.h> int main(void) { ...
user avatar
-1 votes
1 answer
801 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 ...
user avatar
  • 99
0 votes
1 answer
100 views

Is command injection using a valid file path possible?

My question is theoretical, and not bound to python - but for the sake of simplicity, I'll use Python code snippet. Let's assume I have the following code: import os import sys if os.path.exist(sys....
user avatar
2 votes
1 answer
320 views

How to start out in reversing?

I'm new in reversing and I'd like a lot to learn about it. I have little to no knowledge about it. Is still worth to learn x86 Assembly? Since almost everything these days work on x64 architecture. ...
user avatar
  • 153
1 vote
1 answer
127 views

Using angr/radare2 to estimate values given chunks of assembly

I'm currently using radare2 in order to construct a simple CFG, each block/node in that graph is composed of one or more assembly instructions, I wish to estimate the value of specific register or ...
user avatar
0 votes
1 answer
115 views

Python decompilation seems to return gibberish (partly)

I decompiled a pyc file with uncompyle6, and this is the result: # uncompyle6 version 3.7.3 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Aug 24 2020, 10:24:35) # [GCC 9.3.0] ...
user avatar
3 votes
1 answer
151 views

reason of padding in exploit

I was doing vulnserver bufferflow exploit. I saw a tutorial where the he makes a payload to exploit the server. Take a look at the exploit: #!/usr/bin/python import socket target_ip = "10.0.2....
user avatar