265{
  273    vector<string>       SplitCommandCaseSensitive {
Split(Command, 
' ')};
 
  274    UINT32               IndexInCommandCaseSensitive = 0;
 
  275    PAGE_FAULT_EXCEPTION PageFaultErrorCode          = {0};
  276 
  277    
  278    
  279    
  280    
  282    {
  284    }
  285 
  286    if (SplitCommand.size() == 1)
  287    {
  288        
  289        
  290        
  291        ShowMessages(
"incorrect use of the '.pagein' command\n\n");
 
  293        return;
  294    }
  295 
  296    for (auto Section : SplitCommand)
  297    {
  298        IndexInCommandCaseSensitive++;
  299 
  300        if (IsFirstCommand)
  301        {
  302            IsFirstCommand = 
FALSE;
 
  303            continue;
  304        }
  305        if (IsNextProcessId == 
TRUE)
 
  306        {
  308            {
  309                ShowMessages(
"err, you should enter a valid process id\n\n");
 
  310                return;
  311            }
  312            IsNextProcessId = 
FALSE;
 
  313            continue;
  314        }
  315 
  316        if (IsNextLength == 
TRUE)
 
  317        {
  319            {
  320                ShowMessages(
"err, you should enter a valid length\n\n");
 
  321                return;
  322            }
  323            IsNextLength = 
FALSE;
 
  324            continue;
  325        }
  326 
  327        if (!Section.compare("l"))
  328        {
  330            continue;
  331        }
  332 
  333        
  334        
  335        
  336        
  337        
  338 
  339        
  340        
  341        
  342 
  344        {
  345            continue;
  346        }
  347        else if (TargetAddressFrom == 0)
  348        {
  350                                                  &TargetAddressFrom))
  351            {
  352                
  353                
  354                
  356                             SplitCommandCaseSensitive.at(IndexInCommandCaseSensitive - 1).c_str());
  357                return;
  358            }
  359        }
  360        else
  361        {
  362            
  363            
  364            
  365            ShowMessages(
"err, incorrect use of the '.pagein' command\n\n");
 
  367 
  368            return;
  369        }
  370    }
  371 
  372    if (!TargetAddressFrom)
  373    {
  374        
  375        
  376        
  378 
  379        return;
  380    }
  381 
  382    if (IsNextLength || IsNextProcessId)
  383    {
  384        ShowMessages(
"incorrect use of the '.pagein' command\n\n");
 
  386        return;
  387    }
  388 
  389    
  390    
  391    
  392    
  393    if (Length == 0)
  394    {
  395        TargetAddressTo = TargetAddressFrom;
  396    }
  397    else
  398    {
  399        TargetAddressTo = TargetAddressFrom + Length;
  400    }
  401 
  402    
  403    
  404    
  405    
  406    
  407    
  408    
  409    
  410    
  411 
  412    
  413    
  414    
  416                         TargetAddressTo,
  417                         PageFaultErrorCode,
  418                         Pid);
  419}
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 ConvertStringToUInt32(string TextToConvert, PUINT32 Result)
check and convert string to a 32 bit unsigned it and also check for special notations like 0x etc.
Definition common.cpp:347
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
NULL()
Definition test-case-generator.py:530
VOID CommandPageinHelp()
help of the .pagein command
Definition pagein.cpp:26
BOOLEAN CommandPageinCheckAndInterpretModeString(const std::string &ModeString, PAGE_FAULT_EXCEPTION *PageFaultErrorCode)
Check whether the mode string is valid or not.
Definition pagein.cpp:81
VOID CommandPageinRequest(UINT64 TargetVirtualAddrFrom, UINT64 TargetVirtualAddrTo, PAGE_FAULT_EXCEPTION PageFaultErrorCode, UINT32 Pid)
request to bring the page(s) in
Definition pagein.cpp:171
ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
State of active debugging thread.
Definition globals.h:362
UINT32 ProcessId
Definition ud.h:51
BOOLEAN IsActive
Definition ud.h:49
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