亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lion-tutorial28.htm

?? 內有一些代碼
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<html>

<head>
<link rel="stylesheet" href="../../asm.css">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Iczelion's win32 asm tutorial</title>
</head>

<body bgcolor="#FFFFFF" background="../../images/back01.jpg">
<p align="center">Tutorial 28: Win32 Debug API Part 1</p>
<hr size="1">
In this tutorial, you'll learn what Win32 offers to developers regarding debugging 
primitives. You'll know how to debug a process when you're finished with this 
tutorial. <br>
Download <b><a href="files/tut28.zip" style="text-decoration:none">the example</a></b>. 
<h3>Theory:</h3>
<p>Win32 has several APIs that allow programmers to use some of the powers of 
  a debugger. They are called Win32 Debug APIs or primitives. With them, you can:</p>
<ul>
  <li>Load a program or attach to a running program for debugging</li>
  <li>Obtain low-level information about the program you're debugging, such as 
    process ID, address of entrypoint, image base and so on.</li>
  <li>Be notified of debugging-related events such as when a process/thread starts/exits, 
    DLLs are loaded/unloaded etc.</li>
  <li>Modify the process/thread being debugged</li>
</ul>
<p>In short, you can code a simple debugger with those APIs. Since this subject 
  is vast, I divide it into several managable parts: this tutorial being the first 
  part. I'll explain the basic concepts and general framework for using Win32 
  Debug APIs in this tutorial.<br>
  The steps in using Win32 Debug APIs are:</p>
