Пожалуйста, обратите внимание, что пользователь заблокирован
как составить список всех файлов в системе Windows, я могу перечислить файлы в определенном каталоге, но не во всей системе
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
void ListFilesRecursive(const TCHAR *dir) {
WIN32_FIND_DATA findFileData;
TCHAR searchPath[MAX_PATH];
HANDLE hFind;
_stprintf_s(searchPath, MAX_PATH, _T("%s\\*"), dir);
hFind = FindFirstFile(searchPath, &findFileData);
if (hFind != INVALID_HANDLE_VALUE) {
do {
if (!(findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
_tprintf(_T("%s\\%s\n"), dir, findFileData.cFileName);
}
else if (_tcscmp(findFileData.cFileName, _T(".")) != 0 && _tcscmp(findFileData.cFileName, _T("..")) != 0) {
_stprintf_s(searchPath, MAX_PATH, _T("%s\\%s"), dir, findFileData.cFileName);
ListFilesRecursive(searchPath);
}
} while (FindNextFile(hFind, &findFileData) != 0);
FindClose(hFind);
}
}
void ListFilesOnDrive(const TCHAR *drive) {
TCHAR root[MAX_PATH];
_stprintf_s(root, MAX_PATH, _T("%s:\\"), drive);
ListFilesRecursive(root);
}
void ListFilesOnAllDrives() {
DWORD drives = GetLogicalDrives();
TCHAR driveLetter[] = _T("A:");
while (drives) {
if (drives & 1) {
ListFilesOnDrive(driveLetter);
}
drives >>= 1;
++driveLetter[0];
}
}
int main() {
ListFilesOnAllDrives();
return 0;
}
там нужны суперпривелегииПомимо использования Windows API, связанного с файловыми операциями, есть парсинг NTFS файловой системы, а именно Master File Table.как составить список всех файлов в системе Windows, я могу перечислить файлы в определенном каталоге, но не во всей системе
Why does the kindergarten immediately climb into the Malware branch? We’ve read about millions on randoms, but we can’t write a recursive search for files or look at them somewhere.
>will it also display files on the desktop
- no, of course,you need superprivileges there
Iя просто спросил, тебе не обязательно быть засранцем