首页
论坛
课程
招聘
[已解决] 驱动源码编译不了 50.00雪花
2022-5-16 03:41 4111

[已解决] 驱动源码编译不了 50.00雪花

2022-5-16 03:41
4111

https://github.com/SDXT/MMInject/tree/7a68bfb11247dca0f1d8bc940e856ebf5f30f13f
下载了份源码 一打开全是错误
但我感觉这种类型的数据在内核开发里面没见过啊,谁知道什么回事.


[2022冬季班]《安卓高级研修班(网课)》月薪三万班招生中~

最后于 2022-5-16 03:53 被shuwoa编辑 ,原因:
收藏
点赞0
打赏
分享
最新回复 (2)
雪    币: 328
活跃值: 活跃值 (148)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
moyiah 活跃值 1 2022-5-16 22:57
2
0

按C++编译。可以用附件这个。具体怎么改了看git diff

diff --git a/MMInject/DynData.c b/MMInject/DynData.c
index c219cf7..2239e18 100644
--- a/MMInject/DynData.c
+++ b/MMInject/DynData.c
@@ -1,5 +1,5 @@
 #include "MMInject.h"
-#include "StringEncryptor.h
+#include "StringEncryptor.h"
 #include "Utils.h"
 
 ULONG_PTR NtoskrnlBase = 0;
@@ -10,7 +10,7 @@ static CONSTEXPR const UCHAR MiGetPdeAddressStartPattern[] = { 0x48, 0xC1, 0xE9,
 static CONSTEXPR const UCHAR CommonReturnPattern[] = { 0x48, 0x03, 0xC1, 0xC3 };
 
     DECLSPEC_NOINLINE
-    static
+    extern "C"
     ULONG_PTR
     FindPattern(
         _In_ ULONG_PTR Base,
@@ -20,14 +20,14 @@ static CONSTEXPR const UCHAR CommonReturnPattern[] = { 0x48, 0x03, 0xC1, 0xC3 };
         );
 
     DECLSPEC_NOINLINE
-    static
+    extern "C"
     ULONG_PTR
     BacktrackToFunctionStart(
         _In_ PUCHAR StartAddress,
         _In_ PUCHAR LowerBound
         );
 
-    static
+    extern "C"
     NTSTATUS
     FindNtoskrnl(
         _Out_ PULONG_PTR KernelBase,
diff --git a/MMInject/MMInject.c b/MMInject/MMInject.c
index e707191..a605327 100644
--- a/MMInject/MMInject.c
+++ b/MMInject/MMInject.c
@@ -4,7 +4,7 @@
 #include "BlackBone/Loader.h"
 #include "Utils.h"
 
-    static
+    extern "C"
     BOOLEAN
     NTAPI
     HandleEnumerationCallback(
@@ -16,7 +16,7 @@
         _In_ PVOID EnumParameter
         );
 
-    static
+    extern "C"
     NTSTATUS
     SetCSRSSWindowStation(
         _In_ PEPROCESS Process,
diff --git a/MMInject/MMInject.vcxproj b/MMInject/MMInject.vcxproj
index 68b4842..27c162b 100644
--- a/MMInject/MMInject.vcxproj
+++ b/MMInject/MMInject.vcxproj
@@ -471,6 +471,7 @@
       <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase />
@@ -482,6 +483,7 @@
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -503,6 +505,7 @@
       <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -514,6 +517,7 @@
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -535,6 +539,7 @@
       <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -547,6 +552,7 @@
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -568,6 +574,7 @@
       <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase />
@@ -579,6 +586,7 @@
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -600,6 +608,7 @@
       <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -611,6 +620,7 @@
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -632,6 +642,7 @@
       <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -644,6 +655,7 @@
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -668,6 +680,7 @@
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OmitFramePointers>true</OmitFramePointers>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase />
@@ -681,6 +694,7 @@
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -705,6 +719,7 @@
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OmitFramePointers>true</OmitFramePointers>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -720,6 +735,7 @@
       <GenerateMapFile>true</GenerateMapFile>
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -750,6 +766,7 @@
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -763,6 +780,7 @@
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -787,6 +805,7 @@
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ControlFlowGuard>false</ControlFlowGuard>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -801,6 +820,7 @@
       <GenerateMapFile>true</GenerateMapFile>
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -829,6 +849,7 @@
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OmitFramePointers>true</OmitFramePointers>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -843,6 +864,7 @@
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -867,6 +889,7 @@
       <AdditionalIncludeDirectories>$(ProjectDir);$(IntDir);$(ProjectDir)VMProtectDDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OmitFramePointers>true</OmitFramePointers>
       <ControlFlowGuard>false</ControlFlowGuard>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -882,6 +905,7 @@
       <GenerateMapFile>true</GenerateMapFile>
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -911,6 +935,7 @@
       <ControlFlowGuard>false</ControlFlowGuard>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase />
@@ -924,6 +949,7 @@
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -949,6 +975,7 @@
       <ControlFlowGuard>false</ControlFlowGuard>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -964,6 +991,7 @@
       <GenerateMapFile>true</GenerateMapFile>
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -995,6 +1023,7 @@
       <ControlFlowGuard>false</ControlFlowGuard>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -1008,6 +1037,7 @@
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
       <EntryPointSymbol>DriverEntry</EntryPointSymbol>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -1033,6 +1063,7 @@
       <ControlFlowGuard>false</ControlFlowGuard>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -1047,6 +1078,7 @@
       <GenerateMapFile>true</GenerateMapFile>
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -1076,6 +1108,7 @@
       <ControlFlowGuard>false</ControlFlowGuard>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -1090,6 +1123,7 @@
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <AdditionalDependencies>%(AdditionalDependencies);$(KernelBufferOverflowLib);ntoskrnl.lib;hal.lib;cng.lib;wmilib.lib;</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
@@ -1115,6 +1149,7 @@
       <ControlFlowGuard>false</ControlFlowGuard>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <OmitFramePointers>true</OmitFramePointers>
+      <CompileAs>CompileAsCpp</CompileAs>
     </ClCompile>
     <Link>
       <ProfileGuidedDatabase>
@@ -1130,6 +1165,7 @@
       <GenerateMapFile>true</GenerateMapFile>
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
+      <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
diff --git a/MMInject/main.c b/MMInject/main.c
index 5dd5f10..f4eb333 100644
--- a/MMInject/main.c
+++ b/MMInject/main.c
@@ -1,6 +1,6 @@
 #include "MMInject.h"
-#include "util.h"
-#include "strings.h"
+#include "utils.h"
+#include "stringencryptor.h"
 #include <stdarg.h>
 #include <stdio.h>
 
@@ -32,30 +32,30 @@ private:
     WCHAR DllPathBuffer[MAX_PATH];
 } INJECT_DLL_PARAMS, *PINJECT_DLL_PARAMS;
 
-static
+extern "C"
 BOOLEAN
 IsDriverExpired(
     );
 
-static
+extern "C"
 BOOLEAN
 DeletePiDDBCacheTableEntry(
     _In_ PUNICODE_STRING DriverFileName,
     _In_opt_ ULONG DriverTimeDateStamp
     );
 
-static
+extern "C"
 VOID
 CleanMmUnloadedDrivers(
     );
 
-static
+extern "C"
 BOOLEAN
 DestroyDriverFile(
     _In_ PDRIVER_OBJECT DriverObject
     );
 
-static
+extern "C"
 BOOLEAN
 DestroyDriverInformation(
     _In_ PDRIVER_OBJECT DriverObject
@@ -219,6 +219,7 @@ InitDynamicData(
         : STATUS_INVALID_KERNEL_INFO_VERSION;
 }
 
+
 static
 BOOLEAN
 IsDriverExpired(
最后于 2022-5-16 23:02 被moyiah编辑 ,原因:
上传的附件:
雪    币: 22
活跃值: 活跃值 (943)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
shuwoa 活跃值 2022-5-19 07:25
3
0
moyiah 按C++编译。可以用附件这个。具体怎么改了看git diffdiff&nbsp;--git&nbsp;a/MMInject/DynData.c&nbsp;b/MMInject/ ...
确实可以编译,我还没空去看,请直接告诉我是修改了那些的配置?
游客
登录 | 注册 方可回帖
返回