Skip to content

Commit 3b755c9

Browse files
committed
DBG: resolved issue x64dbg#211 (added a 'skip' command to skip the next instruction)
1 parent 8fa51b4 commit 3b755c9

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

help/skip.htm

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<html>
3+
<head>
4+
<title>skip</title>
5+
<meta name="GENERATOR" content="WinCHM">
6+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7+
<style>
8+
html,body {
9+
/* Default Font */
10+
font-family: Courier New;
11+
font-size: 11pt;
12+
}
13+
</style>
14+
15+
</head>
16+
17+
<body>
18+
<P><STRONG>skip<BR></STRONG>
19+
Skip the next instruction. This command&nbsp;swallows the current exception
20+
(if present). Useful if you want to continue after an INT3 command.</P>
21+
<P class=rvps3>
22+
<U>
23+
arguments
24+
25+
</U>
26+
<BR>This command has no arguments.
27+
</P>
28+
<P class=rvps3 >
29+
<U >
30+
result
31+
32+
<BR></U>This command does not set any result
33+
variables.</P></body>
34+
</html>

help/x64_dbg.wcp

514 Bytes
Binary file not shown.

x64_dbg_dbg/debugger_commands.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "simplescript.h"
1111
#include "symbolinfo.h"
1212
#include "assemble.h"
13+
#include "disasm_fast.h"
1314

1415
static bool bScyllaLoaded = false;
1516
uint LoadLibThreadID;
@@ -1994,3 +1995,16 @@ CMDRESULT cbDebugSetCmdline(int argc, char* argv[])
19941995

19951996
return STATUS_CONTINUE;
19961997
}
1998+
1999+
CMDRESULT cbDebugSkip(int argc, char* argv[])
2000+
{
2001+
SetNextDbgContinueStatus(DBG_CONTINUE); //swallow the exception
2002+
uint cip = GetContextDataEx(hActiveThread, UE_CIP);
2003+
BASIC_INSTRUCTION_INFO basicinfo;
2004+
memset(&basicinfo, 0, sizeof(basicinfo));
2005+
disasmfast(cip, &basicinfo);
2006+
cip += basicinfo.size;
2007+
SetContextDataEx(hActiveThread, UE_CIP, cip);
2008+
DebugUpdateGui(cip, false); //update GUI
2009+
return STATUS_CONTINUE;
2010+
}

x64_dbg_dbg/debugger_commands.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ CMDRESULT cbDebugDisableMemoryBreakpoint(int argc, char* argv[]);
6363
CMDRESULT cbDebugDownloadSymbol(int argc, char* argv[]);
6464
CMDRESULT cbDebugGetPageRights(int argc, char* argv[]);
6565
CMDRESULT cbDebugSetPageRights(int argc, char* argv[]);
66+
CMDRESULT cbDebugSkip(int argc, char* argv[]);
6667

6768
//misc
6869
void showcommandlineerror(cmdline_error_t* cmdline_error);

x64_dbg_dbg/x64_dbg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ static void registercommands()
8585
dbgcmdnew("getcmdline\1getcommandline", cbDebugGetCmdline, true); //Get CmdLine
8686
dbgcmdnew("setcmdline\1setcommandline", cbDebugSetCmdline, true); //Set CmdLine
8787
dbgcmdnew("loadlib", cbDebugLoadLib, true); //Load DLL
88+
dbgcmdnew("skip", cbDebugSkip, true); //skip one instruction
8889

8990
//breakpoints
9091
dbgcmdnew("bplist", cbDebugBplist, true); //breakpoint list

0 commit comments

Comments
 (0)