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
0
votes
0answers
27 views

how can i convert this file into png using python?

i need to convert this file into PNG, my doctor asked me to do this task to get the idea of the course before be begin, i need to know which steps should i follow achieving so! the file is: Drive Link
-1
votes
0answers
20 views

Get contents of the script tags from a page and save it to a javascript file format using python

I try to scrape a page to get tag script only using python. This is the code: from urllib.request import urlopen from bs4 import BeautifulSoup as soup import re import numpy as np url = urlopen("...
-1
votes
1answer
64 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 ...
0
votes
0answers
21 views

Decompiling PYC file gives “Embedded file name”

I have a PYC file (https://pastebin.com/raw/dcWfYZSV) and when I decompile using uncompyle6 I get https://pastebin.com/JqL7ZB0W It says "Embedded file name" - stupid question but is that the ...
0
votes
1answer
40 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 ...
0
votes
1answer
100 views

Need starter-help on reverse-engineering a game algorithm

I've got a dataset of about 1700 attacks in this game. Subset of the data is provided here. It comprises of 9 columns: modifier Astr Aspd Adex Adef Dstr Dspd Ddex Ddef The ...
2
votes
1answer
83 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 ...
1
vote
0answers
35 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 ...
-1
votes
1answer
25 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 ...
1
vote
1answer
140 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. ...
2
votes
1answer
89 views

How to reverse engineer cx_Freeze exe's?

How to reverse engineer Python scripts turned into binaries with cx_Freeze?
1
vote
1answer
1k 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 ...
0
votes
0answers
130 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 ...
1
vote
1answer
420 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)...
0
votes
0answers
311 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 ...
1
vote
1answer
378 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) { ...
0
votes
1answer
189 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 ...
0
votes
1answer
58 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....
2
votes
1answer
184 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. ...
0
votes
0answers
27 views

How can I have an interactive r2pipe session?

I am trying to make an interactive tutorial. It uses radare2 with r2pipe as its reverse engineering toolkit. I want my users to be able to use the visual mode through r2pipe. In order for the visual ...
1
vote
1answer
53 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 ...
0
votes
1answer
74 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] ...
3
votes
1answer
75 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....
0
votes
0answers
45 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 ...
0
votes
0answers
71 views

Debug x64dbgpy scripts in vscode?

i've tried to debug a x64dbgpy script using ptvsd and vscode. don't ask me how, but i was able to break into the script using a "remote python attach" session, setting breakpoints and stepping into ...
1
vote
0answers
871 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 ...
2
votes
1answer
74 views

Ghidra Python - cancel decompilation task

The way to decompile a function in Ghidra Python is: decomp = DecompInterface() decomp.openProgram(currentProgram) decompile = decomp.decompileFunction(func, 1000, monitor) However, in ...
0
votes
0answers
34 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 ...
2
votes
1answer
1k views

Decompiling .pyc file to 0 byte .py file

i am doing the CTF-like challenges. One of these tasks need us to decompiling Python bytecode 3.8 (.pyc file) into py file. However, the py file that generated by pyc file is 0 byte The original file'...
1
vote
1answer
89 views

Ida python No module named tempo

I tried to run tempo.py from ida python github , but I got error No module named tempo According to Igor Skochinsky answer , this script is wrong Apparently, tempo was an internal module used ...
0
votes
1answer
249 views

Ghidra Python - Get Decompile Line Text by RVA

Is there a way in Ghidra Python to get the corresponding decompile line by RVA? Or the opposite - get the corresponding RVA from a given line in a decompile?
1
vote
3answers
434 views

Ghidra Python - Get x-refs of a specific function

What is the best way to get calling x-refs for a specific function? I am aware of the following method: func = getFirstFunction() while func is not None: func_name = func.getName() if ...
0
votes
1answer
304 views

GDB - Send Python output to the program after SIGINT

I am trying to learn GDB to better understand buffer overflows but I can't find an answer to my problem which is how can I send a Python-generated output to the program when the program asks for user ...
1
vote
1answer
1k views

Using Python 3.7 and 2.x in same IDA

I have IDA Pro 7.4 that use with Python 3.7 and I have some IDA-plugin that works only with Python 2.7. Is there any way to run that Python 2.7 based plugin?
1
vote
1answer
1k views

Decompiling Python Files: ValueError

So I have this python file and I successfully unpacked its content inside of it we have our file.pyc I appended the magic bytes to it so it went from: E3 00 00 00 00 00 00 00 00 00 00 00 00 to ...
0
votes
0answers
47 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?
3
votes
1answer
563 views

ghidra-python: create struct with big endian field

Using ghidra's python scripting engine, I'd like to create a struct which contains a big endian, unsigned integer. This field is always big endian, no matter what the endainess of the binary CPU is. ...
-2
votes
1answer
3k views

How to decompile obfuscated Python code?

I have an executable file, which I am trying to decompile. I have already deduced that it was originally programmed in Python. I know that it was obfuscated with PyArmor and possibly compiled with ...
-1
votes
1answer
124 views

Help to understand what's inside base64 string

While performing a file upload, a template parameter is sent together with file. Service acts differently when different parameters are passed. I need help to figure out what this parameter contains. ...
1
vote
1answer
220 views

Python self decryption script, as mean of obfuscation

I have a software with an embedded python interpreter. The software can open upon startup a given .py script and execute it. Let's assume that in my python environment I can't open other files, and I ...
4
votes
1answer
423 views

Ghidra Headless Analyzer - Create Functions

I'm interested in open a binary file (.bin, without arch info), and analyze it with analyzeHeadless.bat (Ghidra version without GUI). I know what is the architecture of the file, so I pass it as a ...
1
vote
3answers
86 views

How to input ascii control character into program?

I am working on a CTF where I need to pass an address as input to a program. This address contains the value 0x09 (the tab character). This is causing me problems, because it seems that bash is ...
0
votes
1answer
2k views

How to reverse a Cython shared object (.so)

I have a .so file (ELF 64-bit LSB shared object, x86-64, dynamically linked, no section header) with an embedded Cython program. To run the program inside the .so file there is a single python3 ...
1
vote
1answer
5k views

How to to decompile a pyinstaller exe, back to source code?

Python versions, this method has been tried on: 3.7.5, 3.6.0, 3.5.0, 2.7.17? (I know, I'm just too desperate to get my source back.) I have problem with decompiling an exe. I kind of deleted the ...
3
votes
1answer
5k views

Best way to protect source code of .exe program running on Python?

I am developing proprietary software that would be distributed in a form of .exe file. In order to use it, users will have to authenticate with their whitelist credentials (username + password). The ...
2
votes
2answers
270 views

Prevent Memory Inspection in a Cython program?

Cython is a great way to protect the source code of a Python program. However, memory inspection and memory reverse engineering can still be done to this Cython program. What are ways to prevent (or ...
1
vote
0answers
70 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 "...
0
votes
1answer
111 views

x64dbgpy: application unresponsive when trying to automate inside breakpoint callback

When a breakpoint callback is triggered trying to automate the debugger inside the callback causes the application to become unresponsive. x64dbg continues functioning but the application itself doesn'...
2
votes
1answer
701 views

Python Script to get disassembled output of an EXE file

I'm pretty new to Ghidra, and looking to use it's API (headless analyzer) and get the assembled file through command line using python. Here is my code, which is likely far from the correct code. It ...
3
votes
0answers
110 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 == ...