WaitForDebugEvent question menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WaitForDebugEvent question

    Hey guys, I got a question about this api, im a little new to windows programming so bear with me on this.

    According to msdn this function can only be used by the thread that created the process being debugged. So assuming that, I went ahead and wrote in an int3 at the instruction I want to break at, my debugger loop picked it up, and I can then fill a CONTEXT structure and get what im looking for (including setting the EIP back one instruction)

    my question though is, how can this be done without loading the process with createprocess, seeing as in per the api documentation, the only way to properly use WaitForDebug event is to write a loader with createprocess.

    thanks.

    WaitForDebugEvent question
  2. #2
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by everdox View Post
    Hey guys, I got a question about this api, im a little new to windows programming so bear with me on this.

    According to msdn this function can only be used by the thread that created the process being debugged. So assuming that, I went ahead and wrote in an int3 at the instruction I want to break at, my debugger loop picked it up, and I can then fill a CONTEXT structure and get what im looking for (including setting the EIP back one instruction)

    my question though is, how can this be done without loading the process with createprocess, seeing as in per the api documentation, the only way to properly use WaitForDebug event is to write a loader with createprocess.

    thanks.
    DebugActiveProcess. Also remember DebugSetProcessKillOnExit so the debuggee isn't killed when your debugger detaches.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  3. #3
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So if I'm reading you right on this, WaitForDebugEvent can be called safely after DebugActiveProcess is invoked and all is initialized properly? Thanks for the help.

  4. #4
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The documentation is a bit misleading. I think it should have said something like "only the thread that started the debugging session ...." instead. (Which still applies for DebugActiveProcess() just fyi)

  5. #5
    sitnspinlock's Avatar Elite User CoreCoins Purchaser
    Reputation
    398
    Join Date
    Sep 2010
    Posts
    439
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok I figured it was something along those lines, thanks to both of you

Similar Threads

  1. Model Changing Question
    By MasterYuke in forum World of Warcraft General
    Replies: 6
    Last Post: 09-17-2006, 09:56 PM
  2. Couple Private Server questions
    By Jboz in forum World of Warcraft General
    Replies: 21
    Last Post: 07-26-2006, 07:37 PM
  3. Sorry..newb mail question
    By nolbishop in forum World of Warcraft General
    Replies: 2
    Last Post: 06-07-2006, 07:21 PM
  4. Question..
    By janzi9 in forum Community Chat
    Replies: 3
    Last Post: 04-02-2006, 10:20 AM
  5. A GALB question
    By bassman in forum World of Warcraft General
    Replies: 4
    Last Post: 03-28-2006, 09:49 AM
All times are GMT -5. The time now is 01:11 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search