- Example with Qt 5.15.0
- Using MSVC and VS2019
- TODO: Add more details about configure
- TODO: jom notes.
Prerequisites:
configurePrerequisites:
| obj-m += afw.o | |
| afw-objs := afw_main.o locate_sct.o ttgl.o | |
| ccflags-y := -std=gnu99 -O2 | |
| all: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
| clean: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean | 
| // https://godbolt.org/z/5G3Ah3 | |
| // API: constexpr int const_strcmp( "foo", "bar" ); | |
| // Much more readable version here: https://gist.github.com/kaidokert/dfc08be8e75a3fc650d3daf8e89c3fe9 | |
| // but that doesn't work with GCC before version 7 | |
| #include <cstddef> | |
| #include <utility> | |
| namespace detail { | 
| /* Run as admin */ | |
| #include <Windows.h> | |
| #include <stdio.h> | |
| int main(void) | |
| { | |
| const HANDLE SharedSection = OpenFileMappingW(FILE_MAP_READ, | |
| FALSE, | |
| L"Global\\ToyDriverSharedSection"); | 
| // | |
| // Jacky Qwerty/29A compression algorithm, by Matt Mahoney | |
| // modified by odzhan | |
| // 2019-12-07 | |
| // | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <time.h> | 
| /* | |
| * run over the memory till find the sys call talbe | |
| * doing so, by searching the sys call close. | |
| */ | |
| unsigned long * obtain_syscall_table_bf(void) | |
| { | |
| unsigned long *syscall_table; | |
| unsigned long int i; | |
| for (i = (unsigned long int)sys_close; i < ULONG_MAX; | 
| #include <string> | |
| #include <vector> | |
| #include <fstream> | |
| #include <iostream> | |
| #include <filesystem> | |
| #include <Windows.h> | |
| #include <winternl.h> | |
| static_assert( sizeof( void* ) == 8 ); | 
| #include <wdm.h> | |
| __declspec(dllexport) | |
| __declspec(noinline) | |
| void* | |
| GetNtoskrnlBaseAddress() | |
| { | |
| // | |
| // From Windows Internals part 1, chapter 2: | |
| // | 
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*-" | |
| import dns.resolver | |
| myResolver = dns.resolver.Resolver() | |
| myResolver.nameservers = ['223.5.5.5', '223.6.6.6'] | |
| myAnswers = myResolver.query("www.baidu.com", "A") | |
| for rdata in myAnswers: | 
| /* | |
| -------- dllinjshim.cpp -------- | |
| > cl /Fe:dllinjshim.exe dllinjshim.cpp | |
| > dllinjshim.exe | |
| > sdbinst moo.sdb | |
| /!\ On Windows 10 there is a new function `SdbIsKnownShimDll` called | |
| in `SdbGetDllPath` which will check the DLL name against the following list: |