For those who can't read the disgusting, weird and unreadable AT&T syntax, here is the clean Intel version:
Code:
cout << "Please enter your password: ";
00BE1220 mov eax,dword ptr [__imp_std::cout (0BE3088h)]
00BE1225 push offset string "Please enter your password: " (0BE31ACh)
00BE122A push eax
00BE122B call std::operator<<<std::char_traits<char> > (0BE18C0h)
cin >> password;
00BE1230 mov ecx,dword ptr [__imp_std::cin (0BE308Ch)]
00BE1236 push ecx
00BE1237 lea eax,[esp+18h]
00BE123B call std::operator>><char,std::char_traits<char>,std::allocator<char> > (0BE1B00h)
00BE1240 add esp,0Ch
if ( password == "1234" )
00BE1243 lea esi,[esp+0Ch]
00BE1247 call std::operator==<char,std::char_traits<char>,std::allocator<char> > (0BE1B20h)
00BE124C test al,al
00BE124E je main+50h (0BE1220h)
And what lies at esp+0Ch, pray tell? Why, it's the string "1234", according to a memory viewer.
Want to make it secure? Then encrypt the password "1234", then encrypt whatever the user inputs and then compare them.
This foils this approach.