DBG: resolved issue #211 (added a 'skip' command to skip the next instruction)

This commit is contained in:
Mr. eXoDia 2014-12-14 03:07:45 +01:00
parent 8fa51b470e
commit 3b755c9279
5 changed files with 50 additions and 0 deletions

34
help/skip.htm Normal file
View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>skip</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
html,body {
/* Default Font */
font-family: Courier New;
font-size: 11pt;
}
</style>
</head>
<body>
<P><STRONG>skip<BR></STRONG>
Skip the next instruction. This command&nbsp;swallows the current exception
(if present). Useful if you want to continue after an INT3 command.</P>
<P class=rvps3>
<U>
arguments
</U>
<BR>This command has no arguments.
</P>
<P class=rvps3 >
<U >
result
<BR></U>This command does not set any result
variables.</P></body>
</html>

Binary file not shown.

View File

@ -10,6 +10,7 @@
#include "simplescript.h"
#include "symbolinfo.h"
#include "assemble.h"
#include "disasm_fast.h"
static bool bScyllaLoaded = false;
uint LoadLibThreadID;
@ -1994,3 +1995,16 @@ CMDRESULT cbDebugSetCmdline(int argc, char* argv[])
return STATUS_CONTINUE;
}
CMDRESULT cbDebugSkip(int argc, char* argv[])
{
SetNextDbgContinueStatus(DBG_CONTINUE); //swallow the exception
uint cip = GetContextDataEx(hActiveThread, UE_CIP);
BASIC_INSTRUCTION_INFO basicinfo;
memset(&basicinfo, 0, sizeof(basicinfo));
disasmfast(cip, &basicinfo);
cip += basicinfo.size;
SetContextDataEx(hActiveThread, UE_CIP, cip);
DebugUpdateGui(cip, false); //update GUI
return STATUS_CONTINUE;
}

View File

@ -63,6 +63,7 @@ CMDRESULT cbDebugDisableMemoryBreakpoint(int argc, char* argv[]);
CMDRESULT cbDebugDownloadSymbol(int argc, char* argv[]);
CMDRESULT cbDebugGetPageRights(int argc, char* argv[]);
CMDRESULT cbDebugSetPageRights(int argc, char* argv[]);
CMDRESULT cbDebugSkip(int argc, char* argv[]);
//misc
void showcommandlineerror(cmdline_error_t* cmdline_error);

View File

@ -85,6 +85,7 @@ static void registercommands()
dbgcmdnew("getcmdline\1getcommandline", cbDebugGetCmdline, true); //Get CmdLine
dbgcmdnew("setcmdline\1setcommandline", cbDebugSetCmdline, true); //Set CmdLine
dbgcmdnew("loadlib", cbDebugLoadLib, true); //Load DLL
dbgcmdnew("skip", cbDebugSkip, true); //skip one instruction
//breakpoints
dbgcmdnew("bplist", cbDebugBplist, true); //breakpoint list