Log in

View Full Version : ASM EXPERTS> Some C++ to ASM help? Please? :)


x30n-
February 12th, 2001, 18:02
What would this C++ code, look like in ASM ?

----------------
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){

::EnumWindows(EnumWindowsProc, 0x0);
return 0x0;
}

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam){
::EnumChildWindows(hwnd, EnumChildProc, 0x0);
return TRUE;
}

BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam){
if(::SendMessage(hwnd, EM_GETPASSWORDCHAR, 0, 1)){
::SendMessage(hwnd, EM_SETPASSWORDCHAR, 0, 1);
::SendMessage(hwnd, EM_SETMODIFY, TRUE, 1);
::ShowWindow(hwnd, SW_HIDE);
::ShowWindow(hwnd, SW_SHOW);
}
return TRUE;
}
-----------------------
thanks everyone... :P

x30n-

CrackZ
February 12th, 2001, 19:37
Hiya,

I don't want to state the obvious here ;-), but here goes anyway. Why didn't you just take VC++ and compile it, then disassemble the result?.

btw - this example looks suspiciously familiar to the very first Hello World in Petzold's Programming for Windows book ;-).

Regards

CrackZ.

x30n-
February 12th, 2001, 20:10
cause i would like to see what this looks like in asm

i did not get this from a book. hehe.

goatass
February 12th, 2001, 20:47
like CrackZ said, compile the VC++ code you posted and disassemble it and you will see how it looks in ASM, it's as simple as that.

All that code is is the main function of your application, and it contains the message loop so when u start your program it calls WinMain and processes the events in the message loop.

I suggest you goto ht*tp://win32asm.cjb.net and look at the beginner tutorials there you will see this all thing in assembly.


goatass

Malkocoglu
February 15th, 2001, 01:40
Get VC++, make a project, In the project properties , select the Assembly Listing Option under C++/Category=Listing Files , there you have it... You dont have to dissassemble it...

IMHO this piece of code is not C++ , it is C...
Putting "::" in front of functions does not make it C++...

?ferret
February 15th, 2001, 20:26
You say "potato", I say "potato++"