HyperDbg Debugger
Loading...
Searching...
No Matches
libhyperdbg.h File Reference

headers for libhyperdbg More...

Go to the source code of this file.

Functions

INT HyperDbgCreateHandleFromVmmModule ()
 Create handle from VMM module.
 
INT HyperDbgUnloadVmm ()
 Unload VMM driver.
 
INT HyperDbgInstallVmmDriver ()
 Install VMM driver.
 
INT HyperDbgUninstallVmmDriver ()
 Remove the VMM driver.
 
INT HyperDbgLoadVmmModule ()
 load vmm module
 
INT HyperDbgStopVmmDriver ()
 Stop VMM driver.
 
INT HyperDbgInterpreter (CHAR *Command)
 Interpret commands.
 
INT ScriptReadFileAndExecuteCommandline (INT argc, CHAR *argv[])
 Parsing the command line options for scripts.
 
VOID HyperDbgShowSignature ()
 Show signature of HyperDbg.
 
VOID SetTextMessageCallback (PVOID Handler)
 Set the function callback that will be called if any message needs to be shown.
 
PVOID SetTextMessageCallbackUsingSharedBuffer (PVOID Handler)
 Set the function callback that will be called if any message needs to be shown.
 
VOID UnsetTextMessageCallback ()
 Unset the function callback that will be called if any message needs to be shown.
 

Detailed Description

headers for libhyperdbg

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
1.0
Date
2024-06-24

Function Documentation

◆ HyperDbgCreateHandleFromVmmModule()

INT HyperDbgCreateHandleFromVmmModule ( )

Create handle from VMM module.

Returns
INT return zero if it was successful or non-zero if there was error

lpSecurityAttirbutes

lpTemplateFile

617{
618 DWORD ErrorNum;
619 DWORD ThreadId;
620
621 if (g_DeviceHandle)
622 {
623 ShowMessages("handle of the driver found, if you use 'load' before, please "
624 "unload it using 'unload'\n");
625 return 1;
626 }
627
628 //
629 // Make sure that this variable is false, because it might be set to
630 // true as the result of a previous load
631 //
633
634 //
635 // Init entering vmx
636 //
637 g_DeviceHandle = CreateFileA(
638 "\\\\.\\HyperDbgDebuggerDevice",
639 GENERIC_READ | GENERIC_WRITE,
640 FILE_SHARE_READ | FILE_SHARE_WRITE,
641 NULL,
642 OPEN_EXISTING,
643 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
644 NULL);
645
646 if (g_DeviceHandle == INVALID_HANDLE_VALUE)
647 {
648 ErrorNum = GetLastError();
649 if (ErrorNum == ERROR_ACCESS_DENIED)
650 {
651 ShowMessages("err, access denied\nare you sure you have administrator "
652 "rights?\n");
653 }
654 else if (ErrorNum == ERROR_GEN_FAILURE)
655 {
656 ShowMessages("err, a device attached to the system is not functioning\n"
657 "vmx feature might be disabled from BIOS or VBS/HVCI is active\n");
658 }
659 else
660 {
661 ShowMessages("err, CreateFile failed (%x)\n", ErrorNum);
662 }
663
665 return 1;
666 }
667
668 //
669 // Initialize the list of events
670 //
672
673#if !UseDbgPrintInsteadOfUsermodeMessageTracking
674 HANDLE Thread = CreateThread(NULL, 0, IrpBasedBufferThread, NULL, 0, &ThreadId);
675
676 // if (Thread)
677 // {
678 // ShowMessages("thread Created successfully\n");
679 // }
680
681#endif
682
683 return 0;
684}
#define FALSE
Definition BasicTypes.h:54
unsigned long DWORD
Definition BasicTypes.h:22
FORCEINLINE VOID InitializeListHead(_Out_ PLIST_ENTRY ListHead)
Definition Windows.h:41
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
DWORD WINAPI IrpBasedBufferThread(void *data)
Create a thread for pending buffers.
Definition libhyperdbg.cpp:483
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
BOOLEAN g_IsVmxOffProcessStart
Shows whether the vmxoff process start or not.
Definition globals.h:462
LIST_ENTRY g_EventTrace
Holds a list of events in kernel and the state of events and the commands to show the state of each c...
Definition globals.h:400
NULL()
Definition test-case-generator.py:530

◆ HyperDbgInstallVmmDriver()

