48{
   54    UINT32                             ActionBreakToDebuggerLength = 0;
 
   55    UINT32                             ActionCustomCodeLength      = 0;
 
   56    UINT32                             ActionScriptLength          = 0;
 
   59    vector<string>                     SplitCommandCaseSensitive {
Split(Command, 
' ')};
 
   60    UINT32                             IndexInCommandCaseSensitive = 0;
 
   62 
   63    if (SplitCommand.size() < 2)
   64    {
   67        return;
   68    }
   69 
   70    
   71    
   72    
   74            &SplitCommand,
   75            &SplitCommandCaseSensitive,
   77            &Event,
   78            &EventLength,
   79            &ActionBreakToDebugger,
   80            &ActionBreakToDebuggerLength,
   81            &ActionCustomCode,
   82            &ActionCustomCodeLength,
   83            &ActionScript,
   84            &ActionScriptLength,
   85            &EventParsingErrorCause))
   86    {
   87        return;
   88    }
   89 
   90    
   91    
   92    
   94    {
   95        ShowMessages(
"the utilization of 'post' or 'all' event calling stages is not meaningful " 
   96                     "for the hidden hook; therefore, this command does not support them\n");
   97 
   99        return;
  100    }
  101 
  102    
  103    
  104    
  105    for (auto Section : SplitCommand)
  106    {
  107        IndexInCommandCaseSensitive++;
  108 
  109        if (!Section.compare("!epthook"))
  110        {
  111            continue;
  112        }
  113        else if (!GetAddress)
  114        {
  115            
  116            
  117            
  119                    SplitCommandCaseSensitive.at(IndexInCommandCaseSensitive - 1),
  120                    &OptionalParam1))
  121            {
  122                
  123                
  124                
  126                             SplitCommandCaseSensitive.at(IndexInCommandCaseSensitive - 1).c_str());
  128 
  130                return;
  131            }
  132            else
  133            {
  135            }
  136        }
  137        else
  138        {
  139            
  140            
  141            
  142            ShowMessages(
"unknown parameter '%s'\n\n", Section.c_str());
 
  144 
  146            return;
  147        }
  148    }
  149    if (OptionalParam1 == 0)
  150    {
  151        ShowMessages(
"please choose an address to put the hidden breakpoint on it\n");
 
  152 
  154        return;
  155    }
  156 
  157    
  158    
  159    
  161 
  162    
  163    
  164    
  166    {
  167        
  168        
  169        
  170        
  171        
  172 
  174        return;
  175    }
  176 
  177    
  178    
  179    
  181                               ActionBreakToDebugger,
  182                               ActionBreakToDebuggerLength,
  183                               ActionCustomCode,
  184                               ActionCustomCodeLength,
  185                               ActionScript,
  186                               ActionScriptLength))
  187    {
  188        
  189        
  190        
  191 
  193        return;
  194    }
  195}
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
@ VMM_CALLBACK_CALLING_STAGE_PRE_EVENT_EMULATION
Definition DataTypes.h:93
const vector< string > Split(const string &s, const char &c)
general split command
Definition common.cpp:117
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 CommandEptHookHelp()
help of the !epthook command
Definition epthook.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
VMM_CALLBACK_EVENT_CALLING_STAGE_TYPE EventStage
Definition Events.h:369
BOOLEAN SymbolConvertNameOrExprToAddress(const string &TextToConvert, PUINT64 Result)
check and convert string to a 64 bit unsigned integer and also check for symbol object names and eval...
Definition symbol.cpp:360