Jump to content
Tuts 4 You

Using WIN32 APIs


Nieylana

Recommended Posts

Last night I decided to try and see if it was possible to create a messagebox in VB6 without using the built in MsgBox function. I chose to do this because the MsgBox function actually calls rtcMessageBox() located in the MSVBVM DLL. I wanted my application to instead of using this function, use the MessageBox function located in USER32.DLL.

The Link below takes you to my source code on how i did it. It was done by executing some pre-compiled ASM that is executed from VB. In order to see what the ASM is doing, compile the program and debug it using Olly. Then place a BP on CallWindowProcA. Run the application, when it breaks... right click on ESP+4 (PrevProc) and select Follow in Disassembler, put a BP on the PUSHAD statement and Run the app. you can then step through the pre-compiled ASM and see how it works.

It is possible to make a MessageBox without using the VisualBasic VirtualMachine. And much faster.

I understand that you could have just declared MessageBoxW as a function and called it directly through VB, no need for ASM, but this is still relying on the VirtualMachine to call it, every WIN32 Function you call is sent through DLLFunctionCall() which is in the Virtual Machine.

http://www.mediafire.com/?20dn5w3xjja

Edited by Nieylana
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...