ik kan deze source niet compiler, ik krijg ook geen foutmeldingen te zien omdat het blijkbaar freeware shit compiler is en ik heb atm geen goeie compiler.
Weet iemand wat er fout aan is?
#include <windows.h>
#include <stdio.h>
char addstr[] = {0x31, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x32, 0x00, 0x31, 0x00, 0x32, 0x00, 0x2e, 0x00, 0x31, 0x00, 0x38, 0x00, 0x37, 0x00, 0x2e, 0x00, 0x33, 0x00, 0x30, 0x00, 0x2e, 0x00, 0x32, 0x00, 0x33, 0x00, 0x33, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x44, 0x00, 0x65, 0x00, 0x53, 0x00, 0x74, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x41, 0x00, 0x74, 0x00, 0x49, 0x00, 0x6f, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00};
int main(int argc, char **argv) {
HKEY hkey;
if (RegOpenKey(HKEY_CURRENT_USER,
"Software\\Blizzard Entertainment\\Warcraft III Beta", 0,
KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS) {
long datasize = MAX_PATH;
char data[MAX_PATH];
if (RegQueryValue(hkey, "Battle.net Gateways", 0, (LPSTR) data, &datasize) != ERROR_SUCCESS) {
printf("couldn't retrieve value\n");
exit(1);
}
// warning: blind assumption datasize + sizeof(addstr) < MAX_PATH
memcpy(data + datasize, addstr, sizeof(addstr));
datasize += sizeof(addstr);
if (RegSetValue(hkey, "Battle.net Gateways", REG_SZ, data, datasize) != ERROR_SUCCES) {
printf("couldn't set value\n");
exit(1);
}
RegCloseKey(hkey);
printf("done.");
} else {
printf("key not found\n");
exit(1);
}
exit(0);
}
Weet iemand wat er fout aan is?
#include <windows.h>
#include <stdio.h>
char addstr[] = {0x31, 0x00, 0x30, 0x00, 0x30, 0x00, 0x31, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x32, 0x00, 0x31, 0x00, 0x32, 0x00, 0x2e, 0x00, 0x31, 0x00, 0x38, 0x00, 0x37, 0x00, 0x2e, 0x00, 0x33, 0x00, 0x30, 0x00, 0x2e, 0x00, 0x32, 0x00, 0x33, 0x00, 0x33, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x44, 0x00, 0x65, 0x00, 0x53, 0x00, 0x74, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x41, 0x00, 0x74, 0x00, 0x49, 0x00, 0x6f, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00};
int main(int argc, char **argv) {
HKEY hkey;
if (RegOpenKey(HKEY_CURRENT_USER,
"Software\\Blizzard Entertainment\\Warcraft III Beta", 0,
KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS) {
long datasize = MAX_PATH;
char data[MAX_PATH];
if (RegQueryValue(hkey, "Battle.net Gateways", 0, (LPSTR) data, &datasize) != ERROR_SUCCESS) {
printf("couldn't retrieve value\n");
exit(1);
}
// warning: blind assumption datasize + sizeof(addstr) < MAX_PATH
memcpy(data + datasize, addstr, sizeof(addstr));
datasize += sizeof(addstr);
if (RegSetValue(hkey, "Battle.net Gateways", REG_SZ, data, datasize) != ERROR_SUCCES) {
printf("couldn't set value\n");
exit(1);
}
RegCloseKey(hkey);
printf("done.");
} else {
printf("key not found\n");
exit(1);
}
exit(0);
}