INT HyperDbgInstallVmmDriver ( )

Install VMM driver.

Returns
INT return zero if it was successful or non-zero if there was error
503{
504 //
505 // The driver is not started yet so let us the install driver
506 // First setup full path to driver name
507 //
508
509 //
510 // If the user has not specified a custom driver location, then we
511 // need to find the driver in the same directory as the executable
512 //
514 {
516 {
517 return 1;
518 }
519
520 //
521 // Use default driver name
522 //
524 }
525
527 {
528 ShowMessages("unable to install VMM driver\n");
529
530 //
531 // Error - remove driver
532 //
534
535 return 1;
536 }
537
538 return 0;
539}
#define TRUE
Definition BasicTypes.h:55
#define KERNEL_DEBUGGER_DRIVER_NAME
name of HyperDbg's debugger driver
Definition Definition.h:40
#define KERNEL_DEBUGGER_DRIVER_NAME_AND_EXTENSION
name of HyperDbg's debugger driver + extension
Definition Definition.h:46
BOOLEAN SetupPathForFileName(const CHAR *FileName, _Inout_updates_bytes_all_(BufferLength) PCHAR FileLocation, ULONG BufferLength, BOOLEAN CheckFileExists)
Setup file name.
Definition install.cpp:440
BOOLEAN ManageDriver(LPCTSTR DriverName, LPCTSTR ServiceName, UINT16 Function)
Manage Driver.
Definition install.cpp:121
#define DRIVER_FUNC_REMOVE
Definition install.h:36
#define DRIVER_FUNC_INSTALL
Definition install.h:34
TCHAR g_DriverLocation[MAX_PATH]
Holds the location driver to install it.
Definition globals.h:423
TCHAR g_DriverName[MAX_PATH]
Holds the name of the driver to install it.
Definition globals.h:429
BOOLEAN g_UseCustomDriverLocation
Whether the user wants to use a custom driver location or not.
Definition globals.h:435

◆ HyperDbgInterpreter()

INT HyperDbgInterpreter ( CHAR * Command)

Interpret commands.

