HyperDbg Debugger
Loading...
Searching...
No Matches
rev-ctrl.cpp File Reference

Controller of the reversing machine's module. More...

#include "pch.h"

Functions

BOOLEAN RevRequestService (REVERSING_MACHINE_RECONSTRUCT_MEMORY_REQUEST *RevRequest)
 Request service from the reversing machine.
 

Detailed Description

Controller of the reversing machine's module.

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.2
Date
2023-03-23

Function Documentation

◆ RevRequestService()

BOOLEAN RevRequestService ( REVERSING_MACHINE_RECONSTRUCT_MEMORY_REQUEST * RevRequest)

Request service from the reversing machine.

Parameters
RevRequest
Returns
BOOLEAN
24{
25 BOOLEAN Status;
26 ULONG ReturnedLength;
27
28 //
29 // Check if debugger is loaded or not
30 //
32
33 //
34 // Send the request to the kernel
35 //
36 Status = DeviceIoControl(
37 g_DeviceHandle, // Handle to device
39 // code
40 RevRequest, // Input Buffer to driver.
42 RevRequest, // Output Buffer from driver.
44 // buffer in bytes.
45 &ReturnedLength, // Bytes placed in buffer.
46 NULL // synchronous call
47 );
48
49 if (!Status)
50 {
51 ShowMessages("ioctl failed with code 0x%x\n", GetLastError());
52 return FALSE;
53 }
54
55 //
56 // Check if the service request was successful or not
57 //
59 {
60 ShowMessages("the reversing machine service request was successful!\n");
61 }
62 else
63 {
64 ShowErrorMessage(RevRequest->KernelStatus);
65 return FALSE;
66 }
67
68 return FALSE;
69}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define FALSE
Definition BasicTypes.h:54
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_REQUEST_REV_MACHINE_SERVICE
ioctl, request service from the reversing machine
Definition Ioctls.h:275
#define SIZEOF_REVERSING_MACHINE_RECONSTRUCT_MEMORY_REQUEST
Definition RequestStructures.h:107
BOOLEAN ShowErrorMessage(UINT32 Error)
shows the error message
Definition debugger.cpp:38
#define AssertShowMessageReturnStmt(expr, message, rc)
Definition common.h:51
#define ASSERT_MESSAGE_DRIVER_NOT_LOADED
Definition common.h:25
#define AssertReturnFalse
Definition common.h:21
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
UINT32 KernelStatus
Definition RequestStructures.h:120