Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

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

-2
votes
0answers
33 views

Beginner, want to write a revere engineering script in Python [on hold]

I have a malware DLL file that I want to use python script to reverse engineering and changing the feature inside it. For example, i want to change malware's call back IP addresses, change malware'...
3
votes
0answers
30 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. ...
-1
votes
1answer
40 views

How to use Python while debugging in IDA

I'm debugging an .exe file in IDA. At a specific point during debugging, I want the Python code to automatically take the data in *(eax+8) and encrypt it with that module and print the result to file ...
2
votes
2answers
142 views

How can I reverse this recursive function?

This is the python code I wrote of a simple crackme that I have reversed but I am not able to understand what the recursive function here does. def the_process(stored, inp, size): idx = 0 ...
3
votes
1answer
106 views

Run a python command with “run” on GDB

Hi I'd like to run a python command python -c 'print "\x90"*52' when the program start in GDB, as I would do when I execute : python -c 'print "\x90"*52' | ./myProg . Does anyone knows any way to ...
4
votes
1answer
138 views

Is there a way to explicitly connect r2pipe to an existing radare2 session that I have open?

I understand that I can execute my script within a session using [0x401000]> . server.py and the pipe will be connected to it when I call r2pipe.open() with no arguments. Ideally I would like to ...
0
votes
0answers
56 views

Rarun2 Multiple Input Executable

After further analysis of a binary, ran into a separate issue debugging. Have an r2pipe script successfully providing 1 input (more about r2pipe in this solved question: r2pipe won't prompt for ...
0
votes
0answers
20 views

Try to pass an argument a no printable characters in debug mode on radare2

I have a program and I like to know if the assigment of a value is correct, but when I try to run in debug mode and with an argument it sends this error: $ r2 -d ./col "`python -c "print '\x41'*16+'\...
0
votes
0answers
42 views

Can not find the difference between two binaries but they are not identical for sure [duplicate]

I am new to reverse engineering. My goal is to find out what modifications were made to an android library (.so file). I have the original file and I have the modded file. The modded is working fine ...
2
votes
2answers
150 views

IDA: call a function with different arguments

I'm reversing some software and found the function which decrypts some stuff: As you can see it has the password parameter for it which gets decrypted in this function. Function disassembly: ...
0
votes
0answers
289 views

Extract Icons from PE file with python on Linux

I am trying to write some code to extract all icons from a PE file using PEfile on linux The PE file that gives me a challenge has more icons in the RT_ICON section then listed in the RT_GROUP_ICON ...
0
votes
1answer
106 views

Pyemu - cannot use PEPyEmu() module, Python

I want to run code from Gray Hat Python book for upx_unpacker. I have downloaded PyEmu, but when I run script I got this error: AttributeError: PEPyEmu instance has no attribute 'load' My script use ...
1
vote
2answers
152 views

What is a more efficient way to locate disasm patterns in IDAPython?

This is my first "serious" IDAPython script. As I sorta suspected, it's performing waaaayyyyy too slow so I wanted to ask for some pointers on this: fp = MinEA() end = MaxEA() while fp < end: ...
0
votes
0answers
41 views

What are general steps to follow when decrypting data using algorithms found in a target?

I've seen examples of reverse engineers locating some encoding algorithm inside of file code in a disassembler such as IDA Pro, and then crafting Python code which is then passed the ciphertext as an ...
1
vote
3answers
575 views

Reverse engineering USB peripheral driver

I'm looking to reverse engineer a Windows driver for a printer I have here. I found out a bit about USB sniffing but I don't think Snoopy runs on Windows 7. I know the driver is on my computer ...
1
vote
0answers
183 views

How to hook Windows syscall ntcreatefile an get path to saved file from notepad? Python 3 [closed]

I need to automate some text editing and encryption. I've been doing some research and it seems uhooker can detect when a file is saved or when a program is closed, but I didn't see any examples to ...
2
votes
4answers
894 views

How to decompile with Hex Rays via a Python API?

If i have a large set of files and I'd like to run Hex-rays over them to produce output as C - can I do so in python? I see there is IDA Python And I see Hex-rays has a C++ SDK Is there a python Hex-...
1
vote
1answer
418 views

Processor Type in IDA Python

While using IDA Python and related code of idaapi, the processor type is not returned correctly. Specially we will have MetaPC instead of the exact processor type. This is my code that I used it: ...
1
vote
1answer
396 views

Extract conditional instructions using IDA python in ARM binaries

While using IDA Python for extract ARM instructions, I noticed that some instructions are not extracted completely. For example, conditional instructions such as BCS or BCC are printed as B. For ...
1
vote
1answer
1k views

Volatility - manually inspect heap of a process

According to the book The Art of Memory Forensics[1], there is a heaps plugin that can extract out information from the heap memory of a process. I'm using latest version of volatility - 2.6 , but the ...
5
votes
1answer
211 views

How can I get the shared libraries' function calls using angr

I am trying to get all the library function calls that a binary performs in a preorder-DFT traversal of the CFG. I'm able to get the CFG like: import sys, angr import networkx as nx proj = angr....
0
votes
1answer
96 views

Can anyone help me identify and decode this string? [closed]

Below is a part of a code that I reversed with repy2exe and I want to understand what it does and especially how to decode the value in the "secret" variable: using = [ 'Mg==\n', 'MTA1\n', ...
0
votes
0answers
134 views

Obfuscation - Control Flow Flattening Python code

To begin with, I should mention that I have gone through this thread:How do I protect Python code ? and have a perused the paper for Woot `13 which talks about reversing the Dropbox client written in ...
0
votes
0answers
93 views

Closed-Source Binary Code Coverage Library in Python

I would like to know if there exists tool(s)/librar[y/ies] built using Python that would show me edge coverage by modules as I run a certain closed-source binary (ELF, PE) using these tool(s)/librar[y/...
2
votes
1answer
293 views

Deducing Protobuf Schema and Datatypes

I have a number of protobuf files but no .proto schema file! cat myfile.pbuf | protoc --decode_raw > outputfile.txt Using the above command, I was able to decode the file into a somewhat readable ...
0
votes
1answer
242 views

Decode Ascii string values from reverse-engineered lua file

I decompiled a lua file with unluac and it turns out all the string variables are not readable and are instead ascii encoded clues = { { answer = { "\216\173", "\216\177", "\...
-1
votes
1answer
77 views

Python winappdbg getting process name from event object

I'm developing a debugging automation system using https://github.com/MarioVilas/winappdbg. I would like to retrieve process name from event object. Here is my code: def EventHandler(event): ...
4
votes
2answers
743 views

IDA - Some issues regarding function's/data/code recognition

I have to write an IDAPython script and I came across many false positives in IDA's function/code/data recognition. Case 1 - Invalid function's end (rpcrt4.dll): In some DLLs (especially in rpcrt4....
1
vote
3answers
715 views

How to monitor/reverse engineer RS485-connected display device traffic?

Can anyone point me in the right direction for tutorials etc on reverse engineering RS484 connected battery management system? I have a large 12V lithium battery module which has an internal BMS and ...
1
vote
1answer
2k views

IDA python : reading n bytes from an offset

Using python in IDA, I would like tu create a partial file dump. For exemple I would like to dump the data from offset X for a size of Y. I believe I could do it by using the idc.Dword function : ...
3
votes
1answer
135 views

vivisect parse assembly

I'm using the vivisect library to parse functions within a binary, the documentation for vivisect is quite slim and I was wondering if there was a way to get information about the assembly ...
0
votes
1answer
195 views

Handling of the communication data I received with PySerial (Python)

In a nutshell: I've sniffed the data that goes from the controlling PC to the modem via RS232 serial port by building a little Y-adapter, now I want to figure out how to reverse engineer that data so ...
0
votes
1answer
400 views

Write own obfuscator in Python [closed]

I want to create my own, static obfuscator for any executables. What is the best way to do it with python? How should I start or what sources should I learn to do it? Anyon can give me some tips or ...
4
votes
2answers
2k views

Is it possible to get a list of user-defined names in IDA?

IDA allows one to rename a program entity (e.g. register, variable, function) using N shortcut. Is it possible to get a list of such user-defined names in IDA?
3
votes
4answers
635 views

Locate address of function in DLL

I need to locate the address of a function in a DLL at runtime which isn't exported. The DLL in question is vbe7.dll related to Visual Basic (and macros). The function is ___vbaInStr, can be found in ...
3
votes
1answer
921 views

Getting pydbg working on windows 10

I downloaded the paimei tool and dropped the pydbg package files inside .../paimai/pydbg then installed paimei but I can't seem to get pydbg to work. I keep getting an error with pydasm when trying to ...
1
vote
2answers
1k views

idapython - Determine if item is code or data

I need to determine whether an IDA's item is code or data. Sometimes, data resides in an executable's code section (virtual functions tables, switch tables and stuff). So in IDA, you can sometimes see ...
2
votes
0answers
91 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 ...
1
vote
0answers
2k 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 ...
1
vote
1answer
251 views

QtNetwork in IDA's PyQt5

I'm interested in writing a network component to my IDAPython plugin, and QtNetwork looks really attractive, however it isn't include-able from IDAPython shell. Is there a simple way to add that ...
2
votes
1answer
37 views

Immnunity Debugger Python API Incorrect code execution order

PyCommand import immlib def main(args): imm = immlib.Debugger() imm.setBreakpoint(0x411077) imm.setReg("EAX",0x0) imm.log("EAX: {}".format(imm.getRegs()['EAX'])...
0
votes
1answer
172 views

How to DUMP the full hexa of each function extracted by analysis of binary file?

I used a script python from radare2-bindings to write a code analysing a binary file, i extracted the name , the start address and the size of each function , but i can't dump the hexa of each ...
5
votes
1answer
435 views

Modifying PPID to avoid anti-debugging measure

I'm trying to debug an application that reads the Parent Process Id(PPID), to check if the application is being debugged. It expects the PPID to be the PID of explorer.exe, if it isn't, it quits. To ...
0
votes
1answer
690 views

Resolving DLL function names using ordinals

I am trying to figure out how to get the imports of a PE using the PEfile python project (https://github.com/erocarrera/pefile) One thing special about that library is the ordlookup folder. It looks ...
1
vote
0answers
366 views

To write a Python file to return a JSON represented list [closed]

I need to write a script that uses the r2pipe API to call the radare2 instance, analyze notepad.exe, and have it return a JSON-represented list of each function in the binary along with its virtual ...
1
vote
1answer
287 views

Pydbg setting registers without breakpoint?

In pydbg, is it possible to set a register without having it hit a break point first? Consider the following example break point handler: def handler_breakpoint(mdbg): print "[+]Hit breakpoint" ...
0
votes
1answer
113 views

Get DLL name with PyDBG and System_dll.py?

Is it possible to get the name and path of a DLL that is loaded by the application using PyDBG and System_dll.py? I have a script and PyDBG handles loaded dlls with just: dbg.set_callback(...
1
vote
1answer
309 views

Reverse engineering car stereo panel

I'd like to reverse engineer a car stereo front removable panel. It's a leftover from a broken car stereo. I'd like to do so by connecting the panel's 14 connections to Raspberry Pi 2 model B's GPIO ...
2
votes
1answer
226 views

Can I get different thread registers with PyDBG?

I am writing a python debugger and disassembler using the PyDBG library I have the disassembler part working, but not all of the debugger. Is it possible to use it to return something similar to: [*] ...
1
vote
0answers
340 views

Reverse Engineering program written in Python, compiled with “freeze 2 [REWRITE] [closed]

I am already aware of the question: 'Reverse Engineering program written in Python, compiled with “freeze”' I have Immunity Debugger and is this the pyc code and the structures? When I run the ...