Skip to content

Instantly share code, notes, and snippets.

@vanhoefm
Last active December 15, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanhoefm/5281979 to your computer and use it in GitHub Desktop.
Save vanhoefm/5281979 to your computer and use it in GitHub Desktop.
int __cdecl handle_plant_creation(int a1)
{
puts("Creating new plant..");
plantid = *(_DWORD *)(a1 + 5600);
plant_info = (char *)(a1 + 112 * plantid);
memset(plant_info, 0, 112);
ask_for_string((int)"Insert name: ", &entered_plant_name, 0x70u);
*((_WORD *)plant_info + 55) = plantid;
[..]
strcpy(plant_info, &entered_plant_name);
if ( check_secondary_elems_level(plant_info) ) {
puts("Error. One of the secondary element level is too high!");
} else if ( check_uranium_level(plant_info) ) {
puts("Error. Uranium level is too high!");
} else {
++*(_DWORD *)(plants_array + 5600);
printf("Plant %s created successfully!\n", plant_info);
}
return sprintf(&s, "DEBUG: %s is going down..", "shit");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment