#include #include int main(int argc, char** argv) { if (argc != 2) { printf("Usage: %s \n", argv[0]); return 1; } LONG st; HKEY hkey; do { st = RegLoadAppKeyA(argv[1], &hkey, KEY_ALL_ACCESS, 0, 0); if (st != ERROR_SUCCESS) { break; } printf("Hive successfully loaded\n"); for (ULONG i = 0; i < 507; i++) { WCHAR chSubKeyName[5]; chSubKeyName[0] = L'a'; chSubKeyName[1] = L'a' + (i / (26 * 26)); chSubKeyName[2] = L'a' + ((i / 26) % 26); chSubKeyName[3] = L'a' + (i % 26); chSubKeyName[4] = L'\0'; HKEY hsubkey; st = RegCreateKeyEx(hkey, chSubKeyName, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hsubkey, NULL); if (st != ERROR_SUCCESS) { goto error; } RegCloseKey(hsubkey); } printf("Subkeys successfully created\n"); RegCloseKey(hkey); } while (0); error: if (st != ERROR_SUCCESS) { printf("Call failed with error %d\n", st); } return 0; }