|
1 | 1 | /* |
2 | | - * Copyright(C) 2022 Cyber Defense Institute, Inc. |
| 2 | + * Copyright(C) 2024 Cyber Defense Institute, Inc. |
3 | 3 | * |
4 | 4 | * This program/include file is free software; you can redistribute it and/or |
5 | 5 | * modify it under the terms of the GNU General Public License as published |
|
50 | 50 | using namespace std; |
51 | 51 |
|
52 | 52 | typedef FileInfo_t* (__cdecl *StealthOpenFile_func)(char*); |
53 | | -typedef int(__cdecl *StealthReadFile_func)(FileInfo_t*, BYTE*, DWORD, ULONGLONG, DWORD*, ULONGLONG*, ULONGLONG); |
| 53 | +typedef int(__cdecl *StealthReadFile_func)(FileInfo_t*, BYTE*, DWORD, ULONGLONG, DWORD*, ULONGLONG*, ULONGLONG, ULONGLONG); |
54 | 54 | typedef void(__cdecl *StealthCloseFile_func)(FileInfo_t*); |
55 | 55 |
|
56 | 56 | StealthOpenFile_func StealthOpenFile; |
@@ -334,6 +334,7 @@ int StealthGetFile(char *filepath, char *outpath, ostringstream *osslog = NULL, |
334 | 334 | }; |
335 | 335 |
|
336 | 336 | ULONGLONG filesize = (ULONGLONG)file->data->GetDataSize(); |
| 337 | + ULONGLONG initializedsize = (ULONGLONG)file->data->GetIniDataSize(); |
337 | 338 | WriteWrapper wfile(outpath, filesize); |
338 | 339 |
|
339 | 340 | SHA256_CTX sha256; |
@@ -384,7 +385,7 @@ int StealthGetFile(char *filepath, char *outpath, ostringstream *osslog = NULL, |
384 | 385 | do { |
385 | 386 | int ret; |
386 | 387 |
|
387 | | - if ((ret = StealthReadFile(file, buf, CHUNKSIZE, offset, &bytesread, &bytesleft, filesize)) != 0) { |
| 388 | + if ((ret = StealthReadFile(file, buf, CHUNKSIZE, offset, &bytesread, &bytesleft, filesize, initializedsize)) != 0) { |
388 | 389 | if (SparseSkip && strlen(filepath) > 3 && strcmp(&(filepath[2]), journalpath) == 0) { |
389 | 390 | filesize -= offset; |
390 | 391 | skipclusters = 0; |
@@ -433,7 +434,7 @@ int StealthGetFile(char *filepath, char *outpath, ostringstream *osslog = NULL, |
433 | 434 | else if (ret == 3) { |
434 | 435 | int adjustsize = CHUNKSIZE; |
435 | 436 | adjustsize -= BLOCKSIZE; |
436 | | - while (StealthReadFile(file, buf, adjustsize, offset, &bytesread, &bytesleft, filesize) == 3) |
| 437 | + while (StealthReadFile(file, buf, adjustsize, offset, &bytesread, &bytesleft, filesize, initializedsize) == 3) |
437 | 438 | adjustsize -= BLOCKSIZE; |
438 | 439 | } |
439 | 440 | else { |
@@ -1237,7 +1238,7 @@ int main(int argc, char **argv) |
1237 | 1238 |
|
1238 | 1239 | // chack proces name |
1239 | 1240 | procname = basename(string(argv[0])); |
1240 | | - cout << msg("CDIR Collector v1.3.6 - 初動対応用データ収集ツール", "CDIR Collector v1.3.6 - Data Acquisition Tool for First Response") << endl; |
| 1241 | + cout << msg("CDIR Collector v1.3.7 - 初動対応用データ収集ツール", "CDIR Collector v1.3.7 - Data Acquisition Tool for First Response") << endl; |
1241 | 1242 | cout << msg("Cyber Defense Institute, Inc.\n", "Cyber Defense Institute, Inc.\n") << endl; |
1242 | 1243 |
|
1243 | 1244 | // set curdir -> exedir |
|
0 commit comments