Skip to content

Instantly share code, notes, and snippets.

@vanhoefm
Last active December 15, 2015 15:19
Show Gist options
  • Select an option

  • Save vanhoefm/5281095 to your computer and use it in GitHub Desktop.

Select an option

Save vanhoefm/5281095 to your computer and use it in GitHub Desktop.
int __cdecl handle_plant_creation(int a1)
{
[..]
plant_info = (char *)(a1 + 112 * plantid);
[..]
ask_for_string((int)"Insert name: ", &entered_plant_name, 0x70u);
*((_WORD *)plant_info + 55) = v9;
*((_WORD *)plant_info + 50) = gen_random_num(150, 500);
*((_WORD *)plant_info + 51) = gen_random_num(15, 100);
*((_WORD *)plant_info + 52) = gen_random_num(250, 800);
*((_WORD *)plant_info + 53) = gen_random_num(120, 900);
*((_WORD *)plant_info + 54) = gen_random_num(10, 600);
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!");
}
[..]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment