Ida Pro: Decompile To C !!install!!
int __cdecl sub_4012B0(char *input)
__int64 __fastcall sub_180001234(int a1, __int64 a2)
char hardcoded[] = "S3cr3tP@ss"; if ( strcmp(input, hardcoded) == 0 ) return puts("Success!"); else return puts("Fail."); ida pro decompile to c
if ( !*(_BYTE )(a2 + i) ) break; result = (unsigned __int8) (char *)(a2 + i);
Jump to the cross-reference (Xref) to strcmp . We land in sub_4012B0 . Trace to main (or WinMain )
Locate the start function from the entry point. Trace to main (or WinMain ). Use Ctrl+E to see entry points.
Find the password check function.
Manually refactor the C code in your mind or copy it to an editor. Hex-Rays cannot restructure arbitrary gotos into structured loops without risk of changing logic. 5.4. Missing Switch Statements A series of if (x == 1) ... else if (x == 2) might be a switch in the original source. IDA often recovers this, but sometimes fails if jump tables are non-linear.