<ol>
  <li><b>Create a process or attach your program to a running process</b>. This 
    is the first step in using Win32 Debug APIs. Since your program will act as 
    a debugger, you need a program to debug. The program being debugged is called 
    a debuggee. You can acquire a debuggee in two ways: 
    <ul>
      <li>You can create the debuggee process yourself with <b>CreateProcess</b>. 
        In order to create a process for debugging, you must specify the <b>DEBUG_PROCESS</b> 
        flag. This flag tells Windows that we want to debug the process. Windows 
        will send notifications of important debugging-related events (debug events) 
        that occur in the debuggee to your program. The debuggee process will 
        be immediately suspended until your program is ready. If the debuggee 
        also creates child processes, Windows will also send debug events that 
        occur in all those child processes to your program as well. This behavior 
        is usually undesirable. You can disable this behavior by specifying <b>DEBUG_ONLY_THIS_PROCESS</b> 
        flag in combination of <b>DEBUG_PROCESS</b> flag. </li>
      <li>You can attach your program to a running process with <b>DebugActiveProcess.</b></li>
    </ul>
  </li>
  <li><b>Wait for debugging events</b>. After your program acquired a debuggee, 
    the debuggee's primary thread is suspended and will continue to be suspended 
    until your program calls <b>WaitForDebugEvent</b>. This function works like 
    other WaitForXXX functions, ie. it blocks the calling thread until the waited-for 
    event occurs. In this case, it waits for debug events to be sent by Windows. 
    Let's see its definition: 
    <p><b>WaitForDebugEvent proto lpDebugEvent:DWORD, dwMilliseconds:DWORD</b></p>
    <p><b>lpDebugEvent</b> is the address of a <b>DEBUG_EVENT</b> structure that 
      will be filled with information about the debug event that occurs within 
      the debuggee.</p>
    <p><b>dwMilliseconds</b> is the length of time in milliseconds this function 
      will wait for the debug event to occur. If this period elapses and no debug 
      event occurs,<b> WaitForDebugEvent</b> returns to the caller. On the other 
      hand, if you specify<b> INFINITE </b>constant in this argument, the function 
      will not return until a debug event occurs.</p>
    <p>Now let's examine the DEBUG_EVENT structure in more detail.</p>
    <p><b>DEBUG_EVENT STRUCT <br>
      &nbsp;&nbsp;&nbsp;dwDebugEventCode dd ? <br>
      &nbsp;&nbsp;&nbsp;dwProcessId dd ? <br>
      &nbsp;&nbsp;&nbsp;dwThreadId dd ? <br>
      &nbsp;&nbsp;&nbsp;u DEBUGSTRUCT <> <br>
      DEBUG_EVENT ENDS </b></p>
    <p><b>dwDebugEventCode</b> contains the value that specifies what type of 
      debug event occurs. In short, there can be many types of events, your program 
      needs to check the value in this field so it knows what type of event occurs 
      and responds appropriately. The possible values are:</p>
  </li>
  <table border="1" cellspacing="2" cellpadding="2" align="center">
    <tr bgcolor="#009999"> 
      <th><b>Value</b></th>
      <th>Meanings</th>
    </tr>
    <tr> 
      <td><b>CREATE_PROCESS_DEBUG_EVENT</b></td>
      <td>A process is created. This event will be sent when the debuggee process 
        is just created (and not yet running) or when your program just attaches 
        itself to a running process with <b>DebugActiveProcess</b>. This is the 
        first event your program will receive.</td>
    </tr>
    <tr> 
      <td><b>EXIT_PROCESS_DEBUG_EVENT</b></td>
      <td>A process exits.</td>
    </tr>
    <tr> 
      <td><b>CREATE_THEAD_DEBUG_EVENT</b></td>
      <td>A new thread is created in the debuggee process or when your program 
        first attaches itself to a running process. Note that you'll not receive 
        this notification when the primary thread of the debuggee is created. 
      </td>
    </tr>
    <tr> 
      <td height="131"><b>EXIT_THREAD_DEBUG_EVENT</b></td>
      <td height="131">A thread in the debuggee process exits. Your program will 
        not receive this event for the primary thread. In short, you can think 
        of the primary thread of the debuggee as the equivalent of the debuggee 
        process itself. Thus, when your program sees <b>CREATE_PROCESS_DEBUG_EVENT</b>, 
        it's actually the <b>CREATE_THREAD_DEBUG_EVENT</b> for the primary thread.</td>
    </tr>
    <tr> 
      <td><b>LOAD_DLL_DEBUG_EVENT</b></td>
      <td>The debuggee loads a DLL. You'll receive this event when the PE loader 
        first resolves the links to DLLs (you call <b>CreateProcess</b> to load 
        the debuggee) and when the debuggee calls LoadLibrary.</td>
    </tr>
    <tr> 
      <td><b>UNLOAD_DLL_DEBUG_EVENT</b></td>
      <td>A DLL is unloaded from the debuggee process. </td>
    </tr>
    <tr> 
      <td><b>EXCEPTION_DEBUG_EVENT</b></td>
      <td>An exception occurs in the debuggee process. <b>Important:</b> This 
        event will occur once just before the debuggee starts executing its first 
        instruction. The exception is actually a debug break (int 3h). When you 
        want to resume the debuggee, call <b>ContinueDebugEvent </b>with<b> DBG_CONTINUE 
        </b>flag. Don't use <b>DBG_EXCEPTION_NOT_HANDLED</b> flag else the debuggee 
        will refuse to run under NT (on Win98, it works fine).</td>
    </tr>
    <tr> 
      <td><b>OUTPUT_DEBUG_STRING_EVENT</b></td>
      <td>This event is generated when the debuggee calls <b>DebugOutputString</b> 
        function to send a message string to your program. </td>
    </tr>
    <tr> 
      <td><b>RIP_EVENT</b></td>
      <td>System debugging error occurs</td>
    </tr>
  </table>
  <p><b>dwProcessId</b> and <b>dwThreadId</b> are the process and thread Ids of 
    the process that the debug event occurs. You can use these values as identifiers 
    of the process/thread you're interested in. Remember that if you use <b>CreateProcess</b> 
    to load the debuggee, you also get the process and thread IDs of the debuggee 
    in the <b>PROCESS_INFO</b> structure. You can use these values to differentiate 
    between the debug events occurring in the debuggee and its child processes 
    (in case you didn't specify <b>DEBUG_ONLY_THIS_PROCESS </b>flag).</p>
  <p> <b>u</b> is a union that contains more information about the debug event. 
    It can be one of the following structures depending on the value of <b>dwDebugEventCode</b> 
    above. </p>
  <table border="1" cellspacing="2" cellpadding="2" align="center">
    <tr bgcolor="#009900"> 
      <th><b>value in dwDebugEventCode</b></th>
      <th>Interpretation of u</th>
    </tr>
    <tr> 
      <td><b>CREATE_PROCESS_DEBUG_EVENT</b></td>
      <td> A <b>CREATE_PROCESS_DEBUG_INFO</b> structure named <b>CreateProcessInfo</b></td>
    </tr>
    <tr> 
      <td><b>EXIT_PROCESS_DEBUG_EVENT</b></td>
      <td>An <b>EXIT_PROCESS_DEBUG_INFO structure named</b> ExitProcess</td>
    </tr>
    <tr> 
      <td><b>CREATE_THREAD_DEBUG_EVENT</b></td>
      <td>A <b>CREATE_THREAD_DEBUG_INFO</b> structure named <b>CreateThread</b></td>
    </tr>
    <tr> 
      <td><b>EXIT_THREAD_DEBUG_EVENT</b></td>
      <td>An <b>EXIT_THREAD_DEBUG_EVENT </b>structure named <b>ExitThread</b></td>
    </tr>
    <tr> 
      <td><b>LOAD_DLL_DEBUG_EVENT</b></td>
      <td>A <b>LOAD_DLL_DEBUG_INFO</b> structure named<b> LoadDll</b></td>
    </tr>
    <tr> 
      <td><b>UNLOAD_DLL_DEBUG_EVENT</b></td>
      <td>An <b>UNLOAD_DLL_DEBUG_INFO</b> structure named <b>UnloadDll</b></td>
    </tr>
    <tr> 
      <td><b>EXCEPTION_DEBUG_EVENT</b></td>
      <td>An <b>EXCEPTION_DEBUG_INFO</b> structure named <b>Exception</b></td>
    </tr>
    <tr> 
      <td><b>OUTPUT_DEBUG_STRING_EVENT</b></td>
      <td>An <b>OUTPUT_DEBUG_STRING_INFO </b>structure named <b>DebugString</b></td>
    </tr>
    <tr> 
      <td><b>RIP_EVENT</b></td>
      <td>A <b>RIP_INFO</b> structure named <b>RipInfo</b></td>
    </tr>
  </table>
  <p>I won't go into detail about all those structures in this tutorial, only 
    the <b>CREATE_PROCESS_DEBUG_INFO </b>structure will be covered here. <br>
    Assuming that our program calls <b>WaitForDebugEvent</b> and it returns. The 
    first thing we should do is to examine the value in <b>dwDebugEventCode</b> 
    to see which type of debug event occured in the debuggee process. For example, 
    if the value in <b>dwDebugEventCode</b> is <b>CREATE_PROCESS_DEBUG_EVENT</b>, 
    you can interpret the member in <b>u</b> as <b>CreateProcessInfo</b> and access 
    it with <b>u.CreateProcessInfo</b>. </p>
  <li><b>Do whatever your program want to do in response to the debug event</b>. 
    When <b>WaitForDebugEvent </b>returns, it means a debug event just occurred 
    in the debuggee process or a timeout occurs. Your program needs to examine 
    the value in <b>dwDebugEventCode</b> in order to react to the event appropriately. 
    In this regard, it's like processing Windows messages: you choose to handle 
    some and ignore some. </li>
  <li><b>Let the debuggee continues execution</b>. When a debug event occurs, 
    Windows suspends the debuggee. When you're finished with the event handling, 
    you need to kick the debuggee into moving again. You do this by calling <b>ContinueDebugEvent</b> 
    function. 
    <p><b>ContinueDebugEvent proto dwProcessId:DWORD, dwThreadId:DWORD, dwContinueStatus:DWORD</b></p>
    <p>This function resumes the thread that was previously suspended because 
      a debug event occurred.<br>
      <b>dwProcessId</b> and <b>dwThreadId</b> are the process and thread IDs 
      of the thread that will be resumed. You usually take these two values from 
      the <b>dwProcessId</b> and <b>dwThreadId</b> members of the <b>DEBUG_EVENT</b> 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲毛片av在线| 91精品婷婷国产综合久久 | 污片在线观看一区二区| 欧美日韩一区 二区 三区 久久精品 | 欧美日韩亚洲综合一区| 国产一区二三区| 日本欧美加勒比视频| 亚洲男人的天堂一区二区| 欧美成人伊人久久综合网| 日韩欧美黄色影院| 26uuu久久天堂性欧美| 777亚洲妇女| 日韩欧美在线一区二区三区| 韩国精品一区二区| 337p粉嫩大胆色噜噜噜噜亚洲 | 国产一区二区在线观看视频| 亚洲mv在线观看| 天堂va蜜桃一区二区三区漫画版| 精品视频色一区| 国产一区二区美女| 亚洲成人激情自拍| 欧美欧美欧美欧美| 97久久精品人人做人人爽| 亚洲欧美另类图片小说| 亚洲成人av一区二区三区| 日韩在线卡一卡二| 欧美日韩专区在线| 午夜伊人狠狠久久| 日本黄色一区二区| 欧美国产激情二区三区| 国产麻豆精品在线观看| 欧美福利一区二区| 日韩在线一区二区| 欧美大度的电影原声| 欧美日本韩国一区二区三区视频| 欧美精品一区二区三区一线天视频| 午夜精品久久久久久久久久| 成人一区在线观看| 亚洲精品视频一区二区| 99精品黄色片免费大全| 亚洲男同性视频| 欧美视频一区在线| 韩国女主播成人在线| 久久久av毛片精品| 色八戒一区二区三区| 日韩av午夜在线观看| 欧美videofree性高清杂交| 国产精品18久久久| 亚洲成人www| 精品国产乱码久久久久久浪潮| 99精品在线观看视频| 亚洲人成亚洲人成在线观看图片| 欧美日韩精品久久久| 国产精品一区专区| 亚洲第一二三四区| 国产精品乱码人人做人人爱| 床上的激情91.| 欧美日韩在线一区二区| 美女高潮久久久| 日韩电影在线免费观看| 国产精品久久福利| 精品国产乱码久久久久久蜜臀 | 中日韩免费视频中文字幕| 99精品国产视频| 成人一区二区三区中文字幕| 国产一区二区精品久久| 美女视频黄免费的久久| 国产精品18久久久久久久网站| 国产精品中文字幕日韩精品| 大胆亚洲人体视频| 欧美三级电影网| 精品欧美一区二区三区精品久久| 国产亚洲欧美激情| 一区二区三区四区乱视频| 一区二区免费在线| 激情深爱一区二区| 精品少妇一区二区三区在线视频| 99re这里只有精品视频首页| 国产精品乡下勾搭老头1| 91影院在线免费观看| 色猫猫国产区一区二在线视频| 欧美午夜不卡视频| 久久久久久久精| 亚洲国产精品天堂| 高清国产午夜精品久久久久久| 97se亚洲国产综合自在线不卡| 欧美美女激情18p| 国产精品入口麻豆原神| 日韩福利视频导航| 欧美三级在线视频| 国产女人18水真多18精品一级做| 午夜欧美一区二区三区在线播放 | 免费欧美日韩国产三级电影| 国产盗摄视频一区二区三区| 欧美欧美午夜aⅴ在线观看| 久久久天堂av| 日韩精品91亚洲二区在线观看| 国产福利电影一区二区三区| 老司机精品视频一区二区三区| 高清日韩电视剧大全免费| 日韩女优毛片在线| 国产精品久久久久久久久免费桃花 | 国产欧美日韩精品a在线观看| 亚洲.国产.中文慕字在线| 成人app在线观看| 欧美一级淫片007| 麻豆成人91精品二区三区| 在线播放国产精品二区一二区四区| 一区二区三区在线视频免费| av动漫一区二区| 一区二区久久久| 欧美日韩成人综合天天影院| 《视频一区视频二区| 91蜜桃在线免费视频| 亚洲精品久久7777| 欧美综合久久久| 亚洲精品日产精品乱码不卡| 日本福利一区二区| 一区二区三区四区亚洲| 91蜜桃网址入口| 蜜臀av性久久久久蜜臀av麻豆| 日韩欧美一区在线观看| gogogo免费视频观看亚洲一| 亚洲视频综合在线| 欧美精品一级二级| 蜜桃av一区二区| 国产精品大尺度| 2022国产精品视频| 欧美日韩性生活| 99精品视频在线观看| 日本不卡一二三区黄网| 亚洲人成在线观看一区二区| xfplay精品久久| 欧美一区二区三区视频免费 | 一区二区高清免费观看影视大全| 在线播放欧美女士性生活| 成人h动漫精品一区二| 国产精品一区二区不卡| 天天色图综合网| 视频一区二区不卡| 婷婷综合另类小说色区| 亚洲国产日产av| 亚洲国产另类精品专区| 亚洲视频每日更新| 亚洲图片激情小说| 亚洲男人的天堂网| 亚洲欧洲日韩女同| 中文字幕一区视频| 亚洲人成影院在线观看| 亚洲欧美乱综合| 亚洲成av人在线观看| 亚洲一区视频在线观看视频| 亚洲一二三区在线观看| 日韩国产一二三区| 精品一区二区三区在线播放视频| 精品在线一区二区| 成av人片一区二区| 欧美一卡二卡在线| 中文字幕欧美激情一区| 一区二区三区四区精品在线视频| 日本最新不卡在线| 国产盗摄女厕一区二区三区| 在线亚洲人成电影网站色www| 欧美日韩一区不卡| 26uuu亚洲综合色| 亚洲一区二区av在线| 久久99国产精品久久99果冻传媒| 成人夜色视频网站在线观看| 欧美男人的天堂一二区| 久久久国产午夜精品| 亚洲午夜在线观看视频在线| 国产揄拍国内精品对白| 欧美精品免费视频| 国产精品短视频| 国产成人精品一区二| 欧美电影在线免费观看| 一区二区成人在线| 99视频精品全部免费在线| 国产日产欧美一区| 国产99久久久国产精品潘金 | 久久久久久久国产精品影院| 蜜芽一区二区三区| 正在播放亚洲一区| 日韩精品亚洲专区| 日韩视频免费观看高清完整版| 成人免费福利片| 国产精品久久久久久亚洲毛片 | 欧美丝袜第三区| 免费看欧美女人艹b| 日韩天堂在线观看| 激情偷乱视频一区二区三区| 国产亚洲精品bt天堂精选| 国产又黄又大久久| 一区二区视频在线| 91麻豆精品国产91久久久久| 捆绑变态av一区二区三区| 久久久不卡影院| 欧美中文一区二区三区| 7777精品伊人久久久大香线蕉的 | 日韩精品资源二区在线|