• Welcome to Valhalla Legends Archive.
 

Visual Basic + ASM

Started by TheMinistered, June 01, 2003, 08:54 PM

Previous topic - Next topic

TheMinistered

I know a couple methods that allow you to implement assembly (machine code) into visual basic!  I know that some, but not all, of the methods that I've picked up might, in the future, stop working if microsoft drops support for certain functions.

So, back to the original intent of this thread.  I would be pleased if you guys could post the various methods you have picked up that allow you to implement assembly (machine code) in visual basic.

Here are my methods:
1) Create something that is similar to a window's procedure and use CallWindowProc, found in the win32 api.  However, if microsoft drops support for this function your application(s) could suddenly fail!

I know a few other methods, but I don't have time to post them now!  I will post them later tonight or tomorrow morning.

TheMinistered

As promised, here is another method that I've picked up!

2)  Replace Virtual Table entries of class factory interface with pointers to pre-allocated memory blocks that contain our machine code.  This isn't the fastest way, but it works in both IDE and EXE, P-Code and N-Code.  You shouldn't have to worry about this method causing your application to suddenly fail.

Banana fanna fo fanna

Could also ref a DLL in a different language ;)

indulgence

Hook the IDE so when it stops when the compiler calls C2.EXE (Second pass c linker)...

This will result in you having the beautiful (not really) object files that the compiler produces which you can edit and add psuedo-inline assembly... you could sure remove those ugly vbaXXXXXXX calls for mundane things such as vbaVarAdd -- ooooogly and bloated!

Although, if you're going through this much trouble for using ASM in vb, its almost pointless...
<3