VEH Handling (Danilo?)
Posted: Thu Nov 13, 2014 3:01 pm
I see that Danilo posted this code here:
http://www.forums.purebasic.com/english ... 12&t=49903
I see precious little about VEH and purebasic examples.
I need to take this a bit further. I have software that thousands of users use. Sometimes there are problems on their systems (some users) that are hard to track down, since I am not on their computer. It would be great to make a debugging program that can be used to get feedback from the users.
Specifically it would be a program that works as a debugger for ANOTHER program.
here are some core ideas for this program.
1) allows creation of VEH breakpoints of a running executable FROM the 'debugger' program.
2) allow dump of all registers (including xmm0 and floating point)
3) possible reroute if EIP/RIP register to a different address (i.e. debugger may reroute the flow of the program to codecave or .dll which has verified values for testing).
4) would have to be 'smart' to know which exceptions were user created and which are part of the normal program...
imagine the situation:
1) user runs our software
2) they claim the software crashes when they do so and so. info from crash tells us to try veh at certain location in program memory
3) we can give them offset from the program base (i.e. 0x400000 is base we would tell them to create exception at 0x401950)
4) they use an interface to enter 401950 breakpoint and the program stops there due to VEH, and then the program dumps a list of all the registers at that breakpointed spot.
5) possibly the debugger can then set EIP at that time to a different address which will move program flow to a code cave or .dll that has possible fix to try and get past crash.
I am very good at accessing other process, etc. and programming in general on purebasic. I have almost NO experience in breakpoints, exceptions, or VEH.
is something like this possible? rather than setting up VEH, displaying registers, and changing registers on the purebasic program itself, can this be easily done on another process FROM the purebasic program?
any help with this would be most appreciated. I really don't need a full blown program, just something that will help me to learn how to do this.
I can create a program that has an error on purpose to use for testing.
what the test program would have would be:
1) opens window
2) user presses button
3) division by 0 on purpose to crash program
4) exit button
then we can locate the address that has the bad divison and using VEH
1) breakpoint there
2) change register holding the 0 from 0 to 1
3) have program flow continue to get past
remember there would be a test program with the error, and then the 'debug' program which accesses the test program, sets up the VEH, changes the register, and then automatically resumes program flow.
do you think any of you can help with this? I am having trouble with the API and concepts involved here..
http://www.forums.purebasic.com/english ... 12&t=49903
I see precious little about VEH and purebasic examples.
I need to take this a bit further. I have software that thousands of users use. Sometimes there are problems on their systems (some users) that are hard to track down, since I am not on their computer. It would be great to make a debugging program that can be used to get feedback from the users.
Specifically it would be a program that works as a debugger for ANOTHER program.
here are some core ideas for this program.
1) allows creation of VEH breakpoints of a running executable FROM the 'debugger' program.
2) allow dump of all registers (including xmm0 and floating point)
3) possible reroute if EIP/RIP register to a different address (i.e. debugger may reroute the flow of the program to codecave or .dll which has verified values for testing).
4) would have to be 'smart' to know which exceptions were user created and which are part of the normal program...
imagine the situation:
1) user runs our software
2) they claim the software crashes when they do so and so. info from crash tells us to try veh at certain location in program memory
3) we can give them offset from the program base (i.e. 0x400000 is base we would tell them to create exception at 0x401950)
4) they use an interface to enter 401950 breakpoint and the program stops there due to VEH, and then the program dumps a list of all the registers at that breakpointed spot.
5) possibly the debugger can then set EIP at that time to a different address which will move program flow to a code cave or .dll that has possible fix to try and get past crash.
I am very good at accessing other process, etc. and programming in general on purebasic. I have almost NO experience in breakpoints, exceptions, or VEH.
is something like this possible? rather than setting up VEH, displaying registers, and changing registers on the purebasic program itself, can this be easily done on another process FROM the purebasic program?
any help with this would be most appreciated. I really don't need a full blown program, just something that will help me to learn how to do this.
I can create a program that has an error on purpose to use for testing.
what the test program would have would be:
1) opens window
2) user presses button
3) division by 0 on purpose to crash program
4) exit button
then we can locate the address that has the bad divison and using VEH
1) breakpoint there
2) change register holding the 0 from 0 to 1
3) have program flow continue to get past
remember there would be a test program with the error, and then the 'debug' program which accesses the test program, sets up the VEH, changes the register, and then automatically resumes program flow.
do you think any of you can help with this? I am having trouble with the API and concepts involved here..