diff --git a/.gitignore b/.gitignore
index b8bd026..9859b93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,19 @@
*.exe
*.out
*.app
+
+
+# VS stuff
+*.suo
+*.sdf
+*.user
+
+#other directories
+*/ipch/*
+*/Debug/*
+*/Release/*
+*/BuildTemp/*
+ipch/*
+Debug/*
+Release/*
+BuildTemp/*
diff --git a/Chapter10_ResponsiveHacks/Chapter10_ResponsiveHacks.vcxproj b/Chapter10_ResponsiveHacks/Chapter10_ResponsiveHacks.vcxproj
new file mode 100644
index 0000000..456c809
--- /dev/null
+++ b/Chapter10_ResponsiveHacks/Chapter10_ResponsiveHacks.vcxproj
@@ -0,0 +1,91 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {E28E3DC6-2614-43B9-83E4-86D6F9A585B1}
+ Win32Proj
+ Chapter10_ResponsiveHacks
+ Chapter10_ResponsiveHacks
+
+
+
+ Application
+ true
+ Unicode
+
+
+ Application
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(SolutionDir)\BuildTemp\$(Configuration)\
+
+
+ false
+ $(SolutionDir)\BuildTemp\$(ProjectName)_$(Configuration)\
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ 4Bytes
+
+
+ Console
+ true
+ false
+
+
+
+
+ Level3
+
+
+ Disabled
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ 4Bytes
+
+
+ Console
+ true
+ true
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Chapter10_ResponsiveHacks/main-responsiveHacks.cpp b/Chapter10_ResponsiveHacks/main-responsiveHacks.cpp
new file mode 100644
index 0000000..48415a9
--- /dev/null
+++ b/Chapter10_ResponsiveHacks/main-responsiveHacks.cpp
@@ -0,0 +1,118 @@
+#include
+#include
+#include
+
+// WARNING: if this code is killed mid-execute or you switch to another window (not the console)
+// while it's executing, it may cause the system to think a modifier key is stuck.
+// If this happens, you can tap shift, ctrl, and alt on the LEFT side of your keyboard to "unstick it"
+
+
+
+
+
+// SendInput() example code
+ void sendKeyWithSendInput(WORD key, bool up)
+ {
+ INPUT input = {0};
+ input.type = INPUT_KEYBOARD;
+ input.ki.wVk = key;
+ input.ki.dwFlags = 0;
+
+ if (up)
+ input.ki.dwFlags |= KEYEVENTF_KEYUP;
+ SendInput(1, &input, sizeof(input));
+ }
+
+ void sendModifiersWithSendInput(DWORD flags, bool up)
+ {
+ if (flags & 1)
+ sendKeyWithSendInput(VK_LSHIFT, up);
+ if (flags & 2)
+ sendKeyWithSendInput(VK_LCONTROL, up);
+ if (flags & 4)
+ sendKeyWithSendInput(VK_LMENU, up);
+ }
+
+ void sendCharWithSendInput(char letter)
+ {
+ SHORT keyFlags = VkKeyScanA(letter);
+
+ WORD key = keyFlags & 0xFF;
+ DWORD flags = (keyFlags >> 8) & 0xFF;
+
+ sendModifiersWithSendInput(flags, false);
+
+ sendKeyWithSendInput(key, false);
+ sendKeyWithSendInput(key, true);
+
+ sendModifiersWithSendInput(flags, true);
+ }
+
+ void typeStringWithSendInput(const char* string)
+ {
+ for (int i = 0; i < strlen(string); i++)
+ {
+ sendCharWithSendInput(string[i]);
+ Sleep(80);
+ }
+ }
+
+// SendMessage example code
+ void sendKeyWithSendMessage(HWND window, WORD key, char letter)
+ {
+ SendMessageA(window, WM_KEYDOWN, key, 0);
+ if (letter != 0)
+ SendMessageA(window, WM_CHAR, letter, 1);
+ SendMessageA(window, WM_KEYUP, key, 1);
+ }
+
+
+ void sendCharWithSendMessage(HWND window, char letter)
+ {
+ SHORT keyFlags = VkKeyScanA(letter);
+
+ WORD key = keyFlags & 0xFF;
+ DWORD flags = (keyFlags >> 8) & 0xFF;
+
+ sendKeyWithSendMessage(window, key, letter);
+ }
+
+ void typeStringWithSendMessage(HWND window, const char* string)
+ {
+ for (int i = 0; i < strlen(string); i++)
+ {
+ sendCharWithSendMessage(window, string[i]);
+ Sleep(80);
+ }
+ }
+
+
+
+
+DWORD WINAPI exampleThread(LPVOID lpParam)
+{
+ Sleep(500);
+ typeStringWithSendInput("Typing using SendInput()!\rHow does it look? :)\r\r");
+
+ auto window = FindWindowA(NULL, "Chapter10 Input Example");
+ typeStringWithSendMessage(window, "Typing using SendMessage()!\rEffectively the same, but more powerful :-)\r\r");
+
+ return 0;
+}
+
+
+int main(void)
+{
+ std::cout << "WARNING: Don't switch between windows until this application is done typing" << std::endl;
+ system("pause");
+ std::cout << "Everything below here is being programmatically typed using the keyboard" << std::endl << std::endl;
+
+ SetConsoleTitleA("Chapter10 Input Example");
+
+ CreateThread(NULL, 0, exampleThread, 0, 0, NULL);
+
+ char temp;
+ while (true) {
+ std::cin >> temp;
+ }
+}
\ No newline at end of file
diff --git a/Chapter4_CodeToMemory/Chapter4_CodeToMemory.filters b/Chapter4_CodeToMemory/Chapter4_CodeToMemory.filters
new file mode 100644
index 0000000..b449f95
--- /dev/null
+++ b/Chapter4_CodeToMemory/Chapter4_CodeToMemory.filters
@@ -0,0 +1,22 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hpp;hxx;hm;inl;inc;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/Chapter4_CodeToMemory/Chapter4_CodeToMemory.vcxproj b/Chapter4_CodeToMemory/Chapter4_CodeToMemory.vcxproj
new file mode 100644
index 0000000..b90f685
--- /dev/null
+++ b/Chapter4_CodeToMemory/Chapter4_CodeToMemory.vcxproj
@@ -0,0 +1,91 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {42D11C4C-AC06-47BD-B6CD-FC6DBAF54472}
+ Win32Proj
+ Chapter4_CodeToMemory
+ Chapter4_CodeToMemory
+
+
+
+ Application
+ true
+ Unicode
+
+
+ Application
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(SolutionDir)\BuildTemp\$(Configuration)\
+
+
+ false
+ $(SolutionDir)\BuildTemp\$(ProjectName)_$(Configuration)\
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ 4Bytes
+
+
+ Console
+ true
+ false
+
+
+
+
+ Level3
+
+
+ Disabled
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ 4Bytes
+
+
+ Console
+ true
+ true
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Chapter4_CodeToMemory/main-codeToMemory.cpp b/Chapter4_CodeToMemory/main-codeToMemory.cpp
new file mode 100644
index 0000000..9573d87
--- /dev/null
+++ b/Chapter4_CodeToMemory/main-codeToMemory.cpp
@@ -0,0 +1,159 @@
+#include
+#include
+
+/* numeric values */
+unsigned char ubyteValue = 0xFF;
+char byteValue = 0xFE;
+
+unsigned short uwordValue = 0x4142;
+short wordValue = 0x4344;
+
+unsigned int udwordValue = 0xDEADBEEF;
+int dwordValue = 0xDEADBEEF;
+
+unsigned long long ulongLongValue = 0xEFCDAB8967452301;
+long long longLongValue = 0xEFCDAB8967452301;
+
+float floatValue = 1337.7331;
+
+/* string values */
+char* thinStringP = "my_thin_terminated_value_pointer";
+char thinStringA[40] = "my_thin_terminated_value_array";
+wchar_t* wideStringP = L"my_wide_terminated_value_pointer";
+wchar_t wideStringA[40] = L"my_wide_terminated_value_array";
+
+/* structures */
+struct MyStruct {
+ unsigned char ubyteValue;
+ char byteValue;
+ unsigned short uwordValue;
+ short wordValue;
+ unsigned int udwordValue;
+ int dwordValue;
+ unsigned long long ulongLongValue;
+ char interruptor;
+ long long longLongValue;
+ float floatValue;
+};
+
+/* classes with no VF tables */
+class bar {
+public:
+ bar() : bar1(0x898989), bar2(0x10203040) {}
+ void myfunction() { bar1++; }
+ int bar1, bar2;
+};
+
+/* classes with VF tables */
+class foo {
+public:
+ foo() : myValue1(0xDEADBEEF), myValue2(0xBABABABA) {}
+ int myValue1;
+ static int myStaticValue;
+ virtual void bar() { printf("foo::bar()\n"); }
+ virtual void baz() { printf("foo::baz()\n"); }
+ virtual void barbaz() {}
+ int myValue2;
+};
+int foo::myStaticValue = 0x12121212;
+class fooa : public foo {
+public:
+ fooa() : foo() {}
+ virtual void bar() { printf("fooa::bar()\n"); }
+ virtual void baz() { printf("fooa::baz()\n"); }
+};
+class foob : public foo {
+public:
+ foob() : foo() { }
+ virtual void bar() { printf("foob::bar()\n"); }
+ virtual void baz() { printf("foob::baz()\n"); }
+};
+
+/* class protection */
+class baz {
+public:
+ baz() : baz1(0x11111111), baz2(0x22222222),
+ baz3(0x33333333), baz4(0x44444444) {}
+ int baz1, baz2;
+ void printStuff()
+ {
+ printf("0x%x : baz->baz1\n", &this->baz1);
+ printf("0x%x : baz->baz2\n", &this->baz2);
+ printf("0x%x : baz->baz3\n", &this->baz3);
+ printf("0x%x : baz->baz4\n", &this->baz4);
+ }
+private:
+ int baz3, baz4;
+};
+
+int main(void)
+{
+ /* just using global values so they don't get optimized away */
+ ubyteValue = ubyteValue;
+ byteValue = byteValue;
+ wordValue = wordValue;
+ uwordValue = uwordValue;
+ udwordValue = udwordValue;
+ dwordValue = dwordValue;
+ ulongLongValue = ulongLongValue;
+ longLongValue = longLongValue;
+ floatValue = floatValue;
+
+ thinStringP = thinStringP;
+ if (thinStringA){}
+ wideStringP = wideStringP;
+ if (wideStringA){}
+
+ /* printing addresses so we can easily find the dumps */
+ printf("0x%x : ubyteValue\n", &ubyteValue);
+ printf("0x%x : thinStringP\n", &thinStringP);
+
+ /* showing structure arrangement */
+ MyStruct* m = 0;
+ printf("Offsets: %d,%d,%d,%d,%d,%d,%d,%d,%d\n",
+ &m->ubyteValue, &m->byteValue,
+ &m->uwordValue, &m->wordValue,
+ &m->udwordValue, &m->dwordValue,
+ &m->ulongLongValue, &m->longLongValue,
+ &m->floatValue);
+
+ /* union stuff */
+ union {
+ BYTE byteValue;
+ struct {
+ WORD first;
+ WORD second;
+ } words;
+ DWORD value;
+ } dwValue;
+ dwValue.value = 0xDEADBEEF;
+ printf("Size %d; Addresses 0x%x,0x%x; Values 0x%x,0x%x\n",
+ sizeof(dwValue), &dwValue.value, &dwValue.words,
+ dwValue.words.first, dwValue.words.second);
+
+ /* classes with no VF tables */
+ bar _bar = bar();
+ printf("Size %d; Address 0x%x : _bar\n", sizeof(_bar), &_bar);
+
+ /* class VF call */
+ foo* _testfoo = (foo*)new fooa();
+ _testfoo->bar();
+
+ /* classes with VF tables */
+ foo _foo = foo();
+ fooa _fooa = fooa();
+ foob _foob = foob();
+ printf("0x%x : _foo\n", &_foo);
+ printf("0x%x : _fooa\n", &_fooa);
+ printf("0x%x : _foob\n", &_foob);
+
+ _foo.barbaz();
+ _fooa.bar();
+ _foob.baz();
+
+ /* class protection */
+ baz* _baz = 0;
+ _baz->printStuff();
+
+ system("pause");
+}
\ No newline at end of file
diff --git a/Chapter5_AdvancedMemoryForensics_Scanning/Chapter5_AdvancedMemoryForensics_Scanning.vcxproj b/Chapter5_AdvancedMemoryForensics_Scanning/Chapter5_AdvancedMemoryForensics_Scanning.vcxproj
new file mode 100644
index 0000000..9601dcd
--- /dev/null
+++ b/Chapter5_AdvancedMemoryForensics_Scanning/Chapter5_AdvancedMemoryForensics_Scanning.vcxproj
@@ -0,0 +1,90 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {6C658EF9-CCA4-4E18-8AD7-CEBDC04AB3AB}
+ Win32Proj
+ Chapter5_AdvancedMemoryForensics_Scanning
+
+
+
+ Application
+ true
+ Unicode
+
+
+ Application
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(SolutionDir)\BuildTemp\$(Configuration)\
+
+
+ false
+ $(SolutionDir)\BuildTemp\$(ProjectName)_$(Configuration)\
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ 4Bytes
+
+
+ Console
+ true
+ false
+
+
+
+
+ Level3
+
+
+ Disabled
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ 4Bytes
+
+
+ Console
+ false
+ true
+ true
+
+
+ false
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Chapter5_AdvancedMemoryForensics_Scanning/main-advancedMemoryForensics-Scanning.cpp b/Chapter5_AdvancedMemoryForensics_Scanning/main-advancedMemoryForensics-Scanning.cpp
new file mode 100644
index 0000000..c34cea7
--- /dev/null
+++ b/Chapter5_AdvancedMemoryForensics_Scanning/main-advancedMemoryForensics-Scanning.cpp
@@ -0,0 +1,169 @@
+#include
+#include
+#include
+#include
+#include