亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久久不卡网国产精品二区| 精品国产网站在线观看| 精品一区二区三区免费视频| 亚洲视频每日更新| 国产精品国产三级国产aⅴ中文 | 亚洲精品一线二线三线 | 欧美最新大片在线看| 91在线观看下载| 99视频精品在线| 99精品欧美一区二区蜜桃免费| 国产成人精品www牛牛影视| 麻豆国产一区二区| 精品一二三四区| 成人久久久精品乱码一区二区三区 | 精品国产乱码久久久久久1区2区| 91精品国产一区二区三区香蕉| 色噜噜狠狠成人网p站| 欧美亚洲日本一区| 91麻豆精品91久久久久久清纯| 欧美日韩免费视频| 日韩欧美国产三级| 国产精品午夜电影| 亚洲一区二区三区爽爽爽爽爽| 亚洲伊人伊色伊影伊综合网| 免费观看成人鲁鲁鲁鲁鲁视频| 国产在线播放一区二区三区| 99re8在线精品视频免费播放| 日韩精品综合一本久道在线视频| 精品捆绑美女sm三区| 91精品国产综合久久蜜臀| 制服丝袜激情欧洲亚洲| 日韩欧美成人一区| 久久久久久久精| 久久精品亚洲精品国产欧美kt∨| 欧美大肚乱孕交hd孕妇| 欧美变态tickling挠脚心| 久久久久久免费网| 亚洲欧美中日韩| 亚洲高清免费观看 | 1024成人网| 久久色中文字幕| 日韩美一区二区三区| 国产精品视频观看| 日韩电影免费在线看| 粉嫩一区二区三区性色av| 在线一区二区视频| 久久人人爽爽爽人久久久| 国产精品美女一区二区三区| 国产午夜精品福利| 亚洲免费观看在线视频| 国产综合久久久久影院| 欧洲国内综合视频| 久久免费电影网| 午夜欧美2019年伦理| 成人免费视频视频在线观看免费 | 粉嫩av亚洲一区二区图片| 成人黄色av电影| 日韩一区二区三区精品视频| 中文字幕精品在线不卡| 日本欧美大码aⅴ在线播放| 色94色欧美sute亚洲13| 国产精品久久毛片a| 国产在线一区观看| 日韩视频永久免费| 日韩高清不卡一区二区| 一本到不卡精品视频在线观看| 国产日韩欧美电影| 一本到不卡精品视频在线观看| 久久久精品综合| 黑人巨大精品欧美黑白配亚洲| 欧美精品xxxxbbbb| 亚洲午夜影视影院在线观看| 91国偷自产一区二区三区成为亚洲经典 | 国产一区二区91| 久久久久久9999| 久久99日本精品| 久久九九久精品国产免费直播| 日韩av一区二区在线影视| 欧美一级黄色大片| 激情文学综合丁香| 国产欧美在线观看一区| 菠萝蜜视频在线观看一区| 国产精品77777| 亚洲视频狠狠干| 欧美剧情片在线观看| 精品一区二区久久| 日本特黄久久久高潮| 久久久亚洲精品一区二区三区 | 色婷婷综合久久久| 秋霞成人午夜伦在线观看| 日韩欧美在线观看一区二区三区| 六月丁香综合在线视频| 国产午夜亚洲精品理论片色戒| 成人免费福利片| 五月天国产精品| 欧美变态tickling挠脚心| 成人app网站| 日韩黄色一级片| 久久久久久亚洲综合| 欧美视频中文字幕| 国产精品18久久久久久久久| 亚洲男人的天堂在线aⅴ视频| 91国内精品野花午夜精品| 久久精品国产秦先生| 午夜国产精品影院在线观看| 久久精品日韩一区二区三区| 欧美调教femdomvk| 成人高清视频在线观看| 久久精品免费观看| 亚洲香肠在线观看| 18成人在线观看| 国产欧美日韩另类一区| 日韩一区二区免费电影| 在线亚洲一区观看| 91蜜桃在线免费视频| 东方欧美亚洲色图在线| 国产一区二区按摩在线观看| 天天色综合天天| 性感美女久久精品| 亚洲成人资源在线| 亚洲精品免费一二三区| 亚洲成人动漫av| 亚洲国产va精品久久久不卡综合| 亚洲夂夂婷婷色拍ww47| 亚洲va中文字幕| 亚洲成人tv网| 日韩av一区二区三区| 麻豆91免费观看| 国产在线精品一区二区夜色| 狠狠色综合播放一区二区| 国产精品中文字幕一区二区三区| 韩国av一区二区| 国产91精品在线观看| 久久国产日韩欧美精品| 精品1区2区在线观看| 欧美变态凌虐bdsm| 亚洲色图一区二区三区| 国产老妇另类xxxxx| 91高清视频免费看| 欧美日韩精品福利| 精品精品国产高清a毛片牛牛| 欧美激情一区在线| 三级成人在线视频| 国产高清精品在线| 91首页免费视频| 欧美人与z0zoxxxx视频| 久久亚洲综合av| 一区二区三区国产精华| 视频一区二区不卡| 91在线观看美女| 亚洲视频 欧洲视频| 亚洲国产美国国产综合一区二区| 激情欧美一区二区三区在线观看| 成人做爰69片免费看网站| 欧美一区欧美二区| 亚洲成国产人片在线观看| 粉嫩嫩av羞羞动漫久久久| 日韩三级av在线播放| 一个色妞综合视频在线观看| 日韩高清国产一区在线| 色视频欧美一区二区三区| 在线电影欧美成精品| 亚洲精品免费电影| 成人爽a毛片一区二区免费| 亚洲精品一区二区在线观看| 日韩黄色在线观看| 日韩一区二区三区四区| 日韩电影一二三区| 337p粉嫩大胆色噜噜噜噜亚洲 | 成人亚洲精品久久久久软件| 精品国免费一区二区三区| 国内成人免费视频| 亚洲日本在线天堂| 欧美日韩免费一区二区三区视频| 亚洲与欧洲av电影| 免费视频一区二区| 一区二区成人在线观看| 国产精品美女久久久久高潮| 26uuu精品一区二区在线观看| 洋洋成人永久网站入口| www.性欧美| 日韩一区二区在线观看视频播放| 3751色影院一区二区三区| 激情六月婷婷久久| 精品国产伦一区二区三区观看体验| 日韩欧美一级精品久久| xfplay精品久久| 国产精品久久久久aaaa| 免费成人av在线| 亚洲欧美二区三区| eeuss国产一区二区三区| 国产精品视频观看| 午夜av电影一区| 欧美精品一区视频| 91首页免费视频| 日韩av不卡一区二区| 天堂成人免费av电影一区| 久久精品人人做| 欧美乱熟臀69xxxxxx| 东方aⅴ免费观看久久av|