Skip to content

Commit 0ea2de0

Browse files
author
4n6ist
committed
v1.3.1
1 parent 2012707 commit 0ea2de0

15 files changed

Lines changed: 284 additions & 68 deletions

File tree

CDIR/CDIR.cpp

Lines changed: 217 additions & 43 deletions
Large diffs are not rendered by default.

CDIR/CDIR.rc

0 Bytes
Binary file not shown.

CDIR/CDIR.vcxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -23,33 +23,33 @@
2323
<Keyword>Win32Proj</Keyword>
2424
<RootNamespace>CDIR</RootNamespace>
2525
<ProjectName>cdir-collector</ProjectName>
26-
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
26+
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>Application</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v140_xp</PlatformToolset>
32+
<PlatformToolset>v141</PlatformToolset>
3333
<CharacterSet>MultiByte</CharacterSet>
3434
<UseOfMfc>Static</UseOfMfc>
3535
</PropertyGroup>
3636
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3737
<ConfigurationType>Application</ConfigurationType>
3838
<UseDebugLibraries>false</UseDebugLibraries>
39-
<PlatformToolset>v140</PlatformToolset>
39+
<PlatformToolset>v141</PlatformToolset>
4040
<WholeProgramOptimization>true</WholeProgramOptimization>
4141
<CharacterSet>MultiByte</CharacterSet>
4242
</PropertyGroup>
4343
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4444
<ConfigurationType>Application</ConfigurationType>
4545
<UseDebugLibraries>true</UseDebugLibraries>
46-
<PlatformToolset>v140</PlatformToolset>
46+
<PlatformToolset>v141</PlatformToolset>
4747
<CharacterSet>MultiByte</CharacterSet>
4848
</PropertyGroup>
4949
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5050
<ConfigurationType>Application</ConfigurationType>
5151
<UseDebugLibraries>false</UseDebugLibraries>
52-
<PlatformToolset>v140</PlatformToolset>
52+
<PlatformToolset>v141</PlatformToolset>
5353
<WholeProgramOptimization>true</WholeProgramOptimization>
5454
<CharacterSet>MultiByte</CharacterSet>
5555
</PropertyGroup>

CDIR/ConfigParser.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ ConfigParser::ConfigParser(string path)
2222
string key = l.substr(0, idx);
2323
string val = l.substr(idx+1);
2424

25-
// trim string
25+
// trim key string
2626
key = trim(key);
27-
val = trim(val);
27+
2828
if (CONFIGLIST.find(key) != CONFIGLIST.end()) {
2929
Value value;
3030
value.type = CONFIGLIST[key];
3131
switch (CONFIGLIST[key]) {
3232
case TYPE_BOOL:
3333
value.ptr = new bool;
34+
val = trim(val);
3435
*((bool*)value.ptr) = [=]() {
3536
if (_stricmp("true", val.c_str()) == 0) {
3637
return true;
@@ -56,11 +57,13 @@ ConfigParser::ConfigParser(string path)
5657
break;
5758
case TYPE_INT:
5859
value.ptr = new int;
60+
val = trim(val);
5961
*((int*)value.ptr) = atoi(val.c_str());
6062
break;
6163
case TYPE_STRING:
6264
value.ptr = new string;
63-
*((string*)value.ptr) = val;
65+
for (idx = 0; idx < val.size() && isspace(val[idx]); idx++);
66+
*((string*)value.ptr) = val.substr(idx);
6467
break;
6568
}
6669
m[key] = value;

CDIR/ConfigParser.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ struct c_ignorecase:std::binary_function<string, string, bool> {
3232
static map<string, TYPE_ID, c_ignorecase> CONFIGLIST = {
3333
{"MemoryDump", TYPE_BOOL},
3434
{"MFT", TYPE_BOOL},
35+
{"Secure", TYPE_BOOL},
3536
{"UsnJrnl", TYPE_BOOL},
3637
{"EventLog", TYPE_BOOL},
3738
{"Prefetch", TYPE_BOOL},
3839
{"Registry", TYPE_BOOL},
40+
{"WMI", TYPE_BOOL},
41+
{"SRUM", TYPE_BOOL },
42+
{"Web", TYPE_BOOL },
3943
{"Output", TYPE_STRING},
40-
{"Web", TYPE_BOOL},
44+
{"Target", TYPE_STRING},
45+
{"MemoryDumpCmdline", TYPE_STRING},
4146
{"host", TYPE_STRING},
4247
{"port", TYPE_INT},
4348
{"path", TYPE_STRING}

CDIR/cdir.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
;MemoryDump = false
1+
;MemoryDump = true
22
MFT = true
3+
Secure = true
34
UsnJrnl = true
45
EventLog = true
56
Prefetch = true
67
Registry = true
8+
WMI = true
9+
SRUM = true
710
Web = true
11+
;Target = G:\
12+
;MemoryDumpCmdline = DumpIt.exe /Q /N /T DMP /O RAM.dmp
13+
;MemoryDumpCmdline = RamCapture64.exe RAM.raw
14+
;MemoryDumpCmdline = MagnetRAMCapture.exe /accepteula /go .\RAM.raw
815
;Output = E:\
916
;Output = \\hostname\sharename\
1.31 MB
Binary file not shown.
291 KB
Binary file not shown.
54.6 KB
Binary file not shown.

CDIR/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@ vector<pair<string, int>> findfiles(string filepath, bool error) {
142142
}
143143

144144
return paths;
145-
}
145+
}

0 commit comments

Comments
 (0)