Comments (3)
Sounds like a bug indeed. 0x80000003 is EXCEPTION_BREAKPOINT, the exception raised when a breakpoint instruction is executed. This would mean WinAppDbg is not correctly removing all breakpoints before detaching.
Question, are you trying to call Debug.stop() in response to a breakpoint event?
As a workaround, I suppose you could remove all breakpoints in your script before calling stop(), but I get the feeling the problem is not quite there, but more on the lines of the breakpoint event not being ignored when continuing execution...
from winappdbg.
The event is set from another thread. Effectively, stop()
is called immediately before my version of next()
in the debugger's main loop, not from an event handler, i.e. dispatch()
has already returned. I found that get_debugee_count()
is still 1 when stop()
returns.
def next(self):
# exceptions are caught in main loop
self.debug.wait()
try:
self.debug.dispatch()
finally:
self.debug.cont()
from winappdbg.
I tried some things and I suspect that the removal of a breakpoint while it is hit leaves the debugged process messed up (i.e. with the break instruction still in memory). The following seems to work:
- Disable all breakpoints when stop event is set
- Continue main loop
- Break main loop and call
stop()
when a timeout was hit
def mainloop(self):
while True:
if self.shared.stop_event.is_set():
self.debug.disable_all_breakpoints()
try:
if not self.next() and self.shared.stop_event.is_set():
print('stop is set & got wait timeout: breaking main loop')
break
except Exception:
print('error in tracer loop, calling stop_debug() unconditionally')
self.debug.stop()
raise
if not self.debug:
print('all debugees gone')
break
self.debug.stop()
print('debug event loop has been left normally')
def next(self):
try:
self.debug.wait(5000)
except WindowsError as e:
if e.winerror == 121:
return False
raise
try:
self.debug.dispatch()
finally:
self.debug.cont()
return True
BTW: Thanks for your excellent library
from winappdbg.
Related Issues (20)
- Missing write_string function HOT 1
- Re-implement the strings() feature
- unresolved references in gdi32.py HOT 3
- typo in breakpoint.py HOT 1
- Hooks cleared HOT 9
- read_word, read_ushort
- [question] Can I attach process at starting time? HOT 2
- Thread.get_linear_address could also take a numeric selector HOT 1
- Thread.get_linear_address doesn't take into account the segment's granularity HOT 2
- no unicode write for process write HOT 1
- Module.get_symbol_from_list: local variable 'SymbolStartName' referenced before assignment HOT 5
- Has any plan to support python 3.x? HOT 1
- How to write hex data๏ผ HOT 5
- anomaly api_hook signature HOT 2
- Is there any function to read pointer data such as [rax]? HOT 1
- WinAppDbg shuts down before programm finishes HOT 1
- sql code is broken HOT 4
- .NET CLR exception filtering? HOT 1
- Can't concat str to bytes error when using _peek_c_type in the Process class HOT 3
- does this project port to python 3? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winappdbg.