├── .gitattributes
├── .gitignore
├── Documents
├── Hivelist.gif
├── SwishDbgExt.pdf
├── Windbg_Template.WEW
└── windbg_template.reg
├── LICENSE
├── README.md
├── SwishDbgExt.sln
└── SwishDbgExt
├── Azure.cpp
├── Azure.h
├── CNdiskd
├── CAdapters.cpp
├── CAdapters.h
├── CMinidriver.cpp
├── CMinidriver.h
├── CNdiskd.cpp
├── CNdiskd.h
├── COpenblock.cpp
├── COpenblock.h
├── CProtocols.cpp
├── CProtocols.h
├── CReport.cpp
├── CReport.h
├── utils.cpp
└── utils.h
├── Checks
├── Codecave.cpp
└── Codecave.h
├── Common.cpp
├── Common.h
├── Credentials.cpp
├── Credentials.h
├── DbgHelpEx.cpp
├── DbgHelpEx.h
├── Drivers.cpp
├── Drivers.h
├── EngExpCppEx.h
├── EngExtCppEx.cpp
├── Lxss.cpp
├── Lxss.h
├── Md5.cpp
├── Md5.h
├── Network.cpp
├── Network.h
├── NtDef.h
├── Objects.cpp
├── Objects.h
├── Output.cpp
├── Output.h
├── Process.cpp
├── Process.h
├── Registry.cpp
├── Registry.h
├── Security.cpp
├── Security.h
├── Storage.cpp
├── Storage.h
├── SwishDbgExt.cpp
├── SwishDbgExt.def
├── SwishDbgExt.h
├── SwishDbgExt.rc
├── SwishDbgExt.vcxproj
├── SwishDbgExt.vcxproj.filters
├── System.cpp
├── System.h
├── UntypedData.cpp
├── UntypedData.h
├── Version.rc
├── Version.txt
├── VirusTotal.cpp
├── VirusTotal.h
├── Yara.cpp
├── Yara.h
├── engextcpp.cpp
├── engextcpp.hpp
├── packages.config
├── resource.h
├── stdafx.cpp
├── stdafx.h
└── targetver.h
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | [Xx]64/
19 | [Xx]86/
20 | [Bb]uild/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 |
85 | # Visual Studio profiler
86 | *.psess
87 | *.vsp
88 | *.vspx
89 | *.sap
90 |
91 | # TFS 2012 Local Workspace
92 | $tf/
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 | *.DotSettings.user
101 |
102 | # JustCode is a .NET coding add-in
103 | .JustCode
104 |
105 | # TeamCity is a build add-in
106 | _TeamCity*
107 |
108 | # DotCover is a Code Coverage Tool
109 | *.dotCover
110 |
111 | # NCrunch
112 | _NCrunch_*
113 | .*crunch*.local.xml
114 | nCrunchTemp_*
115 |
116 | # MightyMoose
117 | *.mm.*
118 | AutoTest.Net/
119 |
120 | # Web workbench (sass)
121 | .sass-cache/
122 |
123 | # Installshield output folder
124 | [Ee]xpress/
125 |
126 | # DocProject is a documentation generator add-in
127 | DocProject/buildhelp/
128 | DocProject/Help/*.HxT
129 | DocProject/Help/*.HxC
130 | DocProject/Help/*.hhc
131 | DocProject/Help/*.hhk
132 | DocProject/Help/*.hhp
133 | DocProject/Help/Html2
134 | DocProject/Help/html
135 |
136 | # Click-Once directory
137 | publish/
138 |
139 | # Publish Web Output
140 | *.[Pp]ublish.xml
141 | *.azurePubxml
142 |
143 | # TODO: Un-comment the next line if you do not want to checkin
144 | # your web deploy settings because they may include unencrypted
145 | # passwords
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # NuGet Packages
150 | *.nupkg
151 | # The packages folder can be ignored because of Package Restore
152 | **/packages/*
153 | # except build/, which is used as an MSBuild target.
154 | !**/packages/build/
155 | # Uncomment if necessary however generally it will be regenerated when needed
156 | #!**/packages/repositories.config
157 | # NuGet v3's project.json files produces more ignoreable files
158 | *.nuget.props
159 | *.nuget.targets
160 |
161 | # Microsoft Azure Build Output
162 | csx/
163 | *.build.csdef
164 |
165 | # Microsoft Azure Emulator
166 | ecf/
167 | rcf/
168 |
169 | # Windows Store app package directory
170 | AppPackages/
171 | BundleArtifacts/
172 |
173 | # Visual Studio cache files
174 | # files ending in .cache can be ignored
175 | *.[Cc]ache
176 | # but keep track of directories ending in .cache
177 | !*.[Cc]ache/
178 |
179 | # Others
180 | ClientBin/
181 | [Ss]tyle[Cc]op.*
182 | ~$*
183 | *~
184 | *.dbmdl
185 | *.dbproj.schemaview
186 | *.pfx
187 | *.publishsettings
188 | node_modules/
189 | orleans.codegen.cs
190 |
191 | # RIA/Silverlight projects
192 | Generated_Code/
193 |
194 | # Backup & report files from converting an old project file
195 | # to a newer Visual Studio version. Backup files are not needed,
196 | # because we have git ;-)
197 | _UpgradeReport_Files/
198 | Backup*/
199 | UpgradeLog*.XML
200 | UpgradeLog*.htm
201 |
202 | # SQL Server files
203 | *.mdf
204 | *.ldf
205 |
206 | # Business Intelligence projects
207 | *.rdl.data
208 | *.bim.layout
209 | *.bim_*.settings
210 |
211 | # Microsoft Fakes
212 | FakesAssemblies/
213 |
214 | # GhostDoc plugin setting file
215 | *.GhostDoc.xml
216 |
217 | # Node.js Tools for Visual Studio
218 | .ntvs_analysis.dat
219 |
220 | # Visual Studio 6 build log
221 | *.plg
222 |
223 | # Visual Studio 6 workspace options file
224 | *.opt
225 |
226 | # Visual Studio LightSwitch build output
227 | **/*.HTMLClient/GeneratedArtifacts
228 | **/*.DesktopClient/GeneratedArtifacts
229 | **/*.DesktopClient/ModelManifest.xml
230 | **/*.Server/GeneratedArtifacts
231 | **/*.Server/ModelManifest.xml
232 | _Pvt_Extensions
233 |
234 | # LightSwitch generated files
235 | GeneratedArtifacts/
236 | ModelManifest.xml
237 |
238 | # Paket dependency manager
239 | .paket/paket.exe
240 |
241 | # FAKE - F# Make
242 | .fake/
243 |
--------------------------------------------------------------------------------
/Documents/Hivelist.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MagnetForensics/SwishDbgExt/bd3b324967bfcd0994abf9f45708982b3ebc9516/Documents/Hivelist.gif
--------------------------------------------------------------------------------
/Documents/SwishDbgExt.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MagnetForensics/SwishDbgExt/bd3b324967bfcd0994abf9f45708982b3ebc9516/Documents/SwishDbgExt.pdf
--------------------------------------------------------------------------------
/Documents/Windbg_Template.WEW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MagnetForensics/SwishDbgExt/bd3b324967bfcd0994abf9f45708982b3ebc9516/Documents/Windbg_Template.WEW
--------------------------------------------------------------------------------
/Documents/windbg_template.reg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MagnetForensics/SwishDbgExt/bd3b324967bfcd0994abf9f45708982b3ebc9516/Documents/windbg_template.reg
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #SwishDbgExt
2 | ===========
3 |
4 | SwishDbgExt is a Microsoft WinDbg debugging extension that expands the set of available commands by Microsoft WinDbg, but also fixes and improves existing commands.
5 | This extension has been developed by Matt Suiche (@msuiche) – feel free to reach out on support@comae.io ask for more features, offer to contribute and/or report bugs.
6 |
7 | SwishDbgExt aims at making life easier for kernel developers, troubleshooters and security experts with a series of debugging, incident response and memory forensics commands.
8 | Because SwishDbgExt is a WinDbg debugging extension, it means it can be used on local or remote kernel debugging session, live sessions generated by Microsoft LiveKd, but also on Microsoft crash dumps generated to a Blue Screen of Death or hybrid utilities such as Comae DumpIt.
9 |
10 | ## 2016 Contest
11 | More information on https://blog.comae.io/comae-2016-contest-swishdbgext-features-3c9a63c62209#.tnt1b9usx
12 |
13 | ## Installation
14 | You can either copy the WinDbg extension in the corresponding (x86 or x64) WinDbg folder or load it manually using the !load command such as below. Please note you can’t have spaces or quotes in the full path to the target dll to be loaded.
15 | `!load X:\FullPath\SwishDbgExt.dll`
16 |
17 | ###Example:
18 | ```
19 | kd> !load E:\projects\labs\SwishDbgExt\bin\x64\SwishDbgExt.dll;
20 | SwishDbgExt v0.7.0 (Nov 2 2016) - Incident Response & Digital Forensics Debugging Extension
21 | SwishDbgExt Copyright (C) 2016 Comae Technologies FZE - http://www.comae.io
22 | SwishDbgExt Copyright (C) 2014-2016 Matthieu Suiche (@msuiche)
23 |
24 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
25 | This is free software, and you are welcome to redistribute it
26 | under certain conditions; type `show c' for details.
27 | ```
28 |
29 | If you wish to update your WinDbg template with a more DML-friendly template, you can directly import windbg_template.reg file joined to the package.
30 |
31 | ## TODO
32 | - [ ] Define structures
33 | - [ ] Define Commands
34 | - [ ] Announce feature contest.
35 |
36 | ## Commands
37 | ### !SwishDbgExt.help
38 | Displays information on available extension commands.
39 |
40 | This command will give you the list of all commands if you specify no argument, will give you the list of parameters for an existing command if specified as an argument.
41 |
42 | ### !ms_callbacks
43 | Display callback functions
44 |
45 | ### !ms_checkcodecave
46 | Look for used code cave
47 |
48 | ### !ms_consoles
49 | Display console command's history
50 |
51 | ### !ms_credentials
52 | Display user's credentials (based on gentilwiki's mimikatz)
53 | ### !ms_drivers
54 | Display list of drivers.
55 | !ms_drivers will go ahead and display a list of drivers that are currently loaded.
56 | In this example, here’s a few of the drivers loaded at the time of the crash in this kernel-dump:
57 | With this command, we can also view in-depth IRP information regarding a driver:
58 | In the above image we can see the driver-specific I/O stack location within e1cexpress.sys’ IRP. Here we can see function codes such as IRP_MJ_CREATE which opens the target device object, indicating that it is present and available for I/O operations.
59 |
60 | ### !ms_dump
61 | Dump memory space on disk
62 |
63 | ### !ms_exqueue
64 | Display Ex queued workers.
65 |
66 | `!exqueue` doesn’t work properly on Windows 8, so a working version needed to be implemented. Just like the original command this one dispaly the working threads queue.
67 |
68 | ### !ms_fixit
69 | Reset segmentation in WinDbg (Fix "16.kd>")
70 |
71 | ### !ms_gdt
72 | Display GDT.
73 |
74 | !ms_gdt displays the Global Descriptor Table. Note on x64 that every selector is flat (0x0000000000000000 to 0xFFFFFFFFFFFFFFFF). This command can be extra helpful to check for any suspected hooking of the GDT, as attempting to do so on x64 will call a bug check. This is because x64 forbids hooking of the GDT.
75 |
76 | ### !ms_hivelist
77 | Display list of registry hives.
78 |
79 | `ms_hivelist` displays a list of registry hives.
80 | We can look directly into a hive (\Registry\Machine\Software for example) to see its subkeys, values, etc:
81 |
82 | 
83 |
84 | ### !ms_idt
85 | Display IDT.
86 |
87 | `!ms_idt` displays the Interrupt descriptor table. Very much like the GDT, if the IDT is hooked on an x64 system, it will call a bug check. This is due to the fact that Microsoft implemented (programmatically) a prevention of hooking the IDT with a kernel-mode driver that would normally intercept calls to the IDT and then add in its own processing. This is why in the above image, there is ‘No’ as far as the eye can see.
88 |
89 | ### !ms_malscore
90 | Analyze a memory space and returns a Malware Score Index (MSI) - (based on Frank Boldewin's work)
91 |
92 | ### !ms_mbr
93 | Scan Master Boot Record (MBR)
94 |
95 | ### !ms_netstat
96 | Display network information (sockets, connections, ...)
97 |
98 | ### !ms_object
99 | Display list of object
100 |
101 | ### !ms_process
102 | Display list of processes.
103 | `!ms_process` is an improved version of `!process` and `!dml_proc`..
104 | One of the nice thing as you can notice below is the usage of DML (Debugger Markup Language) with the commands. All the underline commands are in fact links to commands.
105 | As an example below, you can see the output of /vads /scan, to scan VAD (Virtual Address Descriptors). You can notice that one column gives the “Malware Score Index” which can be useful to detect shellcodes or heap-spray.
106 | In the screenshot below, you can see an abnormally high score in several VADs – due to usage of heap spray. Just by clicking on the score it will run the scanning algorithm.
107 | The scanning algorithm is based on Frank Boldewin’s OfficeMalScanner utility.
108 | And returns you information about where the shellcode is:
109 | `/scan` option can also be used on exported functions to know if the EAT (Export Address Table) has been patched or if the prolog of the function modified.
110 |
111 | Similar tests are available for the SSDT (`!ms_ssdt`).
112 |
113 | ### !ms_readkcb
114 | Read key control block
115 |
116 | ### !ms_readknode
117 | Read key node.
118 | `!reg` WinDbg command has been a frustration for a long time, due to some bugs. This is why SwishDbgExt, has its own registry explorer functions to try to make access to registry data as simple as possible.
119 |
120 | ### !ms_readkvalue
121 | Read key value
122 |
123 | ### !ms_scanndishook
124 | Scan and display suspicious NDIS hooks
125 |
126 | ### !ms_services
127 | Display list of services
128 |
129 | ### !ms_ssdt
130 | Display service descriptor table (SDT) functions.
131 | `!ms_ssdt` displays the System Service Dispatch Table. This command is extremely helpful in the investigation of suspected rootkit hooks through what is known as Direct Kernel Object Manipulation (DKOM). If you see a low level routine here that is hooked (such as nt!NtEnumerateKey), this can aid you in your analysis regarding a possible rootkit infection.
132 |
133 | ### !ms_store
134 | Display information related to the Store Manager (ReadyBoost).
135 |
136 | The present command allows to list the current ReadyBoost (requires USB 3.0) cache used by the Operating System, but also to display the logs of the memory pages managed by the store manager.
137 | Parameter: /cache
138 |
139 | ### !ms_timers
140 | Display list of KTIMER.
141 |
142 | !ms_timers displays the KTIMER structure, which is an opaque structure that represents and contains various timer objects. This command can be helpful to figure out what drivers created what timer objects, what drivers called what routines, etc.
143 |
144 | ### !ms_vacbs
145 | Display list of cached VACBs
146 |
147 | ### !ms_verbose
148 | Turn verbose mode on/off
149 |
150 | ### !ms_lxss
151 | The following is based on the research published by Alex Ionescu and available here: https://github.com/ionescu007/lxss/
152 |
153 | This feature is available on Windows 10+ O.S. as an optional feature installable via the following PowerShell command:
154 | ```
155 | Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
156 | ```
157 |
158 | You can read more about the Windows Subsystem for Linux at the following links:
159 | - https://blogs.msdn.microsoft.com/wsl/2016/04/22/windows-subsystem-for-linux-overview/
160 | - https://channel9.msdn.com/Blogs/Seth-Juarez/Windows-Subsystem-for-Linux-Architectural-Overview
161 | - https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
162 |
163 | ```
164 | Windows Subsystem for Linux Overview.
165 | Instance 0xFFFFE704EEB8F010
166 | GUID: {E29032FD-35D3-4C53-AB68-6BCEBDA7176F}
167 | State: (1) [STARTED]
168 | Creation Flags: 00000001
169 | GlobalData: 0xFFFFF802ED4138A0
170 | Root Handle: 80000834
171 | Temp Handle: 80000838
172 | Job Handle: 8000083c
173 | Token: 80000818
174 | Event Handle: 800008bc
175 |
176 | Map Paths (0): 0xFFFFE704EF437920
177 | VFS Context: 0xFFFFE704EEFC4710
178 | Memory Flags: 0x2
179 |
180 | Last PID: 35
181 | Thread Groups: 3
182 | Session 0xFFFFE704EDB79EC0
183 | Instance: 0xFFFFE704EEB8F010
184 | Console inode: 0x0
185 | Foreground PID: -1
186 | Process Group 0xFFFFE704EDB79AE0
187 | Instance: 0xFFFFE704EEB8F010
188 | Session: 0xFFFFE704EDB79EC0
189 | Thread Group 0xFFFFE704EF4F8000
190 | Binary Path: /init
191 | Thread(s): 1
192 | Owner Process Group: 0xFFFFE704EDB79AE0
193 | Flags: 0x00000000
194 | Main Thread: 0xFFFFE704EF5CC010
195 | Arguments (006 bytes): 0x00007FFFC081D6E0
196 | Process 0xFFFFE704EF2F1D70
197 | Instance: 0xFFFFE704EEB8F010
198 | NT Process Object: 0xFFFFAE05E84EF800
199 | NT Process Handle: 0xFFFFFFFF80000F58
200 | VDSO Address: 0x00007FFFC0849000
201 | Stack Address: 0x00007FFFC001E000
202 | Session 0xFFFFE704EF5DB830
203 | Instance: 0xFFFFE704EEB8F010
204 | Console inode: 0xFFFFE704EF32D7A0
205 | Foreground PID: 2
206 | Process Group 0xFFFFE704EF5EF970
207 | Instance: 0xFFFFE704EEB8F010
208 | Session: 0xFFFFE704EF5DB830
209 | Thread Group 0xFFFFE704EF5EE000
210 | Binary Path: /bin/bash
211 | Thread(s): 1
212 | Owner Process Group: 0xFFFFE704EF5EF970
213 | Flags: 0x0000000C
214 | Main Thread: 0xFFFFE704EF5F8010
215 | Arguments (010 bytes): 0x00007FFFDF34E418
216 | Process 0xFFFFE704EDEF6EC0
217 | Instance: 0xFFFFE704EEB8F010
218 | NT Process Object: 0xFFFFAE05E84E6800
219 | NT Process Handle: 0xFFFFFFFF80000D9C
220 | VDSO Address: 0x00007FFFDF883000
221 | Stack Address: 0x00007FFFDEB4F000
222 | Session 0xFFFFE704EF0A8ED0
223 | Instance: 0xFFFFE704EEB8F010
224 | Console inode: 0xFFFFE704EF06B9C0
225 | Foreground PID: 19
226 | Process Group 0xFFFFE704F059CBC0
227 | Instance: 0xFFFFE704EEB8F010
228 | Session: 0xFFFFE704EF0A8ED0
229 | Thread Group 0xFFFFE704EDE51000
230 | Binary Path: /bin/bash
231 | Thread(s): 1
232 | Owner Process Group: 0xFFFFE704F059CBC0
233 | Flags: 0x0000000C
234 | Main Thread: 0xFFFFE704EDC78090
235 | Arguments (010 bytes): 0x00007FFFF78CFB78
236 | Process 0xFFFFE704F06389B0
237 | Instance: 0xFFFFE704EEB8F010
238 | NT Process Object: 0xFFFFAE05E618D800
239 | NT Process Handle: 0xFFFFFFFF80001650
240 | VDSO Address: 0x00007FFFF7C99000
241 | Stack Address: 0x00007FFFF70D0000
242 | ```
243 |
244 | ### !ms_yarascan
245 |
246 | Scan a process memory with yara rules.
247 |
248 | Scan a process memory.
249 | ```
250 | !ms_yarascan /pid 0x228 /yarafile /yarafile C:\Rules.yar
251 | ```
252 |
253 | Scan all processes memory.
254 | ```
255 | !for_each_process "r? @$t0 = (nt!_EPROCESS *) @#Process; .process /r /p @$t0; !ms_yarascan /pid @@C++(@$t0->UniqueProcessId) /yarafile C:\\Rules.yar"
256 | ```
257 |
258 | ## Classes
259 | ### PEFile
260 | `MsPEImageFile` contains the basic common information used by Windows binaries (PE) and has been derivated into three different classes:
261 |
262 | - MsProcessObject
263 | - MsDllObject
264 | - MsDriverObject
265 |
--------------------------------------------------------------------------------
/SwishDbgExt.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SwishDbgExt", "SwishDbgExt\SwishDbgExt.vcxproj", "{3DEADBA0-BE78-43B7-A17A-027F185957E6}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Debug|x64.ActiveCfg = Debug|x64
17 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Debug|x64.Build.0 = Debug|x64
18 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Debug|x86.ActiveCfg = Debug|Win32
19 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Debug|x86.Build.0 = Debug|Win32
20 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Debug|x86.Deploy.0 = Debug|Win32
21 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Release|x64.ActiveCfg = Release|x64
22 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Release|x64.Build.0 = Release|x64
23 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Release|x86.ActiveCfg = Release|Win32
24 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Release|x86.Build.0 = Release|Win32
25 | {3DEADBA0-BE78-43B7-A17A-027F185957E6}.Release|x86.Deploy.0 = Release|Win32
26 | EndGlobalSection
27 | GlobalSection(SolutionProperties) = preSolution
28 | HideSolutionNode = FALSE
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/SwishDbgExt/Azure.cpp:
--------------------------------------------------------------------------------
1 | /*++
2 | Incident Response & Digital Forensics Debugging Extension
3 |
4 | Copyright (C) 2014 MoonSols Ltd.
5 | Copyright (C) 2014 Matthieu Suiche (@msuiche)
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 |
20 | Module Name:
21 |
22 | - Azure.cpp
23 |
24 | Abstract:
25 |
26 | - http://msdn.microsoft.com/en-us/windows/ff553536(v=vs.71).aspx
27 |
28 | Environment:
29 |
30 | - User mode
31 |
32 | Revision History:
33 |
34 | - Matthieu Suiche
35 |
36 | --*/
37 |
38 | //
39 | // HYPERV functions from MoonSols LiveCloudKd
40 | //
41 |
42 | #include "stdafx.h"
--------------------------------------------------------------------------------
/SwishDbgExt/Azure.h:
--------------------------------------------------------------------------------
1 | /*++
2 | Incident Response & Digital Forensics Debugging Extension
3 |
4 | Copyright (C) 2014 MoonSols Ltd.
5 | Copyright (C) 2014 Matthieu Suiche (@msuiche)
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see .
19 |
20 | Module Name:
21 |
22 | - Azure.h
23 |
24 | Abstract:
25 |
26 | - http://msdn.microsoft.com/en-us/windows/ff553536(v=vs.71).aspx
27 |
28 |
29 | Environment:
30 |
31 | - User mode
32 |
33 | Revision History:
34 |
35 | - Matthieu Suiche
36 |
37 | --*/
--------------------------------------------------------------------------------
/SwishDbgExt/CNdiskd/CAdapters.cpp:
--------------------------------------------------------------------------------
1 | /*++
2 | A NDIS hook scan extension to existing Incident Response & Digital Forensics Debugging Extension
3 |
4 | Copyright (C) 2014 wLcY (@x9090)
5 |
6 | This program is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | This program is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with this program. If not, see .
18 | --*/
19 |
20 | #include "stdafx.h"
21 | #include "CNdiskd.h"
22 |
23 | // CAdapters constructor
24 | CAdapters::CAdapters()
25 | {
26 | // Initialize handler function address
27 | m_ptrPacketIndicateHandler = 0;
28 | m_ptrSendCompleteHandler = 0;
29 | m_ptrResetCompleteHandler = 0;
30 | m_ptrStatusHandler = 0;
31 | m_ptrStatusCompleteHandler = 0;
32 | m_ptrWanSendCompleteHandler = 0;
33 | m_ptrWanRcvHandler = 0;
34 | m_ptrWanRcvCompleteHandler = 0;
35 | m_ptrSendNetBufferListsCompleteHandler = 0;
36 | // Initialize NDIS start and end address
37 | m_ndisStartAddr = 0;
38 | m_ndisEndAddr = 0;
39 | // Initialize minidriver start and end address
40 | m_minidrvStartAddr = 0;
41 | m_minidrvEndAddr = 0;
42 | // Initialize heap to store protocol's information
43 | m_adaptername = (PWSTR)malloc(MAX_ADAPTER_NAME*sizeof(WCHAR));
44 |
45 | }
46 |
47 | // CAdapters destructor
48 | CAdapters::~CAdapters()
49 | {
50 | // Cleanup
51 | free(m_adaptername);
52 |
53 | }
54 |
55 | VOID WINAPI CAdapters::SetAdapterName(PWSTR AdatperName)
56 | {
57 | StringCchCopyW(m_adaptername, MAX_ADAPTER_NAME, AdatperName);
58 | }
59 |
60 | PWSTR WINAPI CAdapters::GetAdapterName()
61 | {
62 | return m_adaptername;
63 | }
64 |
65 | BOOL WINAPI CAdapters::IsNdisFuncHandlerHooked(ULONG64 PtrHandler)
66 | {
67 | BOOL boolIsHooked = (PtrHandler < m_ndisStartAddr) && (PtrHandler > m_ndisEndAddr);
68 |
69 | if (boolIsHooked)
70 | return true;
71 | else
72 | return false;
73 | }
74 |
75 | std::map* WINAPI CAdapters::GetFunctionHandlers(std::map *PtrHandlers)
76 | {
77 | PtrHandlers->insert(std::make_pair("PacketIndicateHandler", m_ptrPacketIndicateHandler));
78 | PtrHandlers->insert(std::make_pair("ResetCompleteHandler", m_ptrResetCompleteHandler));
79 | PtrHandlers->insert(std::make_pair("WanRcvHandler", m_ptrWanRcvHandler));
80 | PtrHandlers->insert(std::make_pair("WanRcvCompleteHandler", m_ptrWanRcvCompleteHandler));
81 | PtrHandlers->insert(std::make_pair("WanSendCompleteHandler", m_ptrWanSendCompleteHandler));
82 | PtrHandlers->insert(std::make_pair("SendCompleteHandler", m_ptrSendCompleteHandler));
83 | PtrHandlers->insert(std::make_pair("SendNetBufferListsCompleteHandler", m_ptrSendNetBufferListsCompleteHandler));
84 | PtrHandlers->insert(std::make_pair("StatusCompleteHandler", m_ptrStatusCompleteHandler));
85 | PtrHandlers->insert(std::make_pair("StatusHandler", m_ptrStatusHandler));
86 |
87 | return PtrHandlers;
88 | }
--------------------------------------------------------------------------------
/SwishDbgExt/CNdiskd/CAdapters.h:
--------------------------------------------------------------------------------
1 | /*++
2 | A NDIS hook scan extension to existing Incident Response & Digital Forensics Debugging Extension
3 |
4 | Copyright (C) 2014 wLcY (@x9090)
5 |
6 | This program is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | This program is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with this program. If not, see .
18 | --*/
19 | #ifndef _CADAPTERS_H_
20 | #define _CADAPTERS_H_
21 |
22 | #define MAX_ADAPTER_NAME 500
23 |
24 | class CAdapters
25 | {
26 | public:
27 | CAdapters();
28 | ~CAdapters();
29 | BOOL WINAPI IsNdisFuncHandlerHooked(ULONG64);
30 | VOID WINAPI SetAdapterName(PWSTR);
31 | PWSTR WINAPI GetAdapterName();
32 | std::map* WINAPI GetFunctionHandlers(std::map*);
33 | ULONG64 m_ndisStartAddr;
34 | ULONG64 m_ndisEndAddr;
35 | ULONG64 m_minidrvStartAddr;
36 | ULONG64 m_minidrvEndAddr;
37 | // Only partial handler functions that are known to be targeted on NDIS library
38 | ULONG64 m_ptrPacketIndicateHandler;
39 | ULONG64 m_ptrSendCompleteHandler;
40 | ULONG64 m_ptrResetCompleteHandler;
41 | ULONG64 m_ptrStatusHandler;
42 | ULONG64 m_ptrStatusCompleteHandler;
43 | ULONG64 m_ptrWanSendCompleteHandler;
44 | ULONG64 m_ptrWanRcvHandler;
45 | ULONG64 m_ptrWanRcvCompleteHandler;
46 | ULONG64 m_ptrSendNetBufferListsCompleteHandler;
47 | private:
48 | PWSTR m_adaptername;
49 | };
50 |
51 | #endif // _CADAPTERS_H_
--------------------------------------------------------------------------------
/SwishDbgExt/CNdiskd/CMinidriver.cpp:
--------------------------------------------------------------------------------
1 | /*++
2 | A NDIS hook scan extension to existing Incident Response & Digital Forensics Debugging Extension
3 |
4 | Copyright (C) 2014 wLcY (@x9090)
5 |
6 | This program is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | This program is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with this program. If not, see .
18 | --*/
19 |
20 | #include "stdafx.h"
21 | #include "CNdiskd.h"
22 |
23 | // CMinidriver constructor
24 | CMinidriver::CMinidriver(ULONG64 MinidriverAddr)
25 | {
26 | // Initialize minidriver ptr
27 | m_minidrvaddr = MinidriverAddr;
28 |
29 | // Initialize handler function address
30 | m_ptrCheckForHangHandler = 0;
31 | m_ptrDisableInterruptHandler = 0;
32 | m_ptrEnableInterruptHandler = 0;
33 | m_ptrHaltHandler = 0;
34 | m_ptrHandleInterruptHandler = 0;
35 | m_ptrInitializeHandler = 0;
36 | m_ptrIsrHandler = 0;
37 | m_ptrQueryInformationHandler = 0;
38 | m_ptrReconfigureHandler = 0;
39 | m_ptrResetHandler = 0;
40 | m_ptrSendHandler = 0;
41 | m_ptrWanSendHandler = 0;
42 | m_ptrSetInformationHandler = 0;
43 | m_ptrTransferDataHandler = 0;
44 | m_ptrWanTransferDataHandler = 0;
45 | m_ptrReturnPacketHandler = 0;
46 | m_ptrSendPacketsHandler = 0;
47 | m_ptrAllocateCompleteHandler = 0;
48 | m_ptrCancelSendPacketsHandler = 0;
49 | m_ptrPnpEventNotifyHandler = 0;
50 | m_ptrAdapterShutdownHandler = 0;
51 |
52 | // Initialize mini-driver start and end address
53 | m_drvstartaddr = 0;
54 | m_drvendaddr = 0;
55 |
56 | // Initialize heap to store minidriver's name
57 | m_drivername = (PWSTR)malloc(MAX_MINIDRV_NAME*sizeof(WCHAR));
58 |
59 | }
60 |
61 | // CMinidriver destructor
62 | CMinidriver::~CMinidriver()
63 | {
64 | free(m_drivername);
65 | }
66 |
67 | PWSTR WINAPI CMinidriver::GetMDriverName()
68 | {
69 | ExtRemoteTyped miniDrv("(ndis!_NDIS_M_DRIVER_BLOCK*)@$extin", m_minidrvaddr);
70 |
71 | // NDIS6.X
72 | if (utils::IsVistaOrAbove())
73 | {
74 | WCHAR wDriverName[MAX_MINIDRV_NAME*sizeof(WCHAR)] = { 0 };
75 | ExtRemoteTyped minidrvName("(nt!_UNICODE_STRING*)@$extin", miniDrv.Field("ServiceName").m_Offset);
76 | utils::getUnicodeString(minidrvName, wDriverName, MAX_MINIDRV_NAME*sizeof(WCHAR));
77 |
78 | // ServiceName field might be empty
79 | // Get minidriver name from DriverObject->DriverName
80 | if (wcslen(wDriverName) == 0)
81 | {
82 |
83 | ULONG64 ptrMiniDrvObject = miniDrv.Field("DriverObject").GetPtr();
84 | ExtRemoteTyped miniDrvObject("(nt!_DRIVER_OBJECT*)@$extin", ptrMiniDrvObject);
85 |
86 | // Get minidriver name (eg: "\Driver\NdisWan")
87 | ExtRemoteTyped minidrvName2("(nt!_UNICODE_STRING*)@$extin", miniDrvObject.Field("DriverName").m_Offset);
88 | utils::getUnicodeString(minidrvName2, wDriverName, MAX_MINIDRV_NAME*sizeof(WCHAR));
89 | }
90 |
91 | // Get minidriver name
92 | PWSTR drvName = wcsrchr(wDriverName, L'\\');
93 |
94 | if (drvName != NULL)
95 | {
96 | StringCchCopyW(m_drivername, MAX_MINIDRV_NAME, drvName + 1);
97 | }
98 | else
99 | {
100 | StringCchCopyW(m_drivername, MAX_MINIDRV_NAME, wDriverName);
101 | }
102 | }
103 | // NDIS5.X
104 | else
105 | {
106 | ExtRemoteTyped minidrvInfo("(ndis!_NDIS_WRAPPER_HANDLE*)@$extin", miniDrv.Field("NdisDriverInfo").GetPtr());
107 | ExtRemoteTyped minidrvName("(nt!_UNICODE_STRING*)@$extin", minidrvInfo.Field("ServiceRegPath").m_Offset);
108 |
109 | // Get service registry path
110 | WCHAR wRegPath[MAX_MINIDRV_NAME*sizeof(WCHAR)] = { 0 };
111 | utils::getUnicodeString(minidrvName, wRegPath, MAX_MINIDRV_NAME*sizeof(WCHAR));
112 |
113 | // Get minidriver name
114 | PWSTR drvName = wcsrchr(wRegPath, L'\\');
115 |
116 | if (drvName != NULL)
117 | {
118 | StringCchCopyW(m_drivername, MAX_MINIDRV_NAME, drvName + 1);
119 | }
120 | else
121 | {
122 | StringCchCopyW(m_drivername, MAX_MINIDRV_NAME, wRegPath);
123 | }
124 |
125 | }
126 |
127 | return m_drivername;
128 | }
129 |
130 | BOOL WINAPI CMinidriver::IsHandlerHooked(ULONG64 PtrHandler)
131 | {
132 | BOOL boolIsHooked = (PtrHandler < m_drvstartaddr) && (m_drvendaddr > PtrHandler);
133 |
134 | if (boolIsHooked)
135 | return true;
136 | else
137 | return false;
138 | }
139 |
140 | ULONG64 WINAPI CMinidriver::GetDriverStartAddr()
141 | {
142 | ExtRemoteTyped miniDrv("(ndis!_NDIS_M_DRIVER_BLOCK*)@$extin", m_minidrvaddr);
143 | BOOLEAN Is64Bit = (g_Ext->m_Control->IsPointer64Bit() == S_OK) ? TRUE : FALSE;
144 | ExtRemoteTyped drvObj;
145 |
146 | // NDIS6.X
147 | if (utils::IsVistaOrAbove())
148 | {
149 | drvObj = ExtRemoteTyped("(nt!_DRIVER_OBJECT*)@$extin", miniDrv.Field("DriverObject").GetPtr());
150 | }
151 | // NDIS5.X
152 | else
153 | {
154 | ExtRemoteTyped minidrvInfo("(ndis!_NDIS_WRAPPER_HANDLE*)@$extin", miniDrv.Field("NdisDriverInfo").GetPtr());
155 | drvObj = ExtRemoteTyped("(nt!_DRIVER_OBJECT*)@$extin", minidrvInfo.Field("DriverObject").GetPtr());
156 | }
157 |
158 | m_drvstartaddr = Is64Bit ? drvObj.Field("DriverStart").GetUlong64() : drvObj.Field("DriverStart").GetUlong();
159 | return m_drvstartaddr;
160 | }
161 |
162 | ULONG64 WINAPI CMinidriver::GetDriverEndAddr()
163 | {
164 | return (m_drvendaddr = utils::getModuleSize(m_drvstartaddr) + m_drvstartaddr);
165 | }
166 |
167 | std::map* WINAPI CMinidriver::GetFunctionHandlers(std::map *PtrHandlers)
168 | {
169 | PtrHandlers->insert(std::make_pair("CheckForHangHandler", m_ptrCheckForHangHandler));
170 | PtrHandlers->insert(std::make_pair("DisableInterruptHandler", m_ptrDisableInterruptHandler));
171 | PtrHandlers->insert(std::make_pair("EnableInterruptHandler", m_ptrEnableInterruptHandler));
172 | PtrHandlers->insert(std::make_pair("HaltHandler", m_ptrHaltHandler));
173 | PtrHandlers->insert(std::make_pair("HandleInterruptHandler", m_ptrHandleInterruptHandler));
174 | PtrHandlers->insert(std::make_pair("InitializeHandler", m_ptrInitializeHandler));
175 | PtrHandlers->insert(std::make_pair("ISRHandler", m_ptrIsrHandler));
176 | PtrHandlers->insert(std::make_pair("QueryInformationHandler", m_ptrQueryInformationHandler));
177 | PtrHandlers->insert(std::make_pair("ReconfigureHandler", m_ptrReconfigureHandler));
178 | PtrHandlers->insert(std::make_pair("ResetHandler", m_ptrResetHandler));
179 | PtrHandlers->insert(std::make_pair("SendHandler", m_ptrSendHandler));
180 | PtrHandlers->insert(std::make_pair("WanSendHandler", m_ptrWanSendHandler));
181 | PtrHandlers->insert(std::make_pair("SetInformationHandler", m_ptrSetInformationHandler));
182 | PtrHandlers->insert(std::make_pair("TransferDataHandler", m_ptrTransferDataHandler));
183 | PtrHandlers->insert(std::make_pair("WanTransferDataHandler", m_ptrWanTransferDataHandler));
184 | PtrHandlers->insert(std::make_pair("ReturnPacketHandler", m_ptrReturnPacketHandler));
185 | PtrHandlers->insert(std::make_pair("SendPacketsHandler", m_ptrSendPacketsHandler));
186 | PtrHandlers->insert(std::make_pair("AllocateCompleteHandler", m_ptrAllocateCompleteHandler));
187 | PtrHandlers->insert(std::make_pair("CancelSendPacketsHandler", m_ptrCancelSendPacketsHandler));
188 | PtrHandlers->insert(std::make_pair("PnpEventNotifyHandler", m_ptrPnpEventNotifyHandler));
189 | PtrHandlers->insert(std::make_pair("AdapterShutdownHandler", m_ptrAdapterShutdownHandler));
190 |
191 | return PtrHandlers;
192 | }
--------------------------------------------------------------------------------
/SwishDbgExt/CNdiskd/CMinidriver.h:
--------------------------------------------------------------------------------
1 | /*++
2 | A NDIS hook scan extension to existing Incident Response & Digital Forensics Debugging Extension
3 |
4 | Copyright (C) 2014 wLcY (@x9090)
5 |
6 | This program is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | This program is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with this program. If not, see .
18 | --*/
19 |
20 | #ifndef _CMINIDRIVER_H_
21 | #define _CMINIDRIVER_H_
22 |
23 | #define MAX_MINIDRV_NAME 100
24 |
25 | class CMinidriver
26 | {
27 | public:
28 | CMinidriver(ULONG64);
29 | ~CMinidriver();
30 | BOOL WINAPI IsHandlerHooked(ULONG64);
31 | PWSTR WINAPI GetMDriverName();
32 | ULONG64 WINAPI GetDriverStartAddr();
33 | ULONG64 WINAPI GetDriverEndAddr();
34 | std::map* WINAPI GetFunctionHandlers(std::map*);
35 | ULONG64 m_minidrvaddr;
36 |
37 | // Only partial handler functions that are known to be targeted on Minidriver
38 | ULONG64 m_ptrCheckForHangHandler;
39 | ULONG64 m_ptrDisableInterruptHandler;
40 | ULONG64 m_ptrEnableInterruptHandler;
41 | ULONG64 m_ptrHaltHandler;
42 | ULONG64 m_ptrHandleInterruptHandler;
43 | ULONG64 m_ptrInitializeHandler;
44 | ULONG64 m_ptrIsrHandler;
45 | ULONG64 m_ptrQueryInformationHandler;
46 | ULONG64 m_ptrReconfigureHandler;
47 | ULONG64 m_ptrResetHandler;
48 | ULONG64 m_ptrSendHandler;
49 | ULONG64 m_ptrWanSendHandler;
50 | ULONG64 m_ptrSetInformationHandler;
51 | ULONG64 m_ptrTransferDataHandler;
52 | ULONG64 m_ptrWanTransferDataHandler;
53 | ULONG64 m_ptrReturnPacketHandler;
54 | ULONG64 m_ptrSendPacketsHandler;
55 | ULONG64 m_ptrAllocateCompleteHandler;
56 | ULONG64 m_ptrCancelSendPacketsHandler;
57 | ULONG64 m_ptrPnpEventNotifyHandler;
58 | ULONG64 m_ptrAdapterShutdownHandler;
59 | private:
60 | PWSTR m_drivername;
61 | ULONG64 m_drvstartaddr;
62 | ULONG64 m_drvendaddr;
63 | };
64 |
65 | #endif // _CMINIDRIVER_H_
--------------------------------------------------------------------------------
/SwishDbgExt/CNdiskd/CNdiskd.h:
--------------------------------------------------------------------------------
1 | /*++
2 | A NDIS hook scan extension to existing Incident Response & Digital Forensics Debugging Extension
3 |
4 | Copyright (C) 2014 wLcY (@x9090)
5 |
6 | This program is free software: you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation, either version 3 of the License, or
9 | (at your option) any later version.
10 |
11 | This program is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with this program. If not, see .
18 | --*/
19 |
20 | #ifndef _CNDISKD_H_
21 | #define _CNDISKD_H_
22 |
23 | #ifdef _DEBUG
24 | #define DBG 1
25 | #else
26 | #define DBG 0
27 | #endif
28 |
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include