49{
   55    UINT32                             ActionBreakToDebuggerLength = 0;
 
   56    UINT32                             ActionCustomCodeLength      = 0;
 
   57    UINT32                             ActionScriptLength          = 0;
 
   60    vector<string>                     SplitCommandCaseSensitive {
Split(Command, 
' ')};
 
   62 
   63    
   64    
   65    
   66    
   68            &SplitCommand,
   69            &SplitCommandCaseSensitive,
   71            &Event,
   72            &EventLength,
   73            &ActionBreakToDebugger,
   74            &ActionBreakToDebuggerLength,
   75            &ActionCustomCode,
   76            &ActionCustomCodeLength,
   77            &ActionScript,
   78            &ActionScriptLength,
   79            &EventParsingErrorCause))
   80    {
   81        return;
   82    }
   83 
   84    
   85    
   86    
   87    
   88    for (auto Section : SplitCommand)
   89    {
   90        if (!Section.compare("!interrupt"))
   91        {
   92            continue;
   93        }
   94        else if (!GetEntry)
   95        {
   96            
   97            
   98            
  100            {
  101                
  102                
  103                
  104                ShowMessages(
"unknown parameter '%s'\n\n", Section.c_str());
 
  106 
  108                return;
  109            }
  110            else
  111            {
  112                
  113                
  114                
  115                if (!(SpecialTarget >= 32 && SpecialTarget <= 0xff))
  116                {
  117                    
  118                    
  119                    
  120                    
  121                    ShowMessages(
"the entry should be between 0x20 to 0xFF or the " 
  122                                 "entries between 32 to 255\n\n");
  124 
  126                    return;
  127                }
  129            }
  130        }
  131        else
  132        {
  133            
  134            
  135            
  136            ShowMessages(
"unknown parameter '%s'\n\n", Section.c_str());
 
  138 
  140            return;
  141        }
  142    }
  143 
  144    if (SpecialTarget == 0)
  145    {
  146        
  147        
  148        
  149        
  150        
  151        ShowMessages(
"please specify an interrupt index to monitor, HyperDbg " 
  152                     "doesn't support to trigger events on all interrupts because "
  153                     "it's not reasonable and make the system unresponsive\n");
  155 
  157        return;
  158    }
  159 
  160    
  161    
  162    
  164 
  165    
  166    
  167    
  169    {
  170        
  171        
  172        
  173        
  174        
  175 
  177        return;
  178    }
  179 
  180    
  181    
  182    
  184                               ActionBreakToDebugger,
  185                               ActionBreakToDebuggerLength,
  186                               ActionCustomCode,
  187                               ActionCustomCodeLength,
  188                               ActionScript,
  189                               ActionScriptLength))
  190    {
  191        
  192        
  193        
  194 
  196        return;
  197    }
  198}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
const vector< string > Split(const string &s, const char &c)
general split command
Definition common.cpp:117
BOOLEAN ConvertStringToUInt64(string TextToConvert, PUINT64 Result)
check and convert string to a 64 bit unsigned integer and also check for special notations like 0x,...
Definition common.cpp:240
VOID FreeEventsAndActionsMemory(PDEBUGGER_GENERAL_EVENT_DETAIL Event, PDEBUGGER_GENERAL_ACTION ActionBreakToDebugger, PDEBUGGER_GENERAL_ACTION ActionCustomCode, PDEBUGGER_GENERAL_ACTION ActionScript)
Deallocate buffers relating to events and actions.
Definition debugger.cpp:2292
BOOLEAN InterpretGeneralEventAndActionsFields(vector< string > *SplitCommand, vector< string > *SplitCommandCaseSensitive, VMM_EVENT_TYPE_ENUM EventType, PDEBUGGER_GENERAL_EVENT_DETAIL *EventDetailsToFill, PUINT32 EventBufferLength, PDEBUGGER_GENERAL_ACTION *ActionDetailsToFillBreakToDebugger, PUINT32 ActionBufferLengthBreakToDebugger, PDEBUGGER_GENERAL_ACTION *ActionDetailsToFillCustomCode, PUINT32 ActionBufferLengthCustomCode, PDEBUGGER_GENERAL_ACTION *ActionDetailsToFillScript, PUINT32 ActionBufferLengthScript, PDEBUGGER_EVENT_PARSING_ERROR_CAUSE ReasonForErrorInParsing)
Interpret general event fields.
Definition debugger.cpp:2342
BOOLEAN SendEventToKernel(PDEBUGGER_GENERAL_EVENT_DETAIL Event, UINT32 EventBufferLength)
Register the event to the kernel.
Definition debugger.cpp:1969
BOOLEAN RegisterActionToEvent(PDEBUGGER_GENERAL_EVENT_DETAIL Event, PDEBUGGER_GENERAL_ACTION ActionBreakToDebugger, UINT32 ActionBreakToDebuggerLength, PDEBUGGER_GENERAL_ACTION ActionCustomCode, UINT32 ActionCustomCodeLength, PDEBUGGER_GENERAL_ACTION ActionScript, UINT32 ActionScriptLength)
Register the action to the event.
Definition debugger.cpp:2086
VOID CommandInterruptHelp()
help of the !interrupt command
Definition interrupt.cpp:20
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
NULL()
Definition test-case-generator.py:530
UINT64 OptionalParam1
Definition Events.h:272
Each event can have multiple actions.
Definition Events.h:406
Each command is like the following struct, it also used for tracing works in user mode and sending it...
Definition Events.h:350
DEBUGGER_EVENT_OPTIONS Options
Definition Events.h:391