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
1answer
263 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
480 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 ...
7
votes
2answers
5k views

Good training for IDAPython

I'm familiar with python and IDA in general. I found a few very basic tutorials but nothing that goes through an explanation of the classes used and the full capability set. Near as I can tell the ...
1
vote
1answer
286 views

Analyse a piece of code using FloatingPoint instructions and calculations

i'm reversing this function doing this floating point calculations which eventually leads to a crucial compare. I need to understand what exactly are the calculations that are made and i want to re-...
1
vote
2answers
932 views

IDA scripting - get local variable by its name

During the debugging I can see all the function's local variables in tab Locals (Debugger -> Debugger Windows -> Locals(HEXRAYS)). For example I have a struct variable a1 0x891E1160:{pBuf=...
7
votes
1answer
520 views

Adding a toolbar to IDA using PySide

So i'm trying to add a custom toolbar to IDA 6.4 using their PySide download and the IDAAPI. I've tried adding a toolbar by just creating one but since it doesn't have an exec_() method I can't get ...
3
votes
1answer
3k views

Getting user comments with IDAPython API (user_cmts_*)?

How do I call the user_cmts_* functions from the IDAPython API? I am quite new to the SDK and IDAPython, so I'm kind of lost as to what I'm supposed to pass to these functions, as it's not the user-...
1
vote
2answers
263 views

pydbg: Disassemble at $exentry and relative offset from $exentry

I am attempting to disassemble a test binary I compiled written in masm. Here are the follwing bytes: Microsoft (R) COFF/PE Dumper Version 10.00.40219.01 Copyright (C) Microsoft Corporation. All ...
1
vote
1answer
118 views

Capstone Disassembly Engine Issue: OP_Access throws TypeError

After installing the Capstone python module, I ran this example on a Win7x86 PC with a minor edit (added arch and mode). However, when attempting to use insn.regs_access(), it throws a NoneType ...
3
votes
3answers
865 views

Reimplementing the x86 AESENC instruction in python

I'm having troubles implementing the AESENC x86 instruction in python. I'm reverse engineering the decryption of a indie video game. They use AES but they xor some generated data around and the key ...
1
vote
0answers
505 views

Implementation of mul x86 assembly instruction in python [closed]

I'm trying to implement the mul x86 assembly instruction in python and would like your advise to do it in the most pythonic way. Here is what I've done so far: eax = 0x51EB851F edx = 0x5D0FCF # mul ...
2
votes
2answers
223 views

Defining Pointers outside the Target Proccess Memory Space

I am making a memory editor for an application written in Python. I've successfully grabbed the memory data from the target process using OpenProcess and ReadProcessMemory functions from the kernel32....
4
votes
0answers
615 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 ...
2
votes
1answer
469 views

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 ...
0
votes
2answers
387 views

How I can get the text with c# from Tkinter (python) window?

I'm trying to find a way how I can read the textbox inside the idle. The Idle is (I think) written in python (Tkinter ?). I have tried to find the function which reads the textbox.text through ...
10
votes
1answer
3k views

Extracting arguments from IDA

Let's say I have the following function in IDA: int __usercall function<eax>(char* message<ebp>, unsigned int count<edi>) What's the fastest way to extract the argument information ...
6
votes
1answer
7k views

Which python library for parsing Linux ELF files?

I want to be able to parse 32 and 64 bit ELF files - but not create or modify them (e.g. as discussed in this thread). The ELF binaries may possibly come from embedded Linux systems, that is, the ...
0
votes
2answers
415 views

Reverse engineering a java applet using python/Javascript

I love doing online stock trading in my free time. Because I spend most of the day at my job I cannot do much of it. So, I'm thinking of making a software that will automatically place trades for me ...
3
votes
1answer
356 views

Function calls: xref.type always 'Code_Far_Call' or 'Code_Near_Call'?

Given a disassembly line in IDA Pro such as .text:0040255B call sub_407C10 Am I right to assume that analyzing the belonging address using idautils.XrefsFrom(0x0040255B) always returns an ...
1
vote
2answers
2k views

Python: Adding a asection to a PE file

I am working with PE binaries using Python and the pefile library. Its good for reading information out of a binary and rewriting certain bytes. If I wanted to add a section to the file then i am ...
0
votes
1answer
3k views

How to decompile python [duplicate]

How can I decompile python 3.3 files ?? Can you please suggest me a tool for linux ubuntu 14.10 in specific note easy decompiler didn't work for me :(
2
votes
1answer
253 views

Adding Types to GDB via Python

GDB has a reasonably robust API which is exposed to Python at runtime. It allows for inspecting various types, but does not appear to allow creation of types. However, types can be manually added by ...
0
votes
1answer
529 views

Using PyDBG how to find in which loaded module callee functions is present

Is there any quick/ faster way to find , any address resides in which loaded module. For example from stack if I have ret address of any api. I want to check from which module actually that function ...
1
vote
2answers
2k views

Modify py2exe packed executable

I have an application in Python compiled with py2exe. I have successfully extracted python scripts using Py2ExeDumper converted to .py using Easy Python Decompiler. I made some modification to the ...
0
votes
2answers
401 views

Detecting weaknesses/vulnerabilities (in games). Scientific papers/Tutorials?

I am a student of informatics with additional games engineering. I currently have a project about Reverse Code Engineering. Mainly my task is to gather information about the topic "Detecting ...
3
votes
1answer
731 views

