Posted June 12, 20169 yr Hello everyone, This challenge was written by naquadria in at4re forum: There is a file main.c contains this code: #include <windows.h> int iWinMain() { MessageBoxW(NULL, "PoC", "Hello!", MB_ICONINFORMATION); return 0; } 1- Is there a mistake in the code ? 2- Is it possible to build it ? Try to answer without testing it. One more thing... PM me your answer so others can have fun too, I'll post the answer after 3 days
June 12, 20169 yr it might compile, if you put 'iWinMain' as the EntryPoint. it will definitely compile if you compile it as a .lib
June 12, 20169 yr MessageBoxW requires wide chars, and you call it with ansi chars, so it wont work unless the default string type isn't set to wide chars. Its could be possible to build it, but the mesage box might contain unreadable content. Edited June 12, 20169 yr by A200K Spoiler
June 16, 20169 yr Author Time is up Well, if it was a cpp file "main.cpp" it won't compile... but here it's a c file, so it will compile with no problems. However, it will show a message with unreadable content as A200K indicated. Why so ? The unicode version of MessageBox function will treat the string as if it was in UTF-16 encoding which is not the case.
Create an account or sign in to comment