Parameters
CommandThe text of command
Returns
INT returns return zero if it was successful or non-zero if there was error
281{
282 BOOLEAN HelpCommand = FALSE;
283 UINT64 CommandAttributes = NULL;
284 CommandType::iterator Iterator;
285
286 //
287 // Check if it's the first command and whether the mapping of command is
288 // initialized or not
289 //
291 {
292 //
293 // Initialize the debugger
294 //
296
298 }
299
300 //
301 // Save the command into log open file
302 //
304 {
305 LogopenSaveToFile(Command);
306 LogopenSaveToFile("\n");
307 }
308
309 //
310 // Remove the comments
311 //
313
314 //
315 // Convert to string
316 //
317 string CommandString(Command);
318
319 // for test
320 // CommandParser parser;
321 // auto tokens1 = parser.parse(CommandString);
322
323 //
324 // Convert to lower case
325 //
326 transform(CommandString.begin(), CommandString.end(), CommandString.begin(), [](unsigned char c) { return std::tolower(c); });
327
328 vector<string> SplitCommand {Split(CommandString, ' ')};
329
330 //
331 // Check if user entered an empty input
332 //
333 if (SplitCommand.empty())
334 {
335 ShowMessages("\n");
336 return 0;
337 }
338
339 string FirstCommand = SplitCommand.front();
340
341 //
342 // Read the command's attributes
343 //
344 CommandAttributes = GetCommandAttributes(FirstCommand);
345
346 //
347 // Check if the command needs to be continued by pressing enter
348 //
349 if (CommandAttributes & DEBUGGER_COMMAND_ATTRIBUTE_REPEAT_ON_ENTER)
350 {
352 }
353 else
354 {
356 }
357
358 //
359 // Check and send remote command and also we check whether this
360 // is a command that should be handled in this command or we can
361 // send it to the remote computer, it is because in a remote connection
362 // still some of the commands should be handled in the local HyperDbg
363 //
366 {
367 //
368 // Check it here because generally, we use this variable in host
369 // for showing the correct signature but we won't try to block
370 // other commands, the only thing is events which is blocked
371 // by the remote computer itself
372 //
374 {
376 }
377
378 //
379 // It's a connection over network (VMI-Mode)
380 //
381 RemoteConnectionSendCommand(Command, (UINT32)strlen(Command) + 1);
382
383 ShowMessages("\n");
384
385 //
386 // Indicate that we sent the command to the target system
387 //
388 return 2;
389 }
391 !(CommandAttributes &
393 {
394 //
395 // It's a connection over serial (Debugger-Mode)
396 //
397
399 {
400 KdSendUserInputPacketToDebuggee(Command, (UINT32)strlen(Command) + 1, TRUE);
401
402 //
403 // Set the debuggee to show that it's running
404 //
406 }
407 else
408 {
409 //
410 // Disable the breakpoints and events while executing the command in the remote computer
411 //
413 KdSendUserInputPacketToDebuggee(Command, (UINT32)strlen(Command) + 1, FALSE);
415 }
416
417 //
418 // Indicate that we sent the command to the target system
419 //
420 return 2;
421 }
422
423 //
424 // Detect whether it's a .help command or not
425 //
426 if (!FirstCommand.compare(".help") || !FirstCommand.compare("help") ||
427 !FirstCommand.compare(".hh"))
428 {
429 if (SplitCommand.size() == 2)
430 {
431 //
432 // Show that it's a help command
433 //
434 HelpCommand = TRUE;
435 FirstCommand = SplitCommand.at(1);
436 }
437 else
438 {
439 ShowMessages("incorrect use of the '%s'\n", FirstCommand.c_str());
441 return 0;
442 }
443 }
444
445 //
446 // Start parsing commands
447 //
448 Iterator = g_CommandsList.find(FirstCommand);
449
450 if (Iterator == g_CommandsList.end())
451 {
452 //
453 // Command doesn't exist
454 //
455 string CaseSensitiveCommandString(Command);
456 vector<string> CaseSensitiveSplitCommand {Split(CaseSensitiveCommandString, ' ')};
457
458 if (!HelpCommand)
459 {
460 ShowMessages("err, couldn't resolve command at '%s'\n", CaseSensitiveSplitCommand.front().c_str());
461 }
462 else
463 {
464 ShowMessages("err, couldn't find the help for the command at '%s'\n",
465 CaseSensitiveSplitCommand.at(1).c_str());
466 }
467 }
468 else
469 {
470 if (HelpCommand)
471 {
472 Iterator->second.CommandHelpFunction();
473 }
474 else
475 {
476 //
477 // Check if command is case-sensitive or not
478 //
479 if ((Iterator->second.CommandAttrib &
481 {
482 string CaseSensitiveCommandString(Command);
483 Iterator->second.CommandFunction(SplitCommand, CaseSensitiveCommandString);
484 }
485 else
486 {
487 Iterator->second.CommandFunction(SplitCommand, CommandString);
488 }
489 }
490 }
491
492 //
493 // Save the command into log open file
494 //
496 {
497 LogopenSaveToFile("\n");
498 }
499
500 return 0;
501}
UCHAR BOOLEAN
Definition BasicTypes.h:39
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
@ TEST_BREAKPOINT_TURN_ON_BPS_AND_EVENTS_FOR_COMMANDS_IN_REMOTE_COMPUTER
Definition RequestStructures.h:319
@ TEST_BREAKPOINT_TURN_OFF_BPS_AND_EVENTS_FOR_COMMANDS_IN_REMOTE_COMPUTER
Definition RequestStructures.h:318
#define DEBUGGER_COMMAND_ATTRIBUTE_WONT_STOP_DEBUGGER_AGAIN
Definition commands.h:195
#define DEBUGGER_COMMAND_ATTRIBUTE_LOCAL_COMMAND_IN_DEBUGGER_MODE
Definition commands.h:191
#define DEBUGGER_COMMAND_ATTRIBUTE_REPEAT_ON_ENTER
Definition commands.h:194
#define DEBUGGER_COMMAND_ATTRIBUTE_LOCAL_COMMAND_IN_REMOTE_CONNECTION
Definition commands.h:192
#define DEBUGGER_COMMAND_ATTRIBUTE_LOCAL_CASE_SENSITIVE
Definition commands.h:193
const vector< string > Split(const string &s, const char &c)
general split command
Definition common.cpp:117
VOID CommandHelpHelp()
help of the help command :)
Definition help.cpp:22
BOOLEAN g_IsConnectedToRemoteDebuggee
Shows whether the current debugger is the host and connected to a remote debuggee (guest)
Definition globals.h:74
BOOLEAN g_LogOpened
Shows whether the '.logopen' command is executed and the log file is open or not.
Definition globals.h:478
BOOLEAN g_ShouldPreviousCommandBeContinued
Shows whether the previous command should be continued or not.
Definition globals.h:318
VOID InterpreterRemoveComments(char *CommandText)
Remove batch comments.
Definition interpreter.cpp:509
BOOLEAN g_IsCommandListInitialized
Is list of command initialized.
Definition globals.h:348
UINT64 GetCommandAttributes(const string &FirstCommand)
Get Command Attributes.
Definition interpreter.cpp:734
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
BOOLEAN g_BreakPrintingOutput
Shows whether the pause command or CTRL+C or CTRL+Break is executed or not.
Definition globals.h:499
VOID InitializeDebugger()
Initialize the debugger and adjust commands for the first run.
Definition interpreter.cpp:767
BOOLEAN g_ExecutingScript
Shows whether the target is executing a script form '.script' command or executing script by an argum...
Definition globals.h:492
CommandType g_CommandsList
List of command and attributes.
Definition globals.h:324
BOOLEAN KdSendUserInputPacketToDebuggee(const char *Sendbuf, int Len, BOOLEAN IgnoreBreakingAgain)
Sends user input packet to the debuggee.
Definition kd.cpp:1120
BOOLEAN KdSendTestQueryPacketToDebuggee(DEBUGGER_TEST_QUERY_STATE Type)
Send a test query request to the debuggee.
Definition kd.cpp:425
VOID KdSetStatusAndWaitForPause()
VOID LogopenSaveToFile(const char *Text)
Append text to the file object.
Definition logopen.cpp:119
int RemoteConnectionSendCommand(const char *sendbuf, int len)
send the command as a client (debugger, host) to the server (debuggee, guest)
Definition remote-connection.cpp:445

◆ HyperDbgLoadVmmModule()

INT HyperDbgLoadVmmModule ( )

load vmm module

Returns
int return zero if it was successful or non-zero if there
799{
800 BOOL Status;
801 HANDLE hToken;
802 char CpuId[13] = {0};
803
804 //
805 // Enable Debug privilege
806 //
807 Status = OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken);
808 if (!Status)
809 {
810 ShowMessages("err, OpenProcessToken failed (%x)\n", GetLastError());
811 return 1;
812 }
813
814 Status = SetPrivilege(hToken, SE_DEBUG_NAME, TRUE);
815 if (!Status)
816 {
817 CloseHandle(hToken);
818 return 1;
819 }
820
821 //
822 // Read the vendor string
823 //
824 CpuReadVendorString(CpuId);
825
826 ShowMessages("current processor vendor is : %s\n", CpuId);
827
828 if (strcmp(CpuId, "GenuineIntel") == 0)
829 {
830 ShowMessages("virtualization technology is vt-x\n");
831 }
832 else
833 {
834 ShowMessages("this program is not designed to run in a non-VT-x "
835 "environment !\n");
836 return 1;
837 }
838
840 {
841 ShowMessages("vmx operation is supported by your processor\n");
842 }
843 else
844 {
845 ShowMessages("vmx operation is not supported by your processor\n");
846 return 1;
847 }
848
849 //
850 // Create event to show if the hypervisor is loaded or not
851 //
852 g_IsDriverLoadedSuccessfully = CreateEvent(NULL, FALSE, FALSE, NULL);
853
855 {
856 //
857 // No need to handle anymore
858 //
859 CloseHandle(g_IsDriverLoadedSuccessfully);
860 return 1;
861 }
862
863 //
864 // Vmm module (Hypervisor) is loaded
865 //
866
867 //
868 // We wait for the first message from the kernel debugger to continue
869 //
870 WaitForSingleObject(
872 INFINITE);
873
874 //
875 // No need to handle anymore
876 //
877 CloseHandle(g_IsDriverLoadedSuccessfully);
878
879 //
880 // If we reach here so the module are loaded
881 //
883
884 ShowMessages("vmm module is running...\n");
885
886 return 0;
887}
int BOOL
Definition BasicTypes.h:23
BOOLEAN VmxSupportDetection()
Detect whether the VMX is supported or not.
Definition common.cpp:505
BOOL SetPrivilege(HANDLE Token, LPCTSTR Privilege, BOOL EnablePrivilege)
SetPrivilege enables/disables process token privilege.
Definition common.cpp:522
VOID CpuReadVendorString(CHAR *Result)
Reads the CPU vendor string.
Definition cpu.cpp:249
HANDLE g_IsDriverLoadedSuccessfully
Handle to show that if the debugger is loaded successfully.
Definition globals.h:130
BOOLEAN g_IsDebuggerModulesLoaded
this variable is used to indicate that modules are loaded so we make sure to later use a trace of loa...
Definition globals.h:356
INT HyperDbgCreateHandleFromVmmModule()
Create handle from VMM module.
Definition libhyperdbg.cpp:616

◆ HyperDbgShowSignature()

VOID HyperDbgShowSignature ( )

Show signature of HyperDbg.

Returns
VOID
567{
569 {
570 //
571 // Remote debugging over tcp (vmi-mode)
572 //
573 ShowMessages("[%s:%s] HyperDbg> ", g_ServerIp.c_str(), g_ServerPort.c_str());
574 }
576 {
577 //
578 // Debugging a special process
579 //
580 ShowMessages("%x:%x u%sHyperDbg> ",
584 }
586 {
587 //
588 // Remote debugging over serial (debugger-mode)
589 //
590 ShowMessages("%x: kHyperDbg> ", g_CurrentRemoteCore);
591 }
592 else
593 {
594 //
595 // Anything other than above scenarios including local debugging
596 // in vmi-mode
597 //
598 ShowMessages("HyperDbg> ");
599 }
600}
ULONG g_CurrentRemoteCore
Current core that the debuggee is debugging.
Definition globals.h:263
string g_ServerPort
In debugger (not debuggee), we save the port of server debuggee in this variable to use it later e....
Definition globals.h:110
ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
State of active debugging thread.
Definition globals.h:362
string g_ServerIp
In debugger (not debuggee), we save the port of server debuggee in this variable to use it later e....
Definition globals.h:117
UINT32 ProcessId
Definition ud.h:51
BOOLEAN IsActive
Definition ud.h:49
UINT32 ThreadId
Definition ud.h:52
BOOLEAN Is32Bit
Definition ud.h:56

◆ HyperDbgStopVmmDriver()

INT HyperDbgStopVmmDriver ( )

Stop VMM driver.

Returns
INT return zero if it was successful or non-zero if there was error
571{
573}
int HyperDbgStopDriver(LPCTSTR DriverName)
Stop the driver.
Definition libhyperdbg.cpp:548

◆ HyperDbgUninstallVmmDriver()

INT HyperDbgUninstallVmmDriver ( )

Remove the VMM driver.

Returns
INT return zero if it was successful or non-zero if there was error
605{
607}
int HyperDbgUninstallDriver(LPCTSTR DriverName)
Remove the driver.
Definition libhyperdbg.cpp:582

◆ HyperDbgUnloadVmm()

INT HyperDbgUnloadVmm ( )

Unload VMM driver.

Returns
INT return zero if it was successful or non-zero if there was error
694{
695 BOOL Status;
696
698
699 ShowMessages("start terminating...\n");
700
701 //
702 // Uninitialize the user debugger if it's initialized
703 //
705
706 //
707 // Send IOCTL to mark complete all IRP Pending
708 //
709 Status = DeviceIoControl(g_DeviceHandle, // Handle to device
710 IOCTL_TERMINATE_VMX, // IO Control Code (IOCTL)
711 NULL, // Input Buffer to driver.
712 0, // Length of input buffer in bytes. (x 2 is bcuz
713 // as the driver is x64 and has 64 bit values)
714 NULL, // Output Buffer from driver.
715 0, // Length of output buffer in bytes.
716 NULL, // Bytes placed in buffer.
717 NULL // synchronous call
718 );
719
720 //
721 // wait to make sure we don't use an invalid handle in another Ioctl
722 //
723 if (!Status)
724 {
725 ShowMessages("ioctl failed with code 0x%x\n", GetLastError());
726 return 1;
727 }
728
729 //
730 // Send IOCTL to mark complete all IRP Pending
731 //
732 Status = DeviceIoControl(
733 g_DeviceHandle, // Handle to device
735 // Control
736 // code
737 NULL, // Input Buffer to driver.
738 0, // Length of input buffer in bytes. (x 2 is bcuz as the
739 // driver is x64 and has 64 bit values)
740 NULL, // Output Buffer from driver.
741 0, // Length of output buffer in bytes.
742 NULL, // Bytes placed in buffer.
743 NULL // synchronous call
744 );
745
746 //
747 // wait to make sure we don't use an invalid handle in another Ioctl
748 //
749 if (!Status)
750 {
751 ShowMessages("ioctl failed with code 0x%x\n", GetLastError());
752 return 1;
753 }
754
755 //
756 // Indicate that the finish process start or not
757 //
759
760 Sleep(1000); // Wait so next thread can return from IRP Pending
761
762 //
763 // Send IRP_MJ_CLOSE to driver to terminate Vmxs
764 //
765 if (!CloseHandle(g_DeviceHandle))
766 {
767 ShowMessages("err, closing handle 0x%x\n", GetLastError());
768 return 1;
769 };
770
771 //
772 // Null the handle to indicate that the driver's device is not ready
773 // to use
774 //
776
777 //
778 // Debugger module is not loaded anymore
779 //
781
782 //
783 // Check if we found an already built symbol table
784 //
786
787 ShowMessages("you're not on HyperDbg's hypervisor anymore!\n");
788
789 return 0;
790}
#define IOCTL_RETURN_IRP_PENDING_PACKETS_AND_DISALLOW_IOCTL
ioctl, irp pending mechanism for reading from message tracing buffers
Definition Ioctls.h:71
#define IOCTL_TERMINATE_VMX
ioctl, to terminate vmx and exit form debugger
Definition Ioctls.h:78
VOID UdUninitializeUserDebugger()
uninitialize user debugger
Definition Ud.c:77
#define AssertShowMessageReturnStmt(expr, message, rc)
Definition common.h:51
#define AssertReturnOne
Definition common.h:23
#define ASSERT_MESSAGE_DRIVER_NOT_LOADED
Definition common.h:25
BOOLEAN SymbolDeleteSymTable()
Delete and free structures and variables related to the symbols.
Definition symbol.cpp:433

◆ ScriptReadFileAndExecuteCommandline()

INT ScriptReadFileAndExecuteCommandline ( INT argc,
CHAR * argv[] )

Parsing the command line options for scripts.

Parameters
argc
argv
Returns
INT
231{
232 vector<string> Args;
233
234 //
235 // Convert it to the array
236 //
237 for (size_t i = 2; i < argc; i++)
238 {
239 std::string TempStr(argv[i]);
240 Args.push_back(TempStr);
241 }
242
243 //
244 // Check if the target path and args for script is not empty
245 //
246 if (!Args.empty())
247 {
249 printf("\n");
250 }
251 else
252 {
253 printf("err, invalid command line options passed to the HyperDbg!\n");
254 return FALSE;
255 }
256
257 return TRUE;
258}
VOID HyperDbgScriptReadFileAndExecuteCommand(std::vector< std::string > &PathAndArgs)
Read file and run the script.
Definition script.cpp:113
char ** argv
Definition symbol-parser.h:46

◆ SetTextMessageCallback()

VOID SetTextMessageCallback ( PVOID Handler)

Set the function callback that will be called if any message needs to be shown.

Parameters
HandlerFunction that handles the messages
Returns
VOID
46{
47 g_MessageHandler = Handler;
48}
PVOID g_MessageHandler
The handler for ShowMessages function this is because the user might choose not to use printf and ins...
Definition globals.h:450

◆ SetTextMessageCallbackUsingSharedBuffer()

PVOID SetTextMessageCallbackUsingSharedBuffer ( PVOID Handler)

Set the function callback that will be called if any message needs to be shown.

Parameters
HandlerFunction that handles the messages
Returns
PVOID
59{
60 g_MessageHandler = Handler;
62
64 {
66 return NULL;
67 }
68
70
72}
#define TCP_END_OF_BUFFER_CHARS_COUNT
count of characters for tcp end of buffer
Definition Constants.h:440
#define COMMUNICATION_BUFFER_SIZE
Packet size for TCP connections.
Definition Constants.h:330
PVOID g_MessageHandlerSharedBuffer
The shared buffer for the handler of ShowMessages function.
Definition globals.h:456

◆ UnsetTextMessageCallback()

VOID UnsetTextMessageCallback ( )

Unset the function callback that will be called if any message needs to be shown.

Returns
VOID