📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  Debuggers  >>  pydbg thread missing context

Topic created on: December 30, 2009 22:09 CST by mangel12321 .

Greeting everyone,

First of all, great job for site, this is one the only real community I've found so far around pydbg, anyways I just started playing with pydbg not too long ago (after reading Gray Hat Python). I need to get information for a Windows app. API hooking will not work in this case, so I am forced to go lower and get the data from the stack. The main thread does not contain the information I am looking for, it is in one of its child processes. Anyways, the approach I am trying to follow goes something like this:

1. Attach to the main process
2. Find the Thread I am interested on
3. Set some event handlers to know when an event has happened (I guess the appropiate way would be to use breakpoints, but at this point I dont know where exactly put them)
4. Look over the stack for ASCII/UNICODE text until I find what I am interested on.

The problem I am encountering is on how to print the stack for strings that I am interested on. As I understand, on pydbg, you have to first stop all the threads, take a snapshot (then is when you get the context) and finally resume the threads. My problem is that I can not seem to initialize a context for any of the threads (neither the father nor the childs).

At this point I am stuck, I am aware this is not the most elegant way to do it, but it is the only I could think on.
Any feedback or suggestions are more than welcome!

Thank you very much!
Miguel

  ResearchAviator     December 31, 2009 21:36.52 CST
Hi Miguel,

I have also faced the same issue while working with snapshots. I suppose many of the source code examples illustrated in the text "Gray Hat Python" is not working as claimed. I was able to tweak the rest of the examples except this.

Regards,
VLD.

> mangel12321: Greeting everyone,
>
> First of all, great job for site, this is one the only real community I\'ve found so far around pydbg, anyways I just started playing with pydbg not too long ago (after reading Gray Hat Python). I need to get information for a Windows app. API hooking will not work in this case, so I am forced to go lower and get the data from the stack. The main thread does not contain the information I am looking for, it is in one of its child processes. Anyways, the approach I am trying to follow goes something like this:
>
> 1. Attach to the main process
> 2. Find the Thread I am interested on
> 3. Set some event handlers to know when an event has happened (I guess the appropiate way would be to use breakpoints, but at this point I dont know where exactly put them)
> 4. Look over the stack for ASCII/UNICODE text until I find what I am interested on.
>
> The problem I am encountering is on how to print the stack for strings that I am interested on. As I understand, on pydbg, you have to first stop all the threads, take a snapshot (then is when you get the context) and finally resume the threads. My problem is that I can not seem to initialize a context for any of the threads (neither the father nor the childs).
>
> At this point I am stuck, I am aware this is not the most elegant way to do it, but it is the only I could think on.
> Any feedback or suggestions are more than welcome!
>
> Thank you very much!
> Miguel

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit