From bf5049db76e0f058df61cb70d8e46d40b5077b54 Mon Sep 17 00:00:00 2001 From: trickster0 Date: Sun, 13 Feb 2022 13:56:31 +0200 Subject: [PATCH] Init --- CReadMemory.sln | 31 +++++ CReadMemory/CReadMemory.cpp | 25 ++++ CReadMemory/CReadMemory.vcxproj | 147 ++++++++++++++++++++++++ CReadMemory/CReadMemory.vcxproj.filters | 22 ++++ CReadMemory/CReadMemory.vcxproj.user | 4 + 5 files changed, 229 insertions(+) create mode 100644 CReadMemory.sln create mode 100644 CReadMemory/CReadMemory.cpp create mode 100644 CReadMemory/CReadMemory.vcxproj create mode 100644 CReadMemory/CReadMemory.vcxproj.filters create mode 100644 CReadMemory/CReadMemory.vcxproj.user diff --git a/CReadMemory.sln b/CReadMemory.sln new file mode 100644 index 0000000..f72ad6e --- /dev/null +++ b/CReadMemory.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31729.503 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CReadMemory", "CReadMemory\CReadMemory.vcxproj", "{AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Debug|x64.ActiveCfg = Debug|x64 + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Debug|x64.Build.0 = Debug|x64 + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Debug|x86.ActiveCfg = Debug|Win32 + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Debug|x86.Build.0 = Debug|Win32 + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Release|x64.ActiveCfg = Release|x64 + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Release|x64.Build.0 = Release|x64 + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Release|x86.ActiveCfg = Release|Win32 + {AAA2B18B-61DE-40AD-8CB8-FC9EF87E76FD}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B0BCA7CA-4DF3-4650-80C4-332B66B0543E} + EndGlobalSection +EndGlobal diff --git a/CReadMemory/CReadMemory.cpp b/CReadMemory/CReadMemory.cpp new file mode 100644 index 0000000..a5e0d37 --- /dev/null +++ b/CReadMemory/CReadMemory.cpp @@ -0,0 +1,25 @@ +#include +#include + +using pRtlFirstEntrySList = DWORD(NTAPI*)(DWORD* pValue); + +DWORD ReadMemory() +{ + pRtlFirstEntrySList RtlFirstEntrySList = (pRtlFirstEntrySList)GetProcAddress(GetModuleHandleA("ntdll.dll"), "RtlFirstEntrySList"); + SIZE_T writtenBytes = 0; + WriteProcessMemory(GetCurrentProcess(), (char*)RtlFirstEntrySList + 4, "\x90\x90", 2, &writtenBytes); + printf("RtlFirstEntrySList address at : %p\n", RtlFirstEntrySList); + DWORD dwDataLength = 8; + DWORD returnValue = 0; + for (DWORD i = 0; i < dwDataLength; i++) + { + returnValue = RtlFirstEntrySList((DWORD*)((BYTE*)&RtlFirstEntrySList - 8 + i)); + printf("%x", (BYTE)returnValue); + } + return 0; +} + +int main() +{ + ReadMemory(); +} \ No newline at end of file diff --git a/CReadMemory/CReadMemory.vcxproj b/CReadMemory/CReadMemory.vcxproj new file mode 100644 index 0000000..2c547bc --- /dev/null +++ b/CReadMemory/CReadMemory.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {aaa2b18b-61de-40ad-8cb8-fc9ef87e76fd} + CReadMemory + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/CReadMemory/CReadMemory.vcxproj.filters b/CReadMemory/CReadMemory.vcxproj.filters new file mode 100644 index 0000000..42c332f --- /dev/null +++ b/CReadMemory/CReadMemory.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/CReadMemory/CReadMemory.vcxproj.user b/CReadMemory/CReadMemory.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/CReadMemory/CReadMemory.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file