|
-
Apr 4th, 2016, 02:07 PM
#1
Re: [vb6] AddressOf for Class, Form, UC methods
I think it won't work.
Firstly, why do you want to use the asm thunk? You can get address of a variable in the stack through VB.
Secondly, when a method is being called it puts some data on the stack (an error handler, temporary variables ect.). You can't know the address of the SomeMethod from the initMethod because you exactly don't know the number of variables on stack.
-
Apr 4th, 2016, 03:57 PM
#2
Junior Member
Re: [vb6] AddressOf for Class, Form, UC methods
Address of variable is not around method entry address. If you call initMethod() as the first call right below sub declaration, then you will have only few adresses in callstack and one of this is entry point of your method (few call address back). But as I said, I am not sure how VB uses callstack, it's only idea.
-
Apr 4th, 2016, 04:04 PM
#3
Re: [vb6] AddressOf for Class, Form, UC methods
 Originally Posted by izero76
Address of variable is not around method entry address.
You can pass a parameter to Init, and get its address. You can move relatively this address in order to get other data from the stack.
 Originally Posted by izero76
If you call initMethod() as the first call right below sub declaration, then you will have only few adresses in callstack and one of this is entry point of your method (few call address back).
Look here:

This is Form_Load handler. You can change something and it will be affected on the Form_Load code. Same for any other method.
-
Apr 4th, 2016, 04:43 PM
#4
Junior Member
Re: [vb6] AddressOf for Class, Form, UC methods
Sure, you are right, my mistake. And few bytes back from passed parameter's address we (probably) have entry point.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|