Package winappdbg
[hide private]
[frames] | no frames]

Source Code for Package winappdbg

  1  #!~/.wine/drive_c/Python25/python.exe 
  2  # -*- coding: utf-8 -*- 
  3   
  4  # Copyright (c) 2009-2014, Mario Vilas 
  5  # All rights reserved. 
  6  # 
  7  # Redistribution and use in source and binary forms, with or without 
  8  # modification, are permitted provided that the following conditions are met: 
  9  # 
 10  #     * Redistributions of source code must retain the above copyright notice, 
 11  #       this list of conditions and the following disclaimer. 
 12  #     * Redistributions in binary form must reproduce the above copyright 
 13  #       notice,this list of conditions and the following disclaimer in the 
 14  #       documentation and/or other materials provided with the distribution. 
 15  #     * Neither the name of the copyright holder nor the names of its 
 16  #       contributors may be used to endorse or promote products derived from 
 17  #       this software without specific prior written permission. 
 18  # 
 19  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 20  # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 21  # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 22  # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 23  # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 24  # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 25  # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 26  # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 27  # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 28  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 29  # POSSIBILITY OF SUCH DAMAGE. 
 30   
 31  """ 
 32  Windows application debugging engine for Python. 
 33   
 34  by Mario Vilas (mvilas at gmail.com) 
 35   
 36  Project: U{http://sourceforge.net/projects/winappdbg/} 
 37   
 38  Web:     U{http://winappdbg.sourceforge.net/} 
 39   
 40  Blog:    U{http://breakingcode.wordpress.com} 
 41   
 42  @group Debugging: 
 43      Debug, EventHandler, EventSift, DebugLog 
 44   
 45  @group Instrumentation: 
 46      System, Process, Thread, Module, Window, Registry 
 47   
 48  @group Disassemblers: 
 49      Disassembler, 
 50      BeaEngine, DistormEngine, PyDasmEngine 
 51   
 52  @group Crash reporting: 
 53      Crash, CrashDump, CrashDAO, CrashDictionary 
 54   
 55  @group Memory search: 
 56      Search, 
 57      Pattern, 
 58      BytePattern, 
 59      TextPattern, 
 60      RegExpPattern, 
 61      HexPattern 
 62   
 63  @group Debug events: 
 64      Event, 
 65      NoEvent, 
 66      CreateProcessEvent, 
 67      CreateThreadEvent, 
 68      ExitProcessEvent, 
 69      ExitThreadEvent, 
 70      LoadDLLEvent, 
 71      UnloadDLLEvent, 
 72      OutputDebugStringEvent, 
 73      RIPEvent, 
 74      ExceptionEvent 
 75   
 76  @group Win32 API wrappers: 
 77      win32, Handle, ProcessHandle, ThreadHandle, FileHandle 
 78   
 79  @group Helpers: 
 80      HexInput, HexOutput, HexDump, Color, Table, Logger, 
 81      PathOperations, 
 82      MemoryAddresses, 
 83      CustomAddressIterator, 
 84      DataAddressIterator, 
 85      ImageAddressIterator, 
 86      MappedAddressIterator, 
 87      ExecutableAddressIterator, 
 88      ReadableAddressIterator, 
 89      WriteableAddressIterator, 
 90      ExecutableAndWriteableAddressIterator, 
 91      DebugRegister, 
 92      Regenerator 
 93   
 94  @group Warnings: 
 95      MixedBitsWarning, BreakpointWarning, BreakpointCallbackWarning, 
 96      EventCallbackWarning, DebugSymbolsWarning, CrashWarning 
 97   
 98  @group Deprecated classes: 
 99      CrashContainer, CrashTable, CrashTableMSSQL, 
100      VolatileCrashContainer, DummyCrashContainer 
101   
102  @type version_number: float 
103  @var  version_number: This WinAppDbg major and minor version, 
104      as a floating point number. Use this for compatibility checking. 
105   
106  @type version: str 
107  @var  version: This WinAppDbg release version, 
108      as a printable string. Use this to show to the user. 
109   
110  @undocumented: plugins 
111  """ 
112   
113  __revision__ = "$Id: __init__.py 1303 2013-12-20 12:14:40Z qvasimodo $" 
114   
115  # List of all public symbols 
116  __all__ =   [ 
117                  # Library version 
118                  'version', 
119                  'version_number', 
120   
121                  # from breakpoint import * 
122  ##                'Breakpoint', 
123  ##                'CodeBreakpoint', 
124  ##                'PageBreakpoint', 
125  ##                'HardwareBreakpoint', 
126  ##                'Hook', 
127  ##                'ApiHook', 
128  ##                'BufferWatch', 
129                  'BreakpointWarning', 
130                  'BreakpointCallbackWarning', 
131   
132                  # from crash import * 
133                  'Crash', 
134                  'CrashWarning', 
135                  'CrashDictionary', 
136                  'CrashContainer', 
137                  'CrashTable', 
138                  'CrashTableMSSQL', 
139                  'VolatileCrashContainer', 
140                  'DummyCrashContainer', 
141   
142                  # from debug import * 
143                  'Debug', 
144                  'MixedBitsWarning', 
145   
146                  # from disasm import * 
147                  'Disassembler', 
148                  'BeaEngine', 
149                  'DistormEngine', 
150                  'PyDasmEngine', 
151   
152                  # from event import * 
153                  'EventHandler', 
154                  'EventSift', 
155  ##                'EventFactory', 
156  ##                'EventDispatcher', 
157                  'EventCallbackWarning', 
158                  'Event', 
159  ##                'NoEvent', 
160                  'CreateProcessEvent', 
161                  'CreateThreadEvent', 
162                  'ExitProcessEvent', 
163                  'ExitThreadEvent', 
164                  'LoadDLLEvent', 
165                  'UnloadDLLEvent', 
166                  'OutputDebugStringEvent', 
167                  'RIPEvent', 
168                  'ExceptionEvent', 
169   
170                  # from interactive import * 
171  ##                'ConsoleDebugger', 
172   
173                  # from module import * 
174                  'Module', 
175                  'DebugSymbolsWarning', 
176   
177                  # from process import * 
178                  'Process', 
179   
180                  # from system import * 
181                  'System', 
182   
183                  # from search import * 
184                  'Search', 
185                  'Pattern', 
186                  'BytePattern', 
187                  'TextPattern', 
188                  'RegExpPattern', 
189                  'HexPattern', 
190   
191                  # from registry import * 
192                  'Registry', 
193   
194                  # from textio import * 
195                  'HexDump', 
196                  'HexInput', 
197                  'HexOutput', 
198                  'Color', 
199                  'Table', 
200                  'CrashDump', 
201                  'DebugLog', 
202                  'Logger', 
203   
204                  # from thread import * 
205                  'Thread', 
206   
207                  # from util import * 
208                  'PathOperations', 
209                  'MemoryAddresses', 
210                  'CustomAddressIterator', 
211                  'DataAddressIterator', 
212                  'ImageAddressIterator', 
213                  'MappedAddressIterator', 
214                  'ExecutableAddressIterator', 
215                  'ReadableAddressIterator', 
216                  'WriteableAddressIterator', 
217                  'ExecutableAndWriteableAddressIterator', 
218                  'DebugRegister', 
219   
220                  # from window import * 
221                  'Window', 
222   
223                  # import win32 
224                  'win32', 
225   
226                  # from win32 import Handle, ProcessHandle, ThreadHandle, FileHandle 
227                  'Handle', 
228                  'ProcessHandle', 
229                  'ThreadHandle', 
230                  'FileHandle', 
231              ] 
232   
233  # Import all public symbols 
234  from breakpoint import * 
235  from crash import * 
236  from debug import * 
237  from disasm import * 
238  from event import * 
239  from interactive import * 
240  from module import * 
241  from process import * 
242  from registry import * 
243  from system import * 
244  from search import * 
245  from textio import * 
246  from thread import * 
247  from util import * 
248  from window import * 
249   
250  import win32 
251  from win32 import Handle, ProcessHandle, ThreadHandle, FileHandle 
252   
253  try: 
254      from sql import * 
255      __all__.append('CrashDAO') 
256  except ImportError: 
257      import warnings 
258      warnings.warn("No SQL database support present (missing dependencies?)", 
259                    ImportWarning) 
260   
261  # Library version 
262  version_number = 1.5 
263  version = "Version %s" % version_number 
264