Comma-Club (Revenge)
One-Byte Overwrite over Function Pointer
Analysis
void __noreturn main_menu()
{
int v0; // [rsp+4h] [rbp-Ch]
unsigned __int64 i; // [rsp+8h] [rbp-8h]
puts("Welcome to the Wyoming Vote Tallying Software\nPresented by Jeff!");
while ( 1 )
{
while ( 1 )
{
v0 = menu(
"Please select an option:\n"
"1) Enter votes for a candidate\n"
"2) View current vote totals\n"
"3) Close voting and display the winner (requires password)\n"
"4) Change password (requires password)\n"
"> ",
"Incorrect value, try again\n> ",
5LL);
if ( v0 != 4 )
break;
if ( (unsigned int)check_password() )
set_new_password();
}
if ( v0 > 4 )
{
LABEL_18:
puts("This should be unreachable, so there's nothing here. Congrats for finding it though!");
}
else if ( v0 == 3 )
{
if ( (unsigned int)check_password() )
close_voting();
}
else
{
if ( v0 > 3 )
goto LABEL_18;
if ( v0 == 1 )
{
add_votes_menu();
}
else
{
if ( v0 != 2 )
goto LABEL_18;
for ( i = 0LL; i < num_cands; ++i )
{
print_status(cand_array + (i << 6));
puts(byte_3449);
}
}
}
}
}Last updated