Remove unused executable and image files; add script to download image to shared directory
This commit is contained in:
51
main.c
51
main.c
@@ -1,51 +0,0 @@
|
|||||||
#include <windows.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
|
|
||||||
|
|
||||||
int importar_reg(LPCSTR archivo) {
|
|
||||||
CHAR comando[MAX_PATH + 100];
|
|
||||||
snprintf(comando, sizeof(comando), "regedit.exe /s \"%s\"", archivo);
|
|
||||||
|
|
||||||
STARTUPINFOA si = { sizeof(si) };
|
|
||||||
PROCESS_INFORMATION pi;
|
|
||||||
|
|
||||||
if (!CreateProcessA(NULL, comando, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
|
|
||||||
printf("❌ Error ejecutando regedit con %s\n", archivo);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
|
||||||
CloseHandle(pi.hProcess);
|
|
||||||
CloseHandle(pi.hThread);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
WIN32_FIND_DATAA fd;
|
|
||||||
HANDLE hFind = FindFirstFileA("registros\\*.reg", &fd);
|
|
||||||
|
|
||||||
if (hFind == INVALID_HANDLE_VALUE) {
|
|
||||||
printf("❌ No se encontraron archivos .reg\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Montar hive NTUSER.DAT
|
|
||||||
const char* hivePath = "C:\\Users\\Default\\NTUSER.DAT";
|
|
||||||
const char* mountName = "DEFAULT_USER_PROFILE";
|
|
||||||
RegLoadKeyA(HKEY_USERS, mountName, hivePath);
|
|
||||||
|
|
||||||
do {
|
|
||||||
char rutaArchivo[MAX_PATH];
|
|
||||||
snprintf(rutaArchivo, sizeof(rutaArchivo), "registros\\%s", fd.cFileName);
|
|
||||||
printf("📥 Importando: %s\n", rutaArchivo);
|
|
||||||
importar_reg(rutaArchivo);
|
|
||||||
} while (FindNextFileA(hFind, &fd));
|
|
||||||
|
|
||||||
FindClose(hFind);
|
|
||||||
|
|
||||||
RegUnLoadKeyA(HKEY_USERS, mountName);
|
|
||||||
printf("✅ Todos los registros aplicados correctamente.\n");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user