Emerson
September 10th, 2005, 15:00
I know I'll get hammered for asking this in this forum but I'll try my luck as I think I'll get more "artistic" responses here.
I'm trying to figure a way to way to enhance a simple script engine that I'm writing and I basicaly want a means of calling a proc when a certain memory address is hit.. I'll explain :-
Say I have a variable, pText, a pointer a string. I want to be able to some how force redirection when pText is assigned a new value.
mov 402000, eax (pText address = 402000)
When eax is written to 402000, I want to be redirected to a proc, say at 401000.
So, as an example, I could set the string to an edit control simply by writing a string pointer to an address (that is, the proc at 401000 would do it using SetWindowText API).
The actual line in my script looks like this (Somewhat VB looking)
Text1.Text = "Hello World !"
Now I'm sure someone will ask "If your parsing your own script why dont you simply place a call to the proc when compiling ?" Well, no good answer to that other than I this flash of inspiration that maybe I could some how automate some kind of Method calling mechanism.
I thought along the lines of maybe using mem addresses in a guarded page and catching the exception but its not available in all OS's (is it ?). What about installing a SEH and deliberatly causing an exception (bad programming practice ?). What about an interupt ? Again, sounds like bad programming ?!?
Thoughts anyone or is this simply a stupid idea ?
Anyway, sorry again for the somewhat unrelated reversing post but like I said, by the very nature of the subject, reversers have a more lateral approch to solving problems.
Thanks,
Emerson
I'm trying to figure a way to way to enhance a simple script engine that I'm writing and I basicaly want a means of calling a proc when a certain memory address is hit.. I'll explain :-
Say I have a variable, pText, a pointer a string. I want to be able to some how force redirection when pText is assigned a new value.
mov 402000, eax (pText address = 402000)
When eax is written to 402000, I want to be redirected to a proc, say at 401000.
So, as an example, I could set the string to an edit control simply by writing a string pointer to an address (that is, the proc at 401000 would do it using SetWindowText API).
The actual line in my script looks like this (Somewhat VB looking)
Text1.Text = "Hello World !"
Now I'm sure someone will ask "If your parsing your own script why dont you simply place a call to the proc when compiling ?" Well, no good answer to that other than I this flash of inspiration that maybe I could some how automate some kind of Method calling mechanism.
I thought along the lines of maybe using mem addresses in a guarded page and catching the exception but its not available in all OS's (is it ?). What about installing a SEH and deliberatly causing an exception (bad programming practice ?). What about an interupt ? Again, sounds like bad programming ?!?
Thoughts anyone or is this simply a stupid idea ?
Anyway, sorry again for the somewhat unrelated reversing post but like I said, by the very nature of the subject, reversers have a more lateral approch to solving problems.
Thanks,
Emerson