Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
gmh5225 committed Nov 10, 2023
1 parent 6232ed4 commit fdf6258
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/crt/libwindrv.crt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ extern "C" int __cdecl dprintf(const char *format, ...)

extern "C" int __cdecl puts(const char *_Str)
{
char Temp[] = {'%', 's', 0};
char Temp[] = {117, 23, 0};
Temp[0] ^= 80;
Temp[1] ^= 100;
return printf(Temp, _Str);
}
10 changes: 5 additions & 5 deletions src/libwindrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ typedef struct _KLDR_DATA_TABLE_ENTRY_COMMON
PVOID PatchInformation;
} KLDR_DATA_TABLE_ENTRY_COMMON, *PKLDR_DATA_TABLE_ENTRY_COMMON;

PDRIVER_OBJECT LibWinDrvDriverObject = nullptr;
wchar_t LibWinDrvRegistryKey[_MAX_PATH];
wchar_t LibWinDrvServiceKeyName[_MAX_PATH];
PVOID LibWinDrvImageBase = nullptr;
SIZE_T LibWinDrvImageSize = 0;
extern "C" PDRIVER_OBJECT LibWinDrvDriverObject = nullptr;
extern "C" wchar_t LibWinDrvRegistryKey[_MAX_PATH];
extern "C" wchar_t LibWinDrvServiceKeyName[_MAX_PATH];
extern "C" PVOID LibWinDrvImageBase = nullptr;
extern "C" SIZE_T LibWinDrvImageSize = 0;

VOID
DriverUnload(__in DRIVER_OBJECT *DriverObject)
Expand Down
8 changes: 4 additions & 4 deletions test/testdrv1/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VOID
LibWinDrvDriverUnLoad(__in DRIVER_OBJECT *DriverObject)
{
UNREFERENCED_PARAMETER(DriverObject);
dprintf("world hello\n");
printf("world hello\n");
}

// ULONG_PTR g_addr = 0;
Expand Down Expand Up @@ -42,7 +42,7 @@ KCETBSOD()
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
dprintf("except in KCETBSOD\n");
printf("except in KCETBSOD\n");
}
}

Expand All @@ -53,14 +53,14 @@ LibWinDrvDriverEntry(__in DRIVER_OBJECT *DriverObject, __in UNICODE_STRING *Regi
UNREFERENCED_PARAMETER(DriverObject);
UNREFERENCED_PARAMETER(RegistryPath);

dprintf("hello world\n");
printf("hello world\n");
/*myfunc1((void *)myfunc2);
_asm {
nop
nop
nop
}
dprintf("hello world2\n");*/
printf("hello world2\n");*/
// KCETBSOD();

return STATUS_SUCCESS;
Expand Down

0 comments on commit fdf6258

Please sign in to comment.