55{
   60 
   61    if (SplitCommand.size() != 3)
   62    {
   65        return;
   66    }
   67 
   68    
   69    
   70    
   71    if (!SplitCommand.at(1).compare("thread-interception"))
   72    {
   74    }
   75    else if (!SplitCommand.at(1).compare("monitor") || !SplitCommand.at(1).compare("!monitor"))
   76    {
   78    }
   79    else if (!SplitCommand.at(1).compare("epthook") || !SplitCommand.at(1).compare("!epthook"))
   80    {
   82    }
   83    else if (!SplitCommand.at(1).compare("epthook2") || !SplitCommand.at(1).compare("!epthook2"))
   84    {
   86    }
   87    else if (!SplitCommand.at(1).compare("regular-event"))
   88    {
   90    }
   91    else if (!SplitCommand.at(1).compare("big-event"))
   92    {
   94    }
   95    else if (!SplitCommand.at(1).compare("regular-safe-buffer"))
   96    {
   98    }
   99    else if (!SplitCommand.at(1).compare("big-safe-buffer"))
  100    {
  102    }
  103    else
  104    {
  105        
  106        
  107        
  109                     SplitCommand.at(1).c_str());
  110        return;
  111    }
  112 
  113    
  114    
  115    
  117    {
  118        
  119        
  120        
  122                     SplitCommand.at(2).c_str());
  123        return;
  124    }
  125 
  126    
  127    
  128    
  130 
  132 
  133    
  134    
  135    
  136    Status = DeviceIoControl(
  139        &PreallocRequest,                  
  141        &PreallocRequest,                  
  143                                           
  144        &ReturnedLength,                   
  145        NULL                               
  146    );
  147 
  148    if (!Status)
  149    {
  150        ShowMessages(
"ioctl failed with code 0x%x\n", GetLastError());
 
  151        return;
  152    }
  153 
  155    {
  156        ShowMessages(
"the requested pools are allocated and reserved\n");
 
  157    }
  158    else
  159    {
  160        
  161        
  162        
  164    }
  165}
int BOOL
Definition BasicTypes.h:23
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
unsigned long ULONG
Definition BasicTypes.h:37
#define DEBUGGER_OPERATION_WAS_SUCCESSFUL
General value to indicate that the operation or request was successful.
Definition ErrorCodes.h:23
#define IOCTL_RESERVE_PRE_ALLOCATED_POOLS
ioctl, to reserve pre-allocated pools
Definition Ioctls.h:219
#define SIZEOF_DEBUGGER_PREALLOC_COMMAND
Definition RequestStructures.h:166
@ DEBUGGER_PREALLOC_COMMAND_TYPE_MONITOR
Definition RequestStructures.h:156
@ DEBUGGER_PREALLOC_COMMAND_TYPE_EPTHOOK2
Definition RequestStructures.h:158
@ DEBUGGER_PREALLOC_COMMAND_TYPE_BIG_EVENT
Definition RequestStructures.h:160
@ DEBUGGER_PREALLOC_COMMAND_TYPE_REGULAR_EVENT
Definition RequestStructures.h:159
@ DEBUGGER_PREALLOC_COMMAND_TYPE_THREAD_INTERCEPTION
Definition RequestStructures.h:155
@ DEBUGGER_PREALLOC_COMMAND_TYPE_BIG_SAFE_BUFFER
Definition RequestStructures.h:162
@ DEBUGGER_PREALLOC_COMMAND_TYPE_REGULAR_SAFE_BUFFER
Definition RequestStructures.h:161
@ DEBUGGER_PREALLOC_COMMAND_TYPE_EPTHOOK
Definition RequestStructures.h:157
BOOLEAN ShowErrorMessage(UINT32 Error)
shows the error message
Definition debugger.cpp:38
HANDLE g_DeviceHandle
Holds the global handle of device which is used to send the request to the kernel by IOCTL,...
Definition globals.h:471
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
VOID CommandPreallocHelp()
help of the prealloc command
Definition prealloc.cpp:20
requests for the 'prealloc' command
Definition RequestStructures.h:174
DEBUGGER_PREALLOC_COMMAND_TYPE Type
Definition RequestStructures.h:175
UINT32 KernelStatus
Definition RequestStructures.h:177
UINT32 Count
Definition RequestStructures.h:176
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