IDA API - query number of parameters for cdecl functions

I'm writing a script that, among other things, reads and does some processing with parameters to a function. Right now my solution to find the number of arguments for a given function at addr is: (...
1
vote
2answers
2k views

How to decompile python 2.4 bytecode?

I need a good decompiler that can decompile python 2.4 byte code. I have looked over the internet and can only find python 2.5+ There are about a few hundred .pycs, so if it can decompile a directory ...
6
votes
1answer
506 views

Immunity Debugger PyPlugin

Immunity Debugger offers a feature called PyPlugin. However there is not enough documentation on it. The help for immdbg says this : PyPlugins are python scripts located at PyPlugins\ directory, ...
9
votes
1answer
5k views

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 ...
5
votes
2answers
7k views

Python lib for assembling x86, x64 and ARM exploits

It would be very useful to have a pure python library that could assemble x86, x64 and ARM instructions. Do you have any recommendations? I don't mind if they are not pure-python, but that'd be ...
0
votes
1answer
476 views

Extract a global variable [duplicate]

I'm trying to extact a global variable from an executable. Basically, I'm tryin to reverse an executable that put some python bytecode in a global variable and I'd like to extract it. I found out that ...
2
votes
0answers
155 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 ...
2
votes
1answer
526 views

Find register value of a remote process - pydbg

How can I find the register value of another process at a specific address using python pydbg or any other module that can do that? Lets say that: Address opcode 006122CB ...
3
votes
1answer
1k views

Using Python pydbg - Find out what addresses does an instruction access

I want to know how to accomplish this task with python pydbg. How does pydbg trace an instruction? For instance: should I set a breakpoint at the instruction address? Then what should I do? The ...
3
votes
2answers
516 views

How to compile c, cpp and python code as “Released/Final” version?

I want to know if there are ways to compile C, C++ and Python code in order to not be able to reverse engineering it over Linux or not? I have heard there are some ways over Windows to do it, but I ...
4
votes
1answer
2k views

How do I trace instructions in an Immunity Debugger PyCommand?

This sounds like a very simple thing to accomplish but I can't seem to get it working. I'd like to run a part of a program in ImmDbg instruction by instruction and keep track of some actions that it ...
6
votes
3answers
6k views

Paste hex bytes into IDA Pro Hex View

Is it possible to paste a series of bytes into hex view of IDA? Say I have a large buffer I need to fill with a specific value, and I have it in the form most hex editors output... 0A AB EF FF 00 01......
4
votes
1answer
1k views

vtrace / vivisect resources

Where can I find some resources to start learning about vivisect? Blog posts, presentations, PDFs, code examples, anything would be appreciated. I am aware I can read the code but before doing that ...
3
votes
2answers
817 views

Using Python CTypes to get to the IAT

I'm trying to get to IAT of a PE file. My plan is eventually overwrite some values so I can hook some stuff to help with unpacking, etc. I'm using this post https://stackoverflow.com/questions/...
6
votes
1answer
787 views

Read a struct from memory

I'm trying to load a struct defined in a program that i'm reading the memory of, so I can use it to define objects in my python debugger (in windows). What format do structs take in memory, and what ...
4
votes
1answer
5k views

API hooking using DLL injection with Python C-Types

I'd like to write something using Python C-Types that hooks API calls and can be leveraged for unpacking executables. Currently my (Python with C-Types) code launches an executable in a suspended ...
3
votes
1answer
159 views

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 ...
4
votes
1answer
2k views

Pydasm: Disassembling limited length executable shellcode

How to disassemble first 200 bytes of an executable code using pydasm library in Python? I want to know how to set size of buffer to disassemble it.
3
votes
3answers
4k views

Check DEP , ASLR and SafeSEH enabled or not , immlib

How to check if DEP, ASLR and SafeSEH defense mechanism are enabled or not in a program using immlib library of Python in Immunity Debugger ? Actually I am looking for small code snippet for each.
2
votes
1answer
271 views

Server-side bind() function, immlib

How do I get IP address and port number out of bind function in Server application. Can it be achieved with hooks like bphook in immunity debugger? My problem is that I don't know how to unpack ...
2
votes
1answer
656 views

Use of FastLogHook function in immlib?

I am a newbie in python programming for Debugging . I wrote a code for using the function FastLogHook() in immlib but i am not able to figure out the exact problem with my code as it is not working :( ...
5
votes
1answer
1k views

How to use fastloghook in immunity debugger

How does fastloghook work in immunity debugger pycommand section? i cant figure it out. Everything i try does not work and i know this code is a mess. I seriously dont understand fastloghook which ...
7
votes
1answer
234 views

Setup an IDA (python) callback when an instruction is selected

I am using the IDA python features, and I am trying to setup a callback. When a user selects an instruction in the hex or graph view, I want my callback to be triggered. I have browsed the docs, but I ...
15
votes
3answers
4k views

How to debug an IDAPython script from within IDA?

IDAPython is great plugin in IDA. It is so handy to write small script to decode, decrypt or fix (patch) a binary in IDA. I can just write, load and run a script, and can use print for the usual ...
5
votes
1answer
2k views

Is it possible to create data xrefs manually?

I have a binary with lots of indirect calls (call dword ptr [register + offset ]) the register is calculated with a simple math which I manage to statically calculate on my own (the call itself lead ...