Skip to content

Commit eee8e6e

Browse files
committed
Adapt Windows Process Name and Support Async MsgBox for WoW64 Injection
1 parent 9ae278d commit eee8e6e

22 files changed

Lines changed: 52 additions & 18 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

MonikaDLL/.vs/MonikaDLL/v17/.suo

-9 KB
Binary file not shown.
0 Bytes
Binary file not shown.

MonikaDLL/.vs/MonikaDLL/v17/DocumentLayout.backup.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"Version": 1,
33
"WorkspaceRootPath": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\",
44
"Documents": [
5+
{
6+
"AbsoluteMoniker": "D:0:0:{AE2845F2-E06C-49D4-85C0-36A962F50764}|MonikaDLL.vcxproj|C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectGalgame.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
7+
"RelativeMoniker": "D:0:0:{AE2845F2-E06C-49D4-85C0-36A962F50764}|MonikaDLL.vcxproj|solutionrelative:InjectGalgame.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
8+
},
59
{
610
"AbsoluteMoniker": "D:0:0:{AE2845F2-E06C-49D4-85C0-36A962F50764}|MonikaDLL.vcxproj|C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectX86Galgame.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
711
"RelativeMoniker": "D:0:0:{AE2845F2-E06C-49D4-85C0-36A962F50764}|MonikaDLL.vcxproj|solutionrelative:InjectX86Galgame.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
@@ -35,32 +39,43 @@
3539
{
3640
"$type": "Document",
3741
"DocumentIndex": 0,
42+
"Title": "InjectGalgame.cpp",
43+
"DocumentMoniker": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectGalgame.cpp",
44+
"RelativeDocumentMoniker": "InjectGalgame.cpp",
45+
"ToolTip": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectGalgame.cpp",
46+
"RelativeToolTip": "InjectGalgame.cpp",
47+
"ViewState": "AgIAABsAAAAAAAAAAAAAADIAAAABAAAAAAAAAA==",
48+
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
49+
"WhenOpened": "2024-11-07T08:54:12.487Z",
50+
"EditorCaption": ""
51+
},
52+
{
53+
"$type": "Document",
54+
"DocumentIndex": 1,
3855
"Title": "InjectX86Galgame.cpp",
3956
"DocumentMoniker": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectX86Galgame.cpp",
4057
"RelativeDocumentMoniker": "InjectX86Galgame.cpp",
4158
"ToolTip": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectX86Galgame.cpp",
4259
"RelativeToolTip": "InjectX86Galgame.cpp",
4360
"ViewState": "AgIAABUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
4461
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
45-
"WhenOpened": "2024-11-07T08:42:54.762Z",
46-
"EditorCaption": ""
62+
"WhenOpened": "2024-11-07T08:42:54.762Z"
4763
},
4864
{
4965
"$type": "Document",
50-
"DocumentIndex": 1,
66+
"DocumentIndex": 2,
5167
"Title": "InjectX64Galgame.cpp",
5268
"DocumentMoniker": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectX64Galgame.cpp",
5369
"RelativeDocumentMoniker": "InjectX64Galgame.cpp",
5470
"ToolTip": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectX64Galgame.cpp",
5571
"RelativeToolTip": "InjectX64Galgame.cpp",
5672
"ViewState": "AgIAAKIAAAAAAAAAAAAvwLIAAAAFAAAAAAAAAA==",
5773
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
58-
"WhenOpened": "2024-11-04T10:35:02.895Z",
59-
"EditorCaption": ""
74+
"WhenOpened": "2024-11-04T10:35:02.895Z"
6075
},
6176
{
6277
"$type": "Document",
63-
"DocumentIndex": 3,
78+
"DocumentIndex": 4,
6479
"Title": "ProcessGadgit.cpp",
6580
"DocumentMoniker": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\ProcessGadgit.cpp",
6681
"RelativeDocumentMoniker": "ProcessGadgit.cpp",
@@ -72,7 +87,7 @@
7287
},
7388
{
7489
"$type": "Document",
75-
"DocumentIndex": 4,
90+
"DocumentIndex": 5,
7691
"Title": "KernelWrapper.cpp",
7792
"DocumentMoniker": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\KernelWrapper.cpp",
7893
"RelativeDocumentMoniker": "KernelWrapper.cpp",
@@ -84,7 +99,7 @@
8499
},
85100
{
86101
"$type": "Document",
87-
"DocumentIndex": 2,
102+
"DocumentIndex": 3,
88103
"Title": "dllmain.cpp",
89104
"DocumentMoniker": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\dllmain.cpp",
90105
"RelativeDocumentMoniker": "dllmain.cpp",

MonikaDLL/.vs/MonikaDLL/v17/DocumentLayout.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"RelativeDocumentMoniker": "InjectGalgame.cpp",
4545
"ToolTip": "C:\\Users\\Administrator\\DDLC-MonikaInKernel\\MonikaDLL\\InjectGalgame.cpp",
4646
"RelativeToolTip": "InjectGalgame.cpp",
47-
"ViewState": "AgIAABsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
47+
"ViewState": "AgIAABsAAAAAAAAAAAAAADIAAAABAAAAAAAAAA==",
4848
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
4949
"WhenOpened": "2024-11-07T08:54:12.487Z",
5050
"EditorCaption": ""
@@ -59,8 +59,7 @@
5959
"RelativeToolTip": "InjectX86Galgame.cpp",
6060
"ViewState": "AgIAABUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
6161
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
62-
"WhenOpened": "2024-11-07T08:42:54.762Z",
63-
"EditorCaption": ""
62+
"WhenOpened": "2024-11-07T08:42:54.762Z"
6463
},
6564
{
6665
"$type": "Document",
@@ -72,8 +71,7 @@
7271
"RelativeToolTip": "InjectX64Galgame.cpp",
7372
"ViewState": "AgIAAKIAAAAAAAAAAAAvwLIAAAAFAAAAAAAAAA==",
7473
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
75-
"WhenOpened": "2024-11-04T10:35:02.895Z",
76-
"EditorCaption": ""
74+
"WhenOpened": "2024-11-04T10:35:02.895Z"
7775
},
7876
{
7977
"$type": "Document",

MonikaDLL/InjectX86Galgame.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ LPVOID InjectShellcode(HANDLE hProcess, UINT8 *buf, UINT64 bufsize);
1616
HWND GetTargetWindowHandleByPID(DWORD processId);
1717
void DrawImageOnWindow(HWND hwnd, const char* imageFile);
1818

19+
static HWND targetHwnd = NULL;
20+
static void displayMsgBoxOnTarget()
21+
{
22+
MessageBoxA(targetHwnd, "JUST Monika", "JUST Monika", MB_OK | MB_ICONWARNING);
23+
}
24+
1925
__declspec(dllexport) UINT8 injectX86Gal(char *targetEXE, const char *bmp_path)
2026
{
2127
// First Get the PID of the target process
@@ -28,7 +34,7 @@ __declspec(dllexport) UINT8 injectX86Gal(char *targetEXE, const char *bmp_path)
2834
printf("Target process \"%s\" found with PID %lu\n", targetEXE, processId);
2935

3036
// Get Hwnd of the target process
31-
HWND targetHwnd = GetTargetWindowHandleByPID(processId);
37+
targetHwnd = GetTargetWindowHandleByPID(processId);
3238
if (!targetHwnd)
3339
{
3440
printf("Failed to get target window handle\n");
@@ -39,7 +45,10 @@ __declspec(dllexport) UINT8 injectX86Gal(char *targetEXE, const char *bmp_path)
3945
DrawImageOnWindow(targetHwnd, bmp_path);
4046

4147
// Display MessageBoxA in the target process
42-
MessageBoxA(targetHwnd, "JUST Monika", "JUST Monika", MB_OK | MB_ICONWARNING);
48+
//MessageBoxA(targetHwnd, "JUST Monika", "JUST Monika", MB_OK | MB_ICONWARNING);
49+
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)displayMsgBoxOnTarget, NULL, 0, NULL);
50+
51+
return 0;
4352
}
4453

4554
}
352 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)