├── WinDNA
├── include
│ ├── triton_tainter.h
│ ├── addresses.h
│ ├── pch.h
│ └── internal_structures.h
├── src
│ ├── pch.cpp
│ ├── addresses.cpp
│ ├── internal_structures.cpp
│ ├── dllmain.cpp
│ └── triton_tainter.cpp
├── WinDNA.vcxproj.user
├── WinDNA.vcxproj.filters
└── WinDNA.vcxproj
├── .gitignore
└── WinDNA.sln
/WinDNA/include/triton_tainter.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Tainter
4 | {
5 | // Taints the instruction which is currently being executed by the vCpu.
6 | void HandleTaintInstruction(Internals::VirtualCpu* vCpu);
7 | }
--------------------------------------------------------------------------------
/WinDNA/src/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: source file corresponding to the pre-compiled header
2 |
3 | #include "pch.h"
4 |
5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
6 |
--------------------------------------------------------------------------------
/WinDNA/WinDNA.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | false
5 |
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
34 | .vs
35 |
36 | # visual studio specifics
37 | x64/
38 | Debug/
--------------------------------------------------------------------------------
/WinDNA/src/addresses.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 |
3 | namespace Addresses
4 | {
5 | void Initialize()
6 | {
7 | // Locate modules
8 | Modules::g_replay = (u64)GetModuleHandleA("TTDReplay.dll");
9 | Modules::g_replay_cpu = (u64)GetModuleHandleA("TTDReplayCPU.dll");
10 |
11 | // Locate functions. TODO: Pattern scan.
12 | Functions::g_register_instrumentation_callbacks = Modules::g_replay_cpu + 0x1540;
13 | Functions::g_read_cached_data_internal = Modules::g_replay_cpu + 0x4AD0;
14 | }
15 | }
--------------------------------------------------------------------------------
/WinDNA/src/internal_structures.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "internal_structures.h"
3 |
4 | namespace Internals
5 | {
6 | bool VirtualCpuHelper::ReadVirtualCpuMemory(VirtualCpu* vCpu, u64 addr, void* pDst, u64 dataSize)
7 | {
8 | if (VirtualCpuHelper::readCachedDataInternal == nullptr)
9 | VirtualCpuHelper::readCachedDataInternal = (f_ReadCachedDataInternal)Addresses::Functions::g_read_cached_data_internal;
10 |
11 | return VirtualCpuHelper::readCachedDataInternal(vCpu, addr, pDst, dataSize);
12 | }
13 | }
--------------------------------------------------------------------------------
/WinDNA/include/addresses.h:
--------------------------------------------------------------------------------
1 | // WinDbg related addresses which are resolved at runtime
2 | namespace Addresses
3 | {
4 | void Initialize();
5 |
6 | namespace Modules
7 | {
8 | // Base address of TTDReplay.dll.
9 | inline u64 g_replay;
10 |
11 | // Base address of TTDReplayCPU.dll
12 | inline u64 g_replay_cpu;
13 | }
14 |
15 | namespace Functions
16 | {
17 | inline u64 g_register_instrumentation_callbacks;
18 |
19 | // Address of VirtualCpu::ReadCachedDataInternal.
20 | inline u64 g_read_cached_data_internal;
21 | }
22 | }
--------------------------------------------------------------------------------
/WinDNA/include/pch.h:
--------------------------------------------------------------------------------
1 | // pch.h: This is a precompiled header file.
2 | // Files listed below are compiled only once, improving build performance for future builds.
3 | // This also affects IntelliSense performance, including code completion and many code browsing features.
4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds.
5 | #ifndef PCH_H
6 | #define PCH_H
7 |
8 | // Windows Header Files
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include