debugpy 1.8.5__zip → 1.8.7__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {debugpy-1.8.5/src/debugpy.egg-info → debugpy-1.8.7}/PKG-INFO +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_calltip_util.py +19 -21
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_completer.py +30 -30
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_execfile.py +3 -1
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_filesystem_encoding.py +43 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_getopt.py +35 -32
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_imports_tipper.py +83 -84
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_jy_imports_tipper.py +92 -99
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_log.py +2 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py +51 -27
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_sys_patch.py +11 -7
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_tipper_common.py +6 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/fsnotify/__init__.py +34 -38
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_console_utils.py +71 -69
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_import_hook.py +1 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_imports.py +0 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console.py +14 -16
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_ipython_console_011.py +81 -93
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_is_thread_alive.py +3 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_localhost.py +9 -8
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_log.py +33 -25
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py +183 -170
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey_qt.py +33 -29
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_override.py +6 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_umd.py +19 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_versioncheck.py +3 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles.py +165 -138
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_coverage.py +77 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_nose.py +35 -36
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py +22 -23
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel_client.py +37 -57
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_pytest2.py +54 -52
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_unittest.py +28 -37
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_xml_rpc.py +56 -53
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__main__pydevd_gen_debug_adapter_protocol.py +604 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocol.json +551 -445
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_base_schema.py +25 -29
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema.py +17458 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema_log.py +11 -12
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevconsole_code.py +18 -19
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info.py +41 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info_regular.py +328 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_api.py +263 -214
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_breakpoints.py +7 -10
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils.py +187 -92
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_bytecode_utils_py311.py +105 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_code_to_source.py +46 -51
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_collect_bytecode_info.py +239 -176
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py +370 -297
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm_constants.py +78 -86
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_command_line_handling.py +55 -59
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_concurrency_logger.py +194 -58
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py +2 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_console.py +18 -23
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py +159 -127
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_custom_frames.py +10 -12
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c +55527 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pxd +15 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.pyx +803 -511
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython_wrapper.py +18 -7
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py +32 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_defaults.py +11 -13
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace.py +16 -16
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_dont_trace_files.py +27 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_exec2.py +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_api.py +4 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_extension_utils.py +8 -10
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py +50 -45
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame.py +462 -407
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_frame_utils.py +69 -61
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_gevent_integration.py +14 -16
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_import_class.py +27 -25
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_io.py +40 -42
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_json_debug_options.py +200 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command.py +20 -19
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py +199 -108
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_xml.py +121 -73
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py +208 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command.py +206 -159
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py +346 -334
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_referrers.py +75 -80
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_reload.py +35 -35
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_resolver.py +116 -124
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py +44 -58
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_safe_repr.py +51 -55
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_save_locals.py +4 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_signature.py +24 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_source_mapping.py +19 -20
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_stackless.py +45 -49
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_suspended_frames.py +61 -58
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_thread_lifecycle.py +23 -13
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_timeout.py +29 -31
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch.py +41 -11
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_dispatch_regular.py +117 -55
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_traceproperty.py +11 -14
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_utils.py +90 -89
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py +106 -97
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vm_type.py +40 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_xml.py +56 -46
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_cython_wrapper.py +5 -5
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py +71 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.c +11165 -5326
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_tracing.py +5 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_modify_bytecode.py +53 -56
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/bytecode.py +4 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/cfg.py +6 -26
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/concrete.py +7 -21
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/flags.py +5 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/instr.py +10 -34
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/peephole_opt.py +1 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/__init__.py +2 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_bytecode.py +3 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_cfg.py +11 -31
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_code.py +2 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_concrete.py +14 -41
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_flags.py +2 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_instr.py +7 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_misc.py +6 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/test_peephole_opt.py +7 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/bytecode/tests/util_annotation.py +1 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/pydevd_fix_code.py +14 -19
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring.py +1929 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.c +43253 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pxd +46 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pyx +1935 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/_pydevd_sys_monitoring/pydevd_sys_monitoring.py +16 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_app_engine_debug_startup.py +12 -11
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_coverage.py +30 -32
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhook.py +58 -54
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookglut.py +20 -24
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk.py +8 -7
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookgtk3.py +8 -6
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookpyglet.py +11 -8
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt4.py +21 -18
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt5.py +17 -15
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookqt6.py +17 -15
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhooktk.py +6 -4
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/inputhookwx.py +14 -10
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/matplotlibtools.py +30 -26
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py +24 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_for_kernel.py +37 -34
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/qt_loaders.py +86 -73
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/version.py +7 -7
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydev_pysrc.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_run_in_console.py +23 -24
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydev_sitecustomize/sitecustomize.py +267 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevconsole.py +55 -47
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd.py +732 -508
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_always_live_program.py +40 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_check.py +1 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process.py +11 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process_linux.py +75 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py +130 -125
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_pydevd.py +89 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_script.py +41 -32
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_utils.hpp +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_version.hpp +9 -1
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/lldb_prepare.py +10 -9
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/__init__.py +103 -119
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/breakpoint.py +457 -516
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/compat.py +33 -15
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/crash.py +336 -281
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/debug.py +101 -131
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/disasm.py +148 -153
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/event.py +310 -302
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/interactive.py +235 -208
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/module.py +185 -218
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/process.py +428 -564
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/registry.py +54 -53
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/search.py +69 -73
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/sql.py +158 -170
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/system.py +143 -213
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/textio.py +302 -333
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py +220 -239
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/util.py +198 -177
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/__init__.py +11 -11
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/advapi32.py +1191 -713
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_amd64.py +248 -194
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/context_i386.py +132 -120
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/dbghelp.py +450 -346
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/defines.py +305 -286
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/gdi32.py +526 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/kernel32.py +1479 -1097
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/ntdll.py +579 -0
- debugpy-1.8.7/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/peb_teb.py +3517 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/psapi.py +54 -31
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shell32.py +170 -149
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/shlwapi.py +190 -108
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/user32.py +542 -437
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/version.py +489 -442
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/wtsapi32.py +83 -65
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/window.py +70 -76
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.cpp +17 -9
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/compile_windows.bat +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_file_utils.py +141 -120
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/django_debug.py +175 -149
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/__init__.py +1 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_helpers.py +5 -5
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_numpy_types.py +28 -28
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugin_pandas_types.py +22 -30
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/types/pydevd_plugins_django_form_str.py +3 -2
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/jinja2_debug.py +130 -108
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/pydevd_line_validation.py +27 -14
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_tracing.py +85 -66
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/setup_pydevd_cython.py +96 -59
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_version.py +3 -3
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/messaging.py +2 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/cli.py +32 -17
- {debugpy-1.8.5 → debugpy-1.8.7/src/debugpy.egg-info}/PKG-INFO +1 -1
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/SOURCES.txt +6 -1
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_filesystem_encoding.py +0 -41
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_coverage.py +0 -76
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__main__pydevd_gen_debug_adapter_protocol.py +0 -592
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/pydevd_schema.py +0 -19514
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info.py +0 -19
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_additional_thread_info_regular.py +0 -153
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c +0 -43377
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_json_debug_options.py +0 -204
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_plugin_utils.py +0 -91
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_trace_api.py +0 -62
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vm_type.py +0 -41
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_eval_main.py +0 -48
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py +0 -23
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_pysrc.py +0 -1
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydev_sitecustomize/sitecustomize.py +0 -237
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_always_live_program.py +0 -32
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process.py +0 -9
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/_test_attach_to_process_linux.py +0 -74
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_pydevd.py +0 -79
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.pdb +0 -0
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/gdi32.py +0 -507
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/ntdll.py +0 -539
- debugpy-1.8.5/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/peb_teb.py +0 -3435
- {debugpy-1.8.5 → debugpy-1.8.7}/DESCRIPTION.md +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/LICENSE +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/MANIFEST.in +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/README.md +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/pyproject.toml +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/setup.cfg +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/setup.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/ThirdPartyNotices.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/__main__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/_pydevd_packaging.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/_util.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/force_pydevd.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_bundle/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydev_runfiles/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/_debug_adapter/debugProtocolCustom.json +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/.gitignore +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pxd +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.template.pyx +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/release_mem.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/README.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/_pydevd_frame_eval/vendored/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/README +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_ipython/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydev_sitecustomize/__not_in_default_pythonpath.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/README.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_310.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_311.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_custom_pyeval_settrace_common.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_settrace.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/python.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/ref_utils.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/.gitignore +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/attach.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_linux.sh +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_mac.sh +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_manylinux.cmd +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/attach.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/inject_dll.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/py_win_helpers.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_in_memory.hpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/run_code_on_dllmain.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.cpp +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/stdafx.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows/targetver.h +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/_vendored/pydevd/pydevd_plugins/extensions/README.md +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/__main__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/clients.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/components.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/launchers.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/servers.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/adapter/sessions.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/json.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/log.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/singleton.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/sockets.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/stacks.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/timestamp.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/common/util.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/__main__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/debuggee.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/handlers.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/output.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/launcher/winapi.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/public_api.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/__init__.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/api.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy/server/attach_pid_injected.py +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/dependency_links.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/entry_points.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/src/debugpy.egg-info/top_level.txt +0 -0
- {debugpy-1.8.5 → debugpy-1.8.7}/versioneer.py +0 -0
|
@@ -39,7 +39,7 @@ from __future__ import with_statement
|
|
|
39
39
|
|
|
40
40
|
__revision__ = "$Id$"
|
|
41
41
|
|
|
42
|
-
__all__ = [
|
|
42
|
+
__all__ = ["Thread"]
|
|
43
43
|
|
|
44
44
|
from winappdbg import win32
|
|
45
45
|
from winappdbg import compat
|
|
@@ -54,12 +54,13 @@ import warnings
|
|
|
54
54
|
# delayed imports
|
|
55
55
|
Process = None
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
# ==============================================================================
|
|
58
58
|
|
|
59
59
|
# TODO
|
|
60
60
|
# + fetch special registers (MMX, XMM, 3DNow!, etc)
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
|
|
63
|
+
class Thread(object):
|
|
63
64
|
"""
|
|
64
65
|
Interface to a thread in another process.
|
|
65
66
|
|
|
@@ -126,7 +127,7 @@ class Thread (object):
|
|
|
126
127
|
when the injected thread is killed.
|
|
127
128
|
"""
|
|
128
129
|
|
|
129
|
-
def __init__(self, dwThreadId, hThread
|
|
130
|
+
def __init__(self, dwThreadId, hThread=None, process=None):
|
|
130
131
|
"""
|
|
131
132
|
@type dwThreadId: int
|
|
132
133
|
@param dwThreadId: Global thread ID.
|
|
@@ -137,34 +138,34 @@ class Thread (object):
|
|
|
137
138
|
@type process: L{Process}
|
|
138
139
|
@param process: (Optional) Parent Process object.
|
|
139
140
|
"""
|
|
140
|
-
self.dwProcessId
|
|
141
|
-
self.dwThreadId
|
|
142
|
-
self.hThread
|
|
141
|
+
self.dwProcessId = None
|
|
142
|
+
self.dwThreadId = dwThreadId
|
|
143
|
+
self.hThread = hThread
|
|
143
144
|
self.pInjectedMemory = None
|
|
144
145
|
self.set_name(None)
|
|
145
146
|
self.set_process(process)
|
|
146
147
|
|
|
147
148
|
# Not really sure if it's a good idea...
|
|
148
|
-
## def __eq__(self, aThread):
|
|
149
|
-
## """
|
|
150
|
-
## Compare two Thread objects. The comparison is made using the IDs.
|
|
151
|
-
##
|
|
152
|
-
## @warning:
|
|
153
|
-
## If you have two Thread instances with different handles the
|
|
154
|
-
## equality operator still returns C{True}, so be careful!
|
|
155
|
-
##
|
|
156
|
-
## @type aThread: L{Thread}
|
|
157
|
-
## @param aThread: Another Thread object.
|
|
158
|
-
##
|
|
159
|
-
## @rtype: bool
|
|
160
|
-
## @return: C{True} if the two thread IDs are equal,
|
|
161
|
-
## C{False} otherwise.
|
|
162
|
-
## """
|
|
163
|
-
## return isinstance(aThread, Thread) and \
|
|
164
|
-
## self.get_tid() == aThread.get_tid()
|
|
149
|
+
## def __eq__(self, aThread):
|
|
150
|
+
## """
|
|
151
|
+
## Compare two Thread objects. The comparison is made using the IDs.
|
|
152
|
+
##
|
|
153
|
+
## @warning:
|
|
154
|
+
## If you have two Thread instances with different handles the
|
|
155
|
+
## equality operator still returns C{True}, so be careful!
|
|
156
|
+
##
|
|
157
|
+
## @type aThread: L{Thread}
|
|
158
|
+
## @param aThread: Another Thread object.
|
|
159
|
+
##
|
|
160
|
+
## @rtype: bool
|
|
161
|
+
## @return: C{True} if the two thread IDs are equal,
|
|
162
|
+
## C{False} otherwise.
|
|
163
|
+
## """
|
|
164
|
+
## return isinstance(aThread, Thread) and \
|
|
165
|
+
## self.get_tid() == aThread.get_tid()
|
|
165
166
|
|
|
166
167
|
def __load_Process_class(self):
|
|
167
|
-
global Process
|
|
168
|
+
global Process # delayed import
|
|
168
169
|
if Process is None:
|
|
169
170
|
from winappdbg.process import Process
|
|
170
171
|
|
|
@@ -180,7 +181,7 @@ class Thread (object):
|
|
|
180
181
|
self.__process = Process(self.get_pid())
|
|
181
182
|
return self.__process
|
|
182
183
|
|
|
183
|
-
def set_process(self, process
|
|
184
|
+
def set_process(self, process=None):
|
|
184
185
|
"""
|
|
185
186
|
Manually set the parent Process object. Use with care!
|
|
186
187
|
|
|
@@ -189,11 +190,11 @@ class Thread (object):
|
|
|
189
190
|
"""
|
|
190
191
|
if process is None:
|
|
191
192
|
self.dwProcessId = None
|
|
192
|
-
self.__process
|
|
193
|
+
self.__process = None
|
|
193
194
|
else:
|
|
194
195
|
self.__load_Process_class()
|
|
195
196
|
if not isinstance(process, Process):
|
|
196
|
-
msg
|
|
197
|
+
msg = "Parent process must be a Process instance, "
|
|
197
198
|
msg += "got %s instead" % type(process)
|
|
198
199
|
raise TypeError(msg)
|
|
199
200
|
self.dwProcessId = process.get_pid()
|
|
@@ -217,8 +218,7 @@ class Thread (object):
|
|
|
217
218
|
try:
|
|
218
219
|
# I wish this had been implemented before Vista...
|
|
219
220
|
# XXX TODO find the real ntdll call under this api
|
|
220
|
-
hThread = self.get_handle(
|
|
221
|
-
win32.THREAD_QUERY_LIMITED_INFORMATION)
|
|
221
|
+
hThread = self.get_handle(win32.THREAD_QUERY_LIMITED_INFORMATION)
|
|
222
222
|
self.dwProcessId = win32.GetProcessIdOfThread(hThread)
|
|
223
223
|
except AttributeError:
|
|
224
224
|
# This method is really bad :P
|
|
@@ -226,7 +226,7 @@ class Thread (object):
|
|
|
226
226
|
return self.dwProcessId
|
|
227
227
|
|
|
228
228
|
def __get_pid_by_scanning(self):
|
|
229
|
-
|
|
229
|
+
"Internally used by get_pid()."
|
|
230
230
|
dwProcessId = None
|
|
231
231
|
dwThreadId = self.get_tid()
|
|
232
232
|
with win32.CreateToolhelp32Snapshot(win32.TH32CS_SNAPTHREAD) as hSnapshot:
|
|
@@ -255,7 +255,7 @@ class Thread (object):
|
|
|
255
255
|
"""
|
|
256
256
|
return self.name
|
|
257
257
|
|
|
258
|
-
def set_name(self, name
|
|
258
|
+
def set_name(self, name=None):
|
|
259
259
|
"""
|
|
260
260
|
Sets the thread's name.
|
|
261
261
|
|
|
@@ -264,9 +264,9 @@ class Thread (object):
|
|
|
264
264
|
"""
|
|
265
265
|
self.name = name
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
# ------------------------------------------------------------------------------
|
|
268
268
|
|
|
269
|
-
def open_handle(self, dwDesiredAccess
|
|
269
|
+
def open_handle(self, dwDesiredAccess=win32.THREAD_ALL_ACCESS):
|
|
270
270
|
"""
|
|
271
271
|
Opens a new handle to the thread, closing the previous one.
|
|
272
272
|
|
|
@@ -289,7 +289,7 @@ class Thread (object):
|
|
|
289
289
|
|
|
290
290
|
# In case hThread was set to an actual handle value instead of a Handle
|
|
291
291
|
# object. This shouldn't happen unless the user tinkered with it.
|
|
292
|
-
if not hasattr(self.hThread,
|
|
292
|
+
if not hasattr(self.hThread, "__del__"):
|
|
293
293
|
self.close_handle()
|
|
294
294
|
|
|
295
295
|
self.hThread = hThread
|
|
@@ -303,14 +303,14 @@ class Thread (object):
|
|
|
303
303
|
collector claims them.
|
|
304
304
|
"""
|
|
305
305
|
try:
|
|
306
|
-
if hasattr(self.hThread,
|
|
306
|
+
if hasattr(self.hThread, "close"):
|
|
307
307
|
self.hThread.close()
|
|
308
308
|
elif self.hThread not in (None, win32.INVALID_HANDLE_VALUE):
|
|
309
309
|
win32.CloseHandle(self.hThread)
|
|
310
310
|
finally:
|
|
311
311
|
self.hThread = None
|
|
312
312
|
|
|
313
|
-
def get_handle(self, dwDesiredAccess
|
|
313
|
+
def get_handle(self, dwDesiredAccess=win32.THREAD_ALL_ACCESS):
|
|
314
314
|
"""
|
|
315
315
|
Returns a handle to the thread with I{at least} the access rights
|
|
316
316
|
requested.
|
|
@@ -349,9 +349,9 @@ class Thread (object):
|
|
|
349
349
|
finally:
|
|
350
350
|
self.close_handle()
|
|
351
351
|
|
|
352
|
-
|
|
352
|
+
# ------------------------------------------------------------------------------
|
|
353
353
|
|
|
354
|
-
def wait(self, dwTimeout
|
|
354
|
+
def wait(self, dwTimeout=None):
|
|
355
355
|
"""
|
|
356
356
|
Waits for the thread to finish executing.
|
|
357
357
|
|
|
@@ -361,7 +361,7 @@ class Thread (object):
|
|
|
361
361
|
"""
|
|
362
362
|
self.get_handle(win32.SYNCHRONIZE).wait(dwTimeout)
|
|
363
363
|
|
|
364
|
-
def kill(self, dwExitCode
|
|
364
|
+
def kill(self, dwExitCode=0):
|
|
365
365
|
"""
|
|
366
366
|
Terminates the thread execution.
|
|
367
367
|
|
|
@@ -381,7 +381,7 @@ class Thread (object):
|
|
|
381
381
|
self.get_process().free(self.pInjectedMemory)
|
|
382
382
|
self.pInjectedMemory = None
|
|
383
383
|
except Exception:
|
|
384
|
-
## raise # XXX DEBUG
|
|
384
|
+
## raise # XXX DEBUG
|
|
385
385
|
pass
|
|
386
386
|
|
|
387
387
|
# XXX TODO
|
|
@@ -441,9 +441,9 @@ class Thread (object):
|
|
|
441
441
|
dwAccess = win32.THREAD_QUERY_LIMITED_INFORMATION
|
|
442
442
|
else:
|
|
443
443
|
dwAccess = win32.THREAD_QUERY_INFORMATION
|
|
444
|
-
return win32.GetExitCodeThread(
|
|
444
|
+
return win32.GetExitCodeThread(self.get_handle(dwAccess))
|
|
445
445
|
|
|
446
|
-
|
|
446
|
+
# ------------------------------------------------------------------------------
|
|
447
447
|
|
|
448
448
|
# XXX TODO
|
|
449
449
|
# Support for string searches on the window captions.
|
|
@@ -457,16 +457,13 @@ class Thread (object):
|
|
|
457
457
|
process = self.get_process()
|
|
458
458
|
except Exception:
|
|
459
459
|
process = None
|
|
460
|
-
return [
|
|
461
|
-
Window( hWnd, process, self ) \
|
|
462
|
-
for hWnd in win32.EnumThreadWindows( self.get_tid() )
|
|
463
|
-
]
|
|
460
|
+
return [Window(hWnd, process, self) for hWnd in win32.EnumThreadWindows(self.get_tid())]
|
|
464
461
|
|
|
465
|
-
|
|
462
|
+
# ------------------------------------------------------------------------------
|
|
466
463
|
|
|
467
464
|
# TODO
|
|
468
465
|
# A registers cache could be implemented here.
|
|
469
|
-
def get_context(self, ContextFlags
|
|
466
|
+
def get_context(self, ContextFlags=None, bSuspend=False):
|
|
470
467
|
"""
|
|
471
468
|
Retrieves the execution context (i.e. the registers values) for this
|
|
472
469
|
thread.
|
|
@@ -523,37 +520,30 @@ class Thread (object):
|
|
|
523
520
|
|
|
524
521
|
# If an exception is raised, make sure the thread execution is resumed.
|
|
525
522
|
try:
|
|
526
|
-
|
|
527
523
|
if win32.bits == self.get_bits():
|
|
528
|
-
|
|
529
524
|
# 64 bit debugger attached to 64 bit process, or
|
|
530
525
|
# 32 bit debugger attached to 32 bit process.
|
|
531
|
-
ctx = win32.GetThreadContext(hThread,
|
|
532
|
-
ContextFlags = ContextFlags)
|
|
526
|
+
ctx = win32.GetThreadContext(hThread, ContextFlags=ContextFlags)
|
|
533
527
|
|
|
534
528
|
else:
|
|
535
529
|
if self.is_wow64():
|
|
536
|
-
|
|
537
530
|
# 64 bit debugger attached to 32 bit process.
|
|
538
531
|
if ContextFlags is not None:
|
|
539
532
|
ContextFlags &= ~win32.ContextArchMask
|
|
540
|
-
ContextFlags |=
|
|
533
|
+
ContextFlags |= win32.WOW64_CONTEXT_i386
|
|
541
534
|
ctx = win32.Wow64GetThreadContext(hThread, ContextFlags)
|
|
542
535
|
|
|
543
536
|
else:
|
|
544
|
-
|
|
545
537
|
# 32 bit debugger attached to 64 bit process.
|
|
546
538
|
# XXX only i386/AMD64 is supported in this particular case
|
|
547
539
|
if win32.arch not in (win32.ARCH_I386, win32.ARCH_AMD64):
|
|
548
540
|
raise NotImplementedError()
|
|
549
541
|
if ContextFlags is not None:
|
|
550
542
|
ContextFlags &= ~win32.ContextArchMask
|
|
551
|
-
ContextFlags |=
|
|
552
|
-
ctx = win32.context_amd64.GetThreadContext(hThread,
|
|
553
|
-
ContextFlags = ContextFlags)
|
|
543
|
+
ContextFlags |= win32.context_amd64.CONTEXT_AMD64
|
|
544
|
+
ctx = win32.context_amd64.GetThreadContext(hThread, ContextFlags=ContextFlags)
|
|
554
545
|
|
|
555
546
|
finally:
|
|
556
|
-
|
|
557
547
|
# Resume the thread if we suspended it.
|
|
558
548
|
if bSuspend:
|
|
559
549
|
self.resume()
|
|
@@ -561,7 +551,7 @@ class Thread (object):
|
|
|
561
551
|
# Return the context.
|
|
562
552
|
return ctx
|
|
563
553
|
|
|
564
|
-
def set_context(self, context, bSuspend
|
|
554
|
+
def set_context(self, context, bSuspend=False):
|
|
565
555
|
"""
|
|
566
556
|
Sets the values of the registers.
|
|
567
557
|
|
|
@@ -614,7 +604,7 @@ class Thread (object):
|
|
|
614
604
|
@rtype: int
|
|
615
605
|
@return: Value of the requested register.
|
|
616
606
|
"""
|
|
617
|
-
|
|
607
|
+
"Returns the value of a specific register."
|
|
618
608
|
context = self.get_context()
|
|
619
609
|
return context[register]
|
|
620
610
|
|
|
@@ -632,7 +622,7 @@ class Thread (object):
|
|
|
632
622
|
context[register] = value
|
|
633
623
|
self.set_context(context)
|
|
634
624
|
|
|
635
|
-
|
|
625
|
+
# ------------------------------------------------------------------------------
|
|
636
626
|
|
|
637
627
|
# TODO: a metaclass would do a better job instead of checking the platform
|
|
638
628
|
# during module import, also would support mixing 32 and 64 bits
|
|
@@ -698,26 +688,27 @@ class Thread (object):
|
|
|
698
688
|
context.fp = fp
|
|
699
689
|
self.set_context(context)
|
|
700
690
|
|
|
701
|
-
|
|
691
|
+
# ------------------------------------------------------------------------------
|
|
702
692
|
|
|
703
693
|
if win32.arch in (win32.ARCH_I386, win32.ARCH_AMD64):
|
|
704
694
|
|
|
705
|
-
class Flags
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
695
|
+
class Flags(object):
|
|
696
|
+
"Commonly used processor flags"
|
|
697
|
+
|
|
698
|
+
Overflow = 0x800
|
|
699
|
+
Direction = 0x400
|
|
700
|
+
Interrupts = 0x200
|
|
701
|
+
Trap = 0x100
|
|
702
|
+
Sign = 0x80
|
|
703
|
+
Zero = 0x40
|
|
713
704
|
# 0x20 ???
|
|
714
|
-
Auxiliary
|
|
705
|
+
Auxiliary = 0x10
|
|
715
706
|
# 0x8 ???
|
|
716
|
-
Parity
|
|
707
|
+
Parity = 0x4
|
|
717
708
|
# 0x2 ???
|
|
718
|
-
Carry
|
|
709
|
+
Carry = 0x1
|
|
719
710
|
|
|
720
|
-
def get_flags(self, FlagMask
|
|
711
|
+
def get_flags(self, FlagMask=0xFFFFFFFF):
|
|
721
712
|
"""
|
|
722
713
|
@type FlagMask: int
|
|
723
714
|
@param FlagMask: (Optional) Bitwise-AND mask.
|
|
@@ -726,9 +717,9 @@ class Thread (object):
|
|
|
726
717
|
@return: Flags register contents, optionally masking out some bits.
|
|
727
718
|
"""
|
|
728
719
|
context = self.get_context(win32.CONTEXT_CONTROL)
|
|
729
|
-
return context[
|
|
720
|
+
return context["EFlags"] & FlagMask
|
|
730
721
|
|
|
731
|
-
def set_flags(self, eflags, FlagMask
|
|
722
|
+
def set_flags(self, eflags, FlagMask=0xFFFFFFFF):
|
|
732
723
|
"""
|
|
733
724
|
Sets the flags register, optionally masking some bits.
|
|
734
725
|
|
|
@@ -739,7 +730,7 @@ class Thread (object):
|
|
|
739
730
|
@param FlagMask: (Optional) Bitwise-AND mask.
|
|
740
731
|
"""
|
|
741
732
|
context = self.get_context(win32.CONTEXT_CONTROL)
|
|
742
|
-
context[
|
|
733
|
+
context["EFlags"] = (context["EFlags"] & FlagMask) | eflags
|
|
743
734
|
self.set_context(context)
|
|
744
735
|
|
|
745
736
|
def get_flag_value(self, FlagBit):
|
|
@@ -750,7 +741,7 @@ class Thread (object):
|
|
|
750
741
|
@rtype: bool
|
|
751
742
|
@return: Boolean value of the requested flag.
|
|
752
743
|
"""
|
|
753
|
-
return bool(
|
|
744
|
+
return bool(self.get_flags(FlagBit))
|
|
754
745
|
|
|
755
746
|
def set_flag_value(self, FlagBit, FlagValue):
|
|
756
747
|
"""
|
|
@@ -805,46 +796,46 @@ class Thread (object):
|
|
|
805
796
|
return self.get_flag_value(self.Flags.Trap)
|
|
806
797
|
|
|
807
798
|
def clear_zf(self):
|
|
808
|
-
|
|
799
|
+
"Clears the Zero flag."
|
|
809
800
|
self.set_flag_value(self.Flags.Zero, False)
|
|
810
801
|
|
|
811
802
|
def clear_cf(self):
|
|
812
|
-
|
|
803
|
+
"Clears the Carry flag."
|
|
813
804
|
self.set_flag_value(self.Flags.Carry, False)
|
|
814
805
|
|
|
815
806
|
def clear_sf(self):
|
|
816
|
-
|
|
807
|
+
"Clears the Sign flag."
|
|
817
808
|
self.set_flag_value(self.Flags.Sign, False)
|
|
818
809
|
|
|
819
810
|
def clear_df(self):
|
|
820
|
-
|
|
811
|
+
"Clears the Direction flag."
|
|
821
812
|
self.set_flag_value(self.Flags.Direction, False)
|
|
822
813
|
|
|
823
814
|
def clear_tf(self):
|
|
824
|
-
|
|
815
|
+
"Clears the Trap flag."
|
|
825
816
|
self.set_flag_value(self.Flags.Trap, False)
|
|
826
817
|
|
|
827
818
|
def set_zf(self):
|
|
828
|
-
|
|
819
|
+
"Sets the Zero flag."
|
|
829
820
|
self.set_flag_value(self.Flags.Zero, True)
|
|
830
821
|
|
|
831
822
|
def set_cf(self):
|
|
832
|
-
|
|
823
|
+
"Sets the Carry flag."
|
|
833
824
|
self.set_flag_value(self.Flags.Carry, True)
|
|
834
825
|
|
|
835
826
|
def set_sf(self):
|
|
836
|
-
|
|
827
|
+
"Sets the Sign flag."
|
|
837
828
|
self.set_flag_value(self.Flags.Sign, True)
|
|
838
829
|
|
|
839
830
|
def set_df(self):
|
|
840
|
-
|
|
831
|
+
"Sets the Direction flag."
|
|
841
832
|
self.set_flag_value(self.Flags.Direction, True)
|
|
842
833
|
|
|
843
834
|
def set_tf(self):
|
|
844
|
-
|
|
835
|
+
"Sets the Trap flag."
|
|
845
836
|
self.set_flag_value(self.Flags.Trap, True)
|
|
846
837
|
|
|
847
|
-
|
|
838
|
+
# ------------------------------------------------------------------------------
|
|
848
839
|
|
|
849
840
|
def is_wow64(self):
|
|
850
841
|
"""
|
|
@@ -866,7 +857,7 @@ class Thread (object):
|
|
|
866
857
|
try:
|
|
867
858
|
wow64 = self.__wow64
|
|
868
859
|
except AttributeError:
|
|
869
|
-
if
|
|
860
|
+
if win32.bits == 32 and not win32.wow64:
|
|
870
861
|
wow64 = False
|
|
871
862
|
else:
|
|
872
863
|
wow64 = self.get_process().is_wow64()
|
|
@@ -909,8 +900,9 @@ class Thread (object):
|
|
|
909
900
|
events, and thus said events won't be sent to the debugger.
|
|
910
901
|
"""
|
|
911
902
|
return win32.NtQueryInformationThread(
|
|
912
|
-
|
|
913
|
-
|
|
903
|
+
self.get_handle(), # XXX what permissions do I need?
|
|
904
|
+
win32.ThreadHideFromDebugger,
|
|
905
|
+
)
|
|
914
906
|
|
|
915
907
|
def get_teb(self):
|
|
916
908
|
"""
|
|
@@ -921,8 +913,7 @@ class Thread (object):
|
|
|
921
913
|
@return: TEB structure.
|
|
922
914
|
@raise WindowsError: An exception is raised on error.
|
|
923
915
|
"""
|
|
924
|
-
return self.get_process().read_structure(
|
|
925
|
-
win32.TEB )
|
|
916
|
+
return self.get_process().read_structure(self.get_teb_address(), win32.TEB)
|
|
926
917
|
|
|
927
918
|
def get_teb_address(self):
|
|
928
919
|
"""
|
|
@@ -937,11 +928,10 @@ class Thread (object):
|
|
|
937
928
|
except AttributeError:
|
|
938
929
|
try:
|
|
939
930
|
hThread = self.get_handle(win32.THREAD_QUERY_INFORMATION)
|
|
940
|
-
tbi = win32.NtQueryInformationThread(
|
|
941
|
-
win32.ThreadBasicInformation)
|
|
931
|
+
tbi = win32.NtQueryInformationThread(hThread, win32.ThreadBasicInformation)
|
|
942
932
|
address = tbi.TebBaseAddress
|
|
943
933
|
except WindowsError:
|
|
944
|
-
address = self.get_linear_address(
|
|
934
|
+
address = self.get_linear_address("SegFs", 0) # fs:[0]
|
|
945
935
|
if not address:
|
|
946
936
|
raise
|
|
947
937
|
self._teb_ptr = address
|
|
@@ -969,20 +959,19 @@ class Thread (object):
|
|
|
969
959
|
The current architecture does not support selectors.
|
|
970
960
|
Selectors only exist in x86-based systems.
|
|
971
961
|
"""
|
|
972
|
-
hThread
|
|
962
|
+
hThread = self.get_handle(win32.THREAD_QUERY_INFORMATION)
|
|
973
963
|
selector = self.get_register(segment)
|
|
974
|
-
ldt
|
|
975
|
-
BaseLow
|
|
976
|
-
BaseMid
|
|
977
|
-
BaseHi
|
|
978
|
-
Base
|
|
964
|
+
ldt = win32.GetThreadSelectorEntry(hThread, selector)
|
|
965
|
+
BaseLow = ldt.BaseLow
|
|
966
|
+
BaseMid = ldt.HighWord.Bytes.BaseMid << 16
|
|
967
|
+
BaseHi = ldt.HighWord.Bytes.BaseHi << 24
|
|
968
|
+
Base = BaseLow | BaseMid | BaseHi
|
|
979
969
|
LimitLow = ldt.LimitLow
|
|
980
|
-
LimitHi
|
|
981
|
-
Limit
|
|
970
|
+
LimitHi = ldt.HighWord.Bits.LimitHi << 16
|
|
971
|
+
Limit = LimitLow | LimitHi
|
|
982
972
|
if address > Limit:
|
|
983
973
|
msg = "Address %s too large for segment %s (selector %d)"
|
|
984
|
-
msg = msg % (HexDump.address(address, self.get_bits()),
|
|
985
|
-
segment, selector)
|
|
974
|
+
msg = msg % (HexDump.address(address, self.get_bits()), segment, selector)
|
|
986
975
|
raise ValueError(msg)
|
|
987
976
|
return Base + address
|
|
988
977
|
|
|
@@ -991,7 +980,7 @@ class Thread (object):
|
|
|
991
980
|
@rtype: str
|
|
992
981
|
@return: Label that points to the instruction currently being executed.
|
|
993
982
|
"""
|
|
994
|
-
return self.get_process().get_label_at_address(
|
|
983
|
+
return self.get_process().get_label_at_address(self.get_pc())
|
|
995
984
|
|
|
996
985
|
def get_seh_chain_pointer(self):
|
|
997
986
|
"""
|
|
@@ -1006,12 +995,11 @@ class Thread (object):
|
|
|
1006
995
|
This method is only supported in 32 bits versions of Windows.
|
|
1007
996
|
"""
|
|
1008
997
|
if win32.arch != win32.ARCH_I386:
|
|
1009
|
-
raise NotImplementedError(
|
|
1010
|
-
"SEH chain parsing is only supported in 32-bit Windows.")
|
|
998
|
+
raise NotImplementedError("SEH chain parsing is only supported in 32-bit Windows.")
|
|
1011
999
|
|
|
1012
1000
|
process = self.get_process()
|
|
1013
|
-
address = self.get_linear_address(
|
|
1014
|
-
return process.read_pointer(
|
|
1001
|
+
address = self.get_linear_address("SegFs", 0)
|
|
1002
|
+
return process.read_pointer(address)
|
|
1015
1003
|
|
|
1016
1004
|
def set_seh_chain_pointer(self, value):
|
|
1017
1005
|
"""
|
|
@@ -1026,12 +1014,11 @@ class Thread (object):
|
|
|
1026
1014
|
This method is only supported in 32 bits versions of Windows.
|
|
1027
1015
|
"""
|
|
1028
1016
|
if win32.arch != win32.ARCH_I386:
|
|
1029
|
-
raise NotImplementedError(
|
|
1030
|
-
"SEH chain parsing is only supported in 32-bit Windows.")
|
|
1017
|
+
raise NotImplementedError("SEH chain parsing is only supported in 32-bit Windows.")
|
|
1031
1018
|
|
|
1032
1019
|
process = self.get_process()
|
|
1033
|
-
address = self.get_linear_address(
|
|
1034
|
-
process.write_pointer(
|
|
1020
|
+
address = self.get_linear_address("SegFs", 0)
|
|
1021
|
+
process.write_pointer(address, value)
|
|
1035
1022
|
|
|
1036
1023
|
def get_seh_chain(self):
|
|
1037
1024
|
"""
|
|
@@ -1051,11 +1038,11 @@ class Thread (object):
|
|
|
1051
1038
|
process = self.get_process()
|
|
1052
1039
|
seh = self.get_seh_chain_pointer()
|
|
1053
1040
|
while seh != 0xFFFFFFFF:
|
|
1054
|
-
seh_func = process.read_pointer(
|
|
1055
|
-
seh_chain.append(
|
|
1056
|
-
seh = process.read_pointer(
|
|
1041
|
+
seh_func = process.read_pointer(seh + 4)
|
|
1042
|
+
seh_chain.append((seh, seh_func))
|
|
1043
|
+
seh = process.read_pointer(seh)
|
|
1057
1044
|
except WindowsError:
|
|
1058
|
-
seh_chain.append(
|
|
1045
|
+
seh_chain.append((seh, None))
|
|
1059
1046
|
return seh_chain
|
|
1060
1047
|
|
|
1061
1048
|
def get_wait_chain(self):
|
|
@@ -1073,7 +1060,7 @@ class Thread (object):
|
|
|
1073
1060
|
U{http://msdn.microsoft.com/en-us/library/ms681622%28VS.85%29.aspx}
|
|
1074
1061
|
"""
|
|
1075
1062
|
with win32.OpenThreadWaitChainSession() as hWct:
|
|
1076
|
-
return win32.GetThreadWaitChain(hWct, ThreadId
|
|
1063
|
+
return win32.GetThreadWaitChain(hWct, ThreadId=self.get_tid())
|
|
1077
1064
|
|
|
1078
1065
|
def get_stack_range(self):
|
|
1079
1066
|
"""
|
|
@@ -1087,10 +1074,9 @@ class Thread (object):
|
|
|
1087
1074
|
# TODO use teb.DeallocationStack too (max. possible stack size)
|
|
1088
1075
|
teb = self.get_teb()
|
|
1089
1076
|
tib = teb.NtTib
|
|
1090
|
-
return (
|
|
1077
|
+
return (tib.StackLimit, tib.StackBase) # top, bottom
|
|
1091
1078
|
|
|
1092
|
-
def __get_stack_trace(self, depth
|
|
1093
|
-
bMakePretty = True):
|
|
1079
|
+
def __get_stack_trace(self, depth=16, bUseLabels=True, bMakePretty=True):
|
|
1094
1080
|
"""
|
|
1095
1081
|
Tries to get a stack trace for the current function using the debug
|
|
1096
1082
|
helper API (dbghelp.dll).
|
|
@@ -1133,15 +1119,13 @@ class Thread (object):
|
|
|
1133
1119
|
msg = "Stack walking is not available for this architecture: %s"
|
|
1134
1120
|
raise NotImplementedError(msg % arch)
|
|
1135
1121
|
|
|
1136
|
-
hProcess = aProcess.get_handle(
|
|
1137
|
-
|
|
1138
|
-
hThread = self.get_handle( win32.THREAD_GET_CONTEXT |
|
|
1139
|
-
win32.THREAD_QUERY_INFORMATION )
|
|
1122
|
+
hProcess = aProcess.get_handle(win32.PROCESS_VM_READ | win32.PROCESS_QUERY_INFORMATION)
|
|
1123
|
+
hThread = self.get_handle(win32.THREAD_GET_CONTEXT | win32.THREAD_QUERY_INFORMATION)
|
|
1140
1124
|
|
|
1141
1125
|
StackFrame = win32.STACKFRAME64()
|
|
1142
|
-
StackFrame.AddrPC
|
|
1143
|
-
StackFrame.AddrFrame = win32.ADDRESS64(
|
|
1144
|
-
StackFrame.AddrStack = win32.ADDRESS64(
|
|
1126
|
+
StackFrame.AddrPC = win32.ADDRESS64(self.get_pc())
|
|
1127
|
+
StackFrame.AddrFrame = win32.ADDRESS64(self.get_fp())
|
|
1128
|
+
StackFrame.AddrStack = win32.ADDRESS64(self.get_sp())
|
|
1145
1129
|
|
|
1146
1130
|
trace = list()
|
|
1147
1131
|
while win32.StackWalk64(MachineType, hProcess, hThread, StackFrame):
|
|
@@ -1162,15 +1146,14 @@ class Thread (object):
|
|
|
1162
1146
|
if bUseLabels:
|
|
1163
1147
|
label = aProcess.get_label_at_address(ra)
|
|
1164
1148
|
if bMakePretty:
|
|
1165
|
-
label =
|
|
1166
|
-
trace.append(
|
|
1149
|
+
label = "%s (%s)" % (HexDump.address(ra, bits), label)
|
|
1150
|
+
trace.append((fp, label))
|
|
1167
1151
|
else:
|
|
1168
|
-
trace.append(
|
|
1152
|
+
trace.append((fp, ra, lib))
|
|
1169
1153
|
fp = aProcess.peek_pointer(fp)
|
|
1170
1154
|
return tuple(trace)
|
|
1171
1155
|
|
|
1172
|
-
def __get_stack_trace_manually(self, depth
|
|
1173
|
-
bMakePretty = True):
|
|
1156
|
+
def __get_stack_trace_manually(self, depth=16, bUseLabels=True, bMakePretty=True):
|
|
1174
1157
|
"""
|
|
1175
1158
|
Tries to get a stack trace for the current function.
|
|
1176
1159
|
Only works for functions with standard prologue and epilogue.
|
|
@@ -1199,9 +1182,9 @@ class Thread (object):
|
|
|
1199
1182
|
@raise WindowsError: Raises an exception on error.
|
|
1200
1183
|
"""
|
|
1201
1184
|
aProcess = self.get_process()
|
|
1202
|
-
st, sb
|
|
1203
|
-
fp
|
|
1204
|
-
trace
|
|
1185
|
+
st, sb = self.get_stack_range() # top, bottom
|
|
1186
|
+
fp = self.get_fp()
|
|
1187
|
+
trace = list()
|
|
1205
1188
|
if aProcess.get_module_count() == 0:
|
|
1206
1189
|
aProcess.scan_modules()
|
|
1207
1190
|
bits = aProcess.get_bits()
|
|
@@ -1210,7 +1193,7 @@ class Thread (object):
|
|
|
1210
1193
|
break
|
|
1211
1194
|
if not st <= fp < sb:
|
|
1212
1195
|
break
|
|
1213
|
-
ra
|
|
1196
|
+
ra = aProcess.peek_pointer(fp + 4)
|
|
1214
1197
|
if ra == 0:
|
|
1215
1198
|
break
|
|
1216
1199
|
lib = aProcess.get_module_at_address(ra)
|
|
@@ -1224,14 +1207,14 @@ class Thread (object):
|
|
|
1224
1207
|
if bUseLabels:
|
|
1225
1208
|
label = aProcess.get_label_at_address(ra)
|
|
1226
1209
|
if bMakePretty:
|
|
1227
|
-
label =
|
|
1228
|
-
trace.append(
|
|
1210
|
+
label = "%s (%s)" % (HexDump.address(ra, bits), label)
|
|
1211
|
+
trace.append((fp, label))
|
|
1229
1212
|
else:
|
|
1230
|
-
trace.append(
|
|
1213
|
+
trace.append((fp, ra, lib))
|
|
1231
1214
|
fp = aProcess.peek_pointer(fp)
|
|
1232
1215
|
return tuple(trace)
|
|
1233
1216
|
|
|
1234
|
-
def get_stack_trace(self, depth
|
|
1217
|
+
def get_stack_trace(self, depth=16):
|
|
1235
1218
|
"""
|
|
1236
1219
|
Tries to get a stack trace for the current function.
|
|
1237
1220
|
Only works for functions with standard prologue and epilogue.
|
|
@@ -1249,13 +1232,14 @@ class Thread (object):
|
|
|
1249
1232
|
trace = self.__get_stack_trace(depth, False)
|
|
1250
1233
|
except Exception:
|
|
1251
1234
|
import traceback
|
|
1235
|
+
|
|
1252
1236
|
traceback.print_exc()
|
|
1253
1237
|
trace = ()
|
|
1254
1238
|
if not trace:
|
|
1255
1239
|
trace = self.__get_stack_trace_manually(depth, False)
|
|
1256
1240
|
return trace
|
|
1257
1241
|
|
|
1258
|
-
def get_stack_trace_with_labels(self, depth
|
|
1242
|
+
def get_stack_trace_with_labels(self, depth=16, bMakePretty=True):
|
|
1259
1243
|
"""
|
|
1260
1244
|
Tries to get a stack trace for the current function.
|
|
1261
1245
|
Only works for functions with standard prologue and epilogue.
|
|
@@ -1300,19 +1284,19 @@ class Thread (object):
|
|
|
1300
1284
|
|
|
1301
1285
|
@raise WindowsError: An error occured when getting the thread context.
|
|
1302
1286
|
"""
|
|
1303
|
-
st, sb
|
|
1304
|
-
sp
|
|
1305
|
-
fp
|
|
1306
|
-
size
|
|
1287
|
+
st, sb = self.get_stack_range() # top, bottom
|
|
1288
|
+
sp = self.get_sp()
|
|
1289
|
+
fp = self.get_fp()
|
|
1290
|
+
size = fp - sp
|
|
1307
1291
|
if not st <= sp < sb:
|
|
1308
|
-
raise RuntimeError(
|
|
1292
|
+
raise RuntimeError("Stack pointer lies outside the stack")
|
|
1309
1293
|
if not st <= fp < sb:
|
|
1310
|
-
raise RuntimeError(
|
|
1294
|
+
raise RuntimeError("Frame pointer lies outside the stack")
|
|
1311
1295
|
if sp > fp:
|
|
1312
|
-
raise RuntimeError(
|
|
1296
|
+
raise RuntimeError("No valid stack frame found")
|
|
1313
1297
|
return (sp, fp)
|
|
1314
1298
|
|
|
1315
|
-
def get_stack_frame(self, max_size
|
|
1299
|
+
def get_stack_frame(self, max_size=None):
|
|
1316
1300
|
"""
|
|
1317
1301
|
Reads the contents of the current stack frame.
|
|
1318
1302
|
Only works for functions with standard prologue and epilogue.
|
|
@@ -1332,13 +1316,13 @@ class Thread (object):
|
|
|
1332
1316
|
@raise WindowsError: An error occured when getting the thread context
|
|
1333
1317
|
or reading data from the process memory.
|
|
1334
1318
|
"""
|
|
1335
|
-
sp, fp
|
|
1336
|
-
size
|
|
1319
|
+
sp, fp = self.get_stack_frame_range()
|
|
1320
|
+
size = fp - sp
|
|
1337
1321
|
if max_size and size > max_size:
|
|
1338
1322
|
size = max_size
|
|
1339
1323
|
return self.get_process().peek(sp, size)
|
|
1340
1324
|
|
|
1341
|
-
def read_stack_data(self, size
|
|
1325
|
+
def read_stack_data(self, size=128, offset=0):
|
|
1342
1326
|
"""
|
|
1343
1327
|
Reads the contents of the top of the stack.
|
|
1344
1328
|
|
|
@@ -1356,7 +1340,7 @@ class Thread (object):
|
|
|
1356
1340
|
aProcess = self.get_process()
|
|
1357
1341
|
return aProcess.read(self.get_sp() + offset, size)
|
|
1358
1342
|
|
|
1359
|
-
def peek_stack_data(self, size
|
|
1343
|
+
def peek_stack_data(self, size=128, offset=0):
|
|
1360
1344
|
"""
|
|
1361
1345
|
Tries to read the contents of the top of the stack.
|
|
1362
1346
|
|
|
@@ -1373,7 +1357,7 @@ class Thread (object):
|
|
|
1373
1357
|
aProcess = self.get_process()
|
|
1374
1358
|
return aProcess.peek(self.get_sp() + offset, size)
|
|
1375
1359
|
|
|
1376
|
-
def read_stack_dwords(self, count, offset
|
|
1360
|
+
def read_stack_dwords(self, count, offset=0):
|
|
1377
1361
|
"""
|
|
1378
1362
|
Reads DWORDs from the top of the stack.
|
|
1379
1363
|
|
|
@@ -1390,10 +1374,10 @@ class Thread (object):
|
|
|
1390
1374
|
"""
|
|
1391
1375
|
if count > 0:
|
|
1392
1376
|
stackData = self.read_stack_data(count * 4, offset)
|
|
1393
|
-
return struct.unpack(
|
|
1377
|
+
return struct.unpack("<" + ("L" * count), stackData)
|
|
1394
1378
|
return ()
|
|
1395
1379
|
|
|
1396
|
-
def peek_stack_dwords(self, count, offset
|
|
1380
|
+
def peek_stack_dwords(self, count, offset=0):
|
|
1397
1381
|
"""
|
|
1398
1382
|
Tries to read DWORDs from the top of the stack.
|
|
1399
1383
|
|
|
@@ -1409,12 +1393,12 @@ class Thread (object):
|
|
|
1409
1393
|
"""
|
|
1410
1394
|
stackData = self.peek_stack_data(count * 4, offset)
|
|
1411
1395
|
if len(stackData) & 3:
|
|
1412
|
-
stackData = stackData[
|
|
1396
|
+
stackData = stackData[: -len(stackData) & 3]
|
|
1413
1397
|
if not stackData:
|
|
1414
1398
|
return ()
|
|
1415
|
-
return struct.unpack(
|
|
1399
|
+
return struct.unpack("<" + ("L" * count), stackData)
|
|
1416
1400
|
|
|
1417
|
-
def read_stack_qwords(self, count, offset
|
|
1401
|
+
def read_stack_qwords(self, count, offset=0):
|
|
1418
1402
|
"""
|
|
1419
1403
|
Reads QWORDs from the top of the stack.
|
|
1420
1404
|
|
|
@@ -1430,9 +1414,9 @@ class Thread (object):
|
|
|
1430
1414
|
@raise WindowsError: Could not read the requested data.
|
|
1431
1415
|
"""
|
|
1432
1416
|
stackData = self.read_stack_data(count * 8, offset)
|
|
1433
|
-
return struct.unpack(
|
|
1417
|
+
return struct.unpack("<" + ("Q" * count), stackData)
|
|
1434
1418
|
|
|
1435
|
-
def peek_stack_qwords(self, count, offset
|
|
1419
|
+
def peek_stack_qwords(self, count, offset=0):
|
|
1436
1420
|
"""
|
|
1437
1421
|
Tries to read QWORDs from the top of the stack.
|
|
1438
1422
|
|
|
@@ -1448,12 +1432,12 @@ class Thread (object):
|
|
|
1448
1432
|
"""
|
|
1449
1433
|
stackData = self.peek_stack_data(count * 8, offset)
|
|
1450
1434
|
if len(stackData) & 7:
|
|
1451
|
-
stackData = stackData[
|
|
1435
|
+
stackData = stackData[: -len(stackData) & 7]
|
|
1452
1436
|
if not stackData:
|
|
1453
1437
|
return ()
|
|
1454
|
-
return struct.unpack(
|
|
1438
|
+
return struct.unpack("<" + ("Q" * count), stackData)
|
|
1455
1439
|
|
|
1456
|
-
def read_stack_structure(self, structure, offset
|
|
1440
|
+
def read_stack_structure(self, structure, offset=0):
|
|
1457
1441
|
"""
|
|
1458
1442
|
Reads the given structure at the top of the stack.
|
|
1459
1443
|
|
|
@@ -1468,12 +1452,11 @@ class Thread (object):
|
|
|
1468
1452
|
@return: Tuple of elements read from the stack. The type of each
|
|
1469
1453
|
element matches the types in the stack frame structure.
|
|
1470
1454
|
"""
|
|
1471
|
-
aProcess
|
|
1455
|
+
aProcess = self.get_process()
|
|
1472
1456
|
stackData = aProcess.read_structure(self.get_sp() + offset, structure)
|
|
1473
|
-
return tuple([
|
|
1474
|
-
for (name, type) in stackData._fields_ ])
|
|
1457
|
+
return tuple([stackData.__getattribute__(name) for (name, type) in stackData._fields_])
|
|
1475
1458
|
|
|
1476
|
-
def read_stack_frame(self, structure, offset
|
|
1459
|
+
def read_stack_frame(self, structure, offset=0):
|
|
1477
1460
|
"""
|
|
1478
1461
|
Reads the stack frame of the thread.
|
|
1479
1462
|
|
|
@@ -1488,12 +1471,11 @@ class Thread (object):
|
|
|
1488
1471
|
@return: Tuple of elements read from the stack frame. The type of each
|
|
1489
1472
|
element matches the types in the stack frame structure.
|
|
1490
1473
|
"""
|
|
1491
|
-
aProcess
|
|
1474
|
+
aProcess = self.get_process()
|
|
1492
1475
|
stackData = aProcess.read_structure(self.get_fp() + offset, structure)
|
|
1493
|
-
return tuple([
|
|
1494
|
-
for (name, type) in stackData._fields_ ])
|
|
1476
|
+
return tuple([stackData.__getattribute__(name) for (name, type) in stackData._fields_])
|
|
1495
1477
|
|
|
1496
|
-
def read_code_bytes(self, size
|
|
1478
|
+
def read_code_bytes(self, size=128, offset=0):
|
|
1497
1479
|
"""
|
|
1498
1480
|
Tries to read some bytes of the code currently being executed.
|
|
1499
1481
|
|
|
@@ -1510,7 +1492,7 @@ class Thread (object):
|
|
|
1510
1492
|
"""
|
|
1511
1493
|
return self.get_process().read(self.get_pc() + offset, size)
|
|
1512
1494
|
|
|
1513
|
-
def peek_code_bytes(self, size
|
|
1495
|
+
def peek_code_bytes(self, size=128, offset=0):
|
|
1514
1496
|
"""
|
|
1515
1497
|
Tries to read some bytes of the code currently being executed.
|
|
1516
1498
|
|
|
@@ -1526,7 +1508,7 @@ class Thread (object):
|
|
|
1526
1508
|
"""
|
|
1527
1509
|
return self.get_process().peek(self.get_pc() + offset, size)
|
|
1528
1510
|
|
|
1529
|
-
def peek_pointers_in_registers(self, peekSize
|
|
1511
|
+
def peek_pointers_in_registers(self, peekSize=16, context=None):
|
|
1530
1512
|
"""
|
|
1531
1513
|
Tries to guess which values in the registers are valid pointers,
|
|
1532
1514
|
and reads some data from them.
|
|
@@ -1542,23 +1524,20 @@ class Thread (object):
|
|
|
1542
1524
|
@rtype: dict( str S{->} str )
|
|
1543
1525
|
@return: Dictionary mapping register names to the data they point to.
|
|
1544
1526
|
"""
|
|
1545
|
-
peekable_registers = (
|
|
1546
|
-
'Eax', 'Ebx', 'Ecx', 'Edx', 'Esi', 'Edi', 'Ebp'
|
|
1547
|
-
)
|
|
1527
|
+
peekable_registers = ("Eax", "Ebx", "Ecx", "Edx", "Esi", "Edi", "Ebp")
|
|
1548
1528
|
if not context:
|
|
1549
|
-
context = self.get_context(win32.CONTEXT_CONTROL |
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
for (reg_name, reg_value) in compat.iteritems(context):
|
|
1529
|
+
context = self.get_context(win32.CONTEXT_CONTROL | win32.CONTEXT_INTEGER)
|
|
1530
|
+
aProcess = self.get_process()
|
|
1531
|
+
data = dict()
|
|
1532
|
+
for reg_name, reg_value in compat.iteritems(context):
|
|
1554
1533
|
if reg_name not in peekable_registers:
|
|
1555
1534
|
continue
|
|
1556
|
-
## if reg_name == 'Ebp':
|
|
1557
|
-
## stack_begin, stack_end = self.get_stack_range()
|
|
1558
|
-
## print hex(stack_end), hex(reg_value), hex(stack_begin)
|
|
1559
|
-
## if stack_begin and stack_end and stack_end < stack_begin and \
|
|
1560
|
-
## stack_begin <= reg_value <= stack_end:
|
|
1561
|
-
## continue
|
|
1535
|
+
## if reg_name == 'Ebp':
|
|
1536
|
+
## stack_begin, stack_end = self.get_stack_range()
|
|
1537
|
+
## print hex(stack_end), hex(reg_value), hex(stack_begin)
|
|
1538
|
+
## if stack_begin and stack_end and stack_end < stack_begin and \
|
|
1539
|
+
## stack_begin <= reg_value <= stack_end:
|
|
1540
|
+
## continue
|
|
1562
1541
|
reg_data = aProcess.peek(reg_value, peekSize)
|
|
1563
1542
|
if reg_data:
|
|
1564
1543
|
data[reg_name] = reg_data
|
|
@@ -1566,7 +1545,7 @@ class Thread (object):
|
|
|
1566
1545
|
|
|
1567
1546
|
# TODO
|
|
1568
1547
|
# try to avoid reading the same page twice by caching it
|
|
1569
|
-
def peek_pointers_in_data(self, data, peekSize
|
|
1548
|
+
def peek_pointers_in_data(self, data, peekSize=16, peekStep=1):
|
|
1570
1549
|
"""
|
|
1571
1550
|
Tries to guess which values in the given data are valid pointers,
|
|
1572
1551
|
and reads some data from them.
|
|
@@ -1589,7 +1568,7 @@ class Thread (object):
|
|
|
1589
1568
|
aProcess = self.get_process()
|
|
1590
1569
|
return aProcess.peek_pointers_in_data(data, peekSize, peekStep)
|
|
1591
1570
|
|
|
1592
|
-
|
|
1571
|
+
# ------------------------------------------------------------------------------
|
|
1593
1572
|
|
|
1594
1573
|
# TODO
|
|
1595
1574
|
# The disassemble_around and disassemble_around_pc methods
|
|
@@ -1637,7 +1616,7 @@ class Thread (object):
|
|
|
1637
1616
|
aProcess = self.get_process()
|
|
1638
1617
|
return aProcess.disassemble(lpAddress, dwSize)
|
|
1639
1618
|
|
|
1640
|
-
def disassemble_around(self, lpAddress, dwSize
|
|
1619
|
+
def disassemble_around(self, lpAddress, dwSize=64):
|
|
1641
1620
|
"""
|
|
1642
1621
|
Disassemble around the given address.
|
|
1643
1622
|
|
|
@@ -1659,7 +1638,7 @@ class Thread (object):
|
|
|
1659
1638
|
aProcess = self.get_process()
|
|
1660
1639
|
return aProcess.disassemble_around(lpAddress, dwSize)
|
|
1661
1640
|
|
|
1662
|
-
def disassemble_around_pc(self, dwSize
|
|
1641
|
+
def disassemble_around_pc(self, dwSize=64):
|
|
1663
1642
|
"""
|
|
1664
1643
|
Disassemble around the program counter of the given thread.
|
|
1665
1644
|
|
|
@@ -1708,11 +1687,13 @@ class Thread (object):
|
|
|
1708
1687
|
- Disassembly line of instruction.
|
|
1709
1688
|
- Hexadecimal dump of instruction.
|
|
1710
1689
|
"""
|
|
1711
|
-
return self.disassemble_instruction(
|
|
1690
|
+
return self.disassemble_instruction(self.get_pc())
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
# ==============================================================================
|
|
1712
1694
|
|
|
1713
|
-
#==============================================================================
|
|
1714
1695
|
|
|
1715
|
-
class _ThreadContainer
|
|
1696
|
+
class _ThreadContainer(object):
|
|
1716
1697
|
"""
|
|
1717
1698
|
Encapsulates the capability to contain Thread objects.
|
|
1718
1699
|
|
|
@@ -1830,9 +1811,9 @@ class _ThreadContainer (object):
|
|
|
1830
1811
|
self.__initialize_snapshot()
|
|
1831
1812
|
return len(self.__threadDict)
|
|
1832
1813
|
|
|
1833
|
-
|
|
1814
|
+
# ------------------------------------------------------------------------------
|
|
1834
1815
|
|
|
1835
|
-
def find_threads_by_name(self, name, bExactMatch
|
|
1816
|
+
def find_threads_by_name(self, name, bExactMatch=True):
|
|
1836
1817
|
"""
|
|
1837
1818
|
Find threads by name, using different search methods.
|
|
1838
1819
|
|
|
@@ -1872,7 +1853,7 @@ class _ThreadContainer (object):
|
|
|
1872
1853
|
|
|
1873
1854
|
return found_threads
|
|
1874
1855
|
|
|
1875
|
-
|
|
1856
|
+
# ------------------------------------------------------------------------------
|
|
1876
1857
|
|
|
1877
1858
|
# XXX TODO
|
|
1878
1859
|
# Support for string searches on the window captions.
|
|
@@ -1884,12 +1865,12 @@ class _ThreadContainer (object):
|
|
|
1884
1865
|
"""
|
|
1885
1866
|
window_list = list()
|
|
1886
1867
|
for thread in self.iter_threads():
|
|
1887
|
-
window_list.extend(
|
|
1868
|
+
window_list.extend(thread.get_windows())
|
|
1888
1869
|
return window_list
|
|
1889
1870
|
|
|
1890
|
-
|
|
1871
|
+
# ------------------------------------------------------------------------------
|
|
1891
1872
|
|
|
1892
|
-
def start_thread(self, lpStartAddress, lpParameter=0,
|
|
1873
|
+
def start_thread(self, lpStartAddress, lpParameter=0, bSuspended=False):
|
|
1893
1874
|
"""
|
|
1894
1875
|
Remotely creates a new thread in the process.
|
|
1895
1876
|
|
|
@@ -1907,18 +1888,19 @@ class _ThreadContainer (object):
|
|
|
1907
1888
|
dwCreationFlags = win32.CREATE_SUSPENDED
|
|
1908
1889
|
else:
|
|
1909
1890
|
dwCreationFlags = 0
|
|
1910
|
-
hProcess = self.get_handle(
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1891
|
+
hProcess = self.get_handle(
|
|
1892
|
+
win32.PROCESS_CREATE_THREAD
|
|
1893
|
+
| win32.PROCESS_QUERY_INFORMATION
|
|
1894
|
+
| win32.PROCESS_VM_OPERATION
|
|
1895
|
+
| win32.PROCESS_VM_WRITE
|
|
1896
|
+
| win32.PROCESS_VM_READ
|
|
1897
|
+
)
|
|
1898
|
+
hThread, dwThreadId = win32.CreateRemoteThread(hProcess, 0, 0, lpStartAddress, lpParameter, dwCreationFlags)
|
|
1917
1899
|
aThread = Thread(dwThreadId, hThread, self)
|
|
1918
1900
|
self._add_thread(aThread)
|
|
1919
1901
|
return aThread
|
|
1920
1902
|
|
|
1921
|
-
|
|
1903
|
+
# ------------------------------------------------------------------------------
|
|
1922
1904
|
|
|
1923
1905
|
# TODO
|
|
1924
1906
|
# maybe put all the toolhelp code into their own set of classes?
|
|
@@ -1942,11 +1924,10 @@ class _ThreadContainer (object):
|
|
|
1942
1924
|
if dwProcessId in (0, 4, 8):
|
|
1943
1925
|
return
|
|
1944
1926
|
|
|
1945
|
-
## dead_tids = set( self.get_thread_ids() ) # XXX triggers a scan
|
|
1946
|
-
dead_tids
|
|
1927
|
+
## dead_tids = set( self.get_thread_ids() ) # XXX triggers a scan
|
|
1928
|
+
dead_tids = self._get_thread_ids()
|
|
1947
1929
|
dwProcessId = self.get_pid()
|
|
1948
|
-
hSnapshot
|
|
1949
|
-
dwProcessId)
|
|
1930
|
+
hSnapshot = win32.CreateToolhelp32Snapshot(win32.TH32CS_SNAPTHREAD, dwProcessId)
|
|
1950
1931
|
try:
|
|
1951
1932
|
te = win32.Thread32First(hSnapshot)
|
|
1952
1933
|
while te is not None:
|
|
@@ -1954,9 +1935,9 @@ class _ThreadContainer (object):
|
|
|
1954
1935
|
dwThreadId = te.th32ThreadID
|
|
1955
1936
|
if dwThreadId in dead_tids:
|
|
1956
1937
|
dead_tids.remove(dwThreadId)
|
|
1957
|
-
## if not self.has_thread(dwThreadId): # XXX triggers a scan
|
|
1938
|
+
## if not self.has_thread(dwThreadId): # XXX triggers a scan
|
|
1958
1939
|
if not self._has_thread_id(dwThreadId):
|
|
1959
|
-
aThread = Thread(dwThreadId, process
|
|
1940
|
+
aThread = Thread(dwThreadId, process=self)
|
|
1960
1941
|
self._add_thread(aThread)
|
|
1961
1942
|
te = win32.Thread32Next(hSnapshot)
|
|
1962
1943
|
finally:
|
|
@@ -1998,7 +1979,7 @@ class _ThreadContainer (object):
|
|
|
1998
1979
|
except Exception:
|
|
1999
1980
|
pass
|
|
2000
1981
|
|
|
2001
|
-
|
|
1982
|
+
# ------------------------------------------------------------------------------
|
|
2002
1983
|
|
|
2003
1984
|
# XXX _notify_* methods should not trigger a scan
|
|
2004
1985
|
|
|
@@ -2009,17 +1990,17 @@ class _ThreadContainer (object):
|
|
|
2009
1990
|
@type aThread: L{Thread}
|
|
2010
1991
|
@param aThread: Thread object.
|
|
2011
1992
|
"""
|
|
2012
|
-
## if not isinstance(aThread, Thread):
|
|
2013
|
-
## if hasattr(aThread, '__class__'):
|
|
2014
|
-
## typename = aThread.__class__.__name__
|
|
2015
|
-
## else:
|
|
2016
|
-
## typename = str(type(aThread))
|
|
2017
|
-
## msg = "Expected Thread, got %s instead" % typename
|
|
2018
|
-
## raise TypeError(msg)
|
|
1993
|
+
## if not isinstance(aThread, Thread):
|
|
1994
|
+
## if hasattr(aThread, '__class__'):
|
|
1995
|
+
## typename = aThread.__class__.__name__
|
|
1996
|
+
## else:
|
|
1997
|
+
## typename = str(type(aThread))
|
|
1998
|
+
## msg = "Expected Thread, got %s instead" % typename
|
|
1999
|
+
## raise TypeError(msg)
|
|
2019
2000
|
dwThreadId = aThread.dwThreadId
|
|
2020
|
-
## if dwThreadId in self.__threadDict:
|
|
2021
|
-
## msg = "Already have a Thread object with ID %d" % dwThreadId
|
|
2022
|
-
## raise KeyError(msg)
|
|
2001
|
+
## if dwThreadId in self.__threadDict:
|
|
2002
|
+
## msg = "Already have a Thread object with ID %d" % dwThreadId
|
|
2003
|
+
## raise KeyError(msg)
|
|
2023
2004
|
aThread.set_process(self)
|
|
2024
2005
|
self.__threadDict[dwThreadId] = aThread
|
|
2025
2006
|
|
|
@@ -2038,7 +2019,7 @@ class _ThreadContainer (object):
|
|
|
2038
2019
|
msg = "Unknown thread ID %d" % dwThreadId
|
|
2039
2020
|
warnings.warn(msg, RuntimeWarning)
|
|
2040
2021
|
if aThread:
|
|
2041
|
-
aThread.clear()
|
|
2022
|
+
aThread.clear() # remove circular references
|
|
2042
2023
|
|
|
2043
2024
|
def _has_thread_id(self, dwThreadId):
|
|
2044
2025
|
"""
|
|
@@ -2061,16 +2042,16 @@ class _ThreadContainer (object):
|
|
|
2061
2042
|
@type event: L{Event}
|
|
2062
2043
|
@param event: Event object.
|
|
2063
2044
|
"""
|
|
2064
|
-
dwThreadId
|
|
2065
|
-
hThread
|
|
2066
|
-
## if not self.has_thread(dwThreadId): # XXX this would trigger a scan
|
|
2045
|
+
dwThreadId = event.get_tid()
|
|
2046
|
+
hThread = event.get_thread_handle()
|
|
2047
|
+
## if not self.has_thread(dwThreadId): # XXX this would trigger a scan
|
|
2067
2048
|
if not self._has_thread_id(dwThreadId):
|
|
2068
2049
|
aThread = Thread(dwThreadId, hThread, self)
|
|
2069
|
-
teb_ptr = event.get_teb()
|
|
2050
|
+
teb_ptr = event.get_teb() # remember the TEB pointer
|
|
2070
2051
|
if teb_ptr:
|
|
2071
2052
|
aThread._teb_ptr = teb_ptr
|
|
2072
2053
|
self._add_thread(aThread)
|
|
2073
|
-
#else:
|
|
2054
|
+
# else:
|
|
2074
2055
|
# aThread = self.get_thread(dwThreadId)
|
|
2075
2056
|
# if hThread != win32.INVALID_HANDLE_VALUE:
|
|
2076
2057
|
# aThread.hThread = hThread # may have more privileges
|
|
@@ -2121,7 +2102,7 @@ class _ThreadContainer (object):
|
|
|
2121
2102
|
@return: C{True} to call the user-defined handle, C{False} otherwise.
|
|
2122
2103
|
"""
|
|
2123
2104
|
dwThreadId = event.get_tid()
|
|
2124
|
-
## if self.has_thread(dwThreadId): # XXX this would trigger a scan
|
|
2105
|
+
## if self.has_thread(dwThreadId): # XXX this would trigger a scan
|
|
2125
2106
|
if self._has_thread_id(dwThreadId):
|
|
2126
2107
|
self._del_thread(dwThreadId)
|
|
2127
2108
|
return True
|