Skip to content

Instantly share code, notes, and snippets.

@IntriguingTiles
Created May 16, 2022 03:12
Show Gist options
  • Select an option

  • Save IntriguingTiles/c35e0a36692fa41a70d02af075b03d2b to your computer and use it in GitHub Desktop.

Select an option

Save IntriguingTiles/c35e0a36692fa41a70d02af075b03d2b to your computer and use it in GitHub Desktop.
Unlocks all levels in the Half-Life: Decay PC "port".
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main(int argc, char* argv[]) {
FILE* file;
fopen_s(&file, "save0.sv2", "rb");
if (!file) {
printf("You must run this next to \"save0.sv2\"!\n");
return -1;
}
fseek(file, 0, SEEK_END);
int size = ftell(file);
fseek(file, 0, SEEK_SET);
uint8_t* data = (uint8_t*)malloc(size + 1);
fread(data, size, 1, file);
fclose(file);
for (int i = 0xA3; i < size; i += 0x174) {
uint8_t b = data[i];
printf("0x%X\n", b);
data[i] = 0x0;
}
fopen_s(&file, "save0.sv2", "wb");
fwrite(data, size, 1, file);
fclose(file);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment