VB Decompiler Forum
 
 * Forums * Register * Reply * Search * Statistics *
VB decompiling Forum VB Decompiler Forum / VB decompiling Forum /

Patching - Get the VA?

Author Robert Vincent
Registered
#1 * Posted: 8 Jun 2011 18:55
Years ago (~1998) I wrote some software for a family member's business and they've been using it since then. I didn't keep the source code.

Unfortunately, and for reasons beyond me now, I included a check for the Windows version and exited if it wasn't a supported version. I don't know why I did it, but I did, and now it won't work on Windows 7 (or Vista). I *think* all I need to do is remove the exit, but I don't know how to do that. A friend of mine recommended your program and it seems to work (very impressive, BTW).

I've tracked down the exit to the return value of one dialog box.

Here is the decompilation with your program :

Private Sub Form_Unload(Cancel As Integer) '51B088
'Data Table: 41826C
If (global_52 = False) Then
loc_51B07E: Cancel = &HFF
loc_51B081: Beep
loc_51B086: Exit Sub
End If
loc_51B087: Exit Sub
End Sub

Essentially all I need to do (I think) is change that If (global_52 = False) or the Cancel = &HFF so the dialog doesn't return cancel.

I read the manual about patching but one thing escapes me - how can I find the Virtual Address of the byte(s) I need to change?

Thanks!

(I am registered and already sent this request in via email - just hoping a user might have some insight too)
Author Support
Admin
#2 * Posted: 9 Jun 2011 21:23 * Edited by: Support
At first please open menu "Options" and select in combobox "Decompile to mnemonics". Redecompile your program, you'l see a p-code language in your function. For example, I compile sample with your code and it may be processed to p-code as:

 
Private Sub Form_Unload(Cancel As Integer) '401834 
  'Data Table: 4012C4 
  loc_401820: ImpAdLdI2 MemVar_40201C 
  loc_401823: LitI2_Byte 0 
  loc_401825: EqI2 
  loc_401826: BranchF loc_401830 
  loc_401829: LitI2 255 
  loc_40182C: IStI2 Cancel 
  loc_40182F: ExitProcHresult 
  loc_401830: ' Referenced from: 401826 
  loc_401830: ExitProcHresult 
  loc_401831: ExitProcHresult 
  loc_401832: BranchFVar 
End Sub 



BranchF - is a jump, EqI2 - "if var_XX then. To fix your problem,
simply change BranchF to Branch (analog in assembler - jne to jmp).
BranchF - &h1С opcode, Branch is &h1E opcode. Simply open menu
"Tools", "Patch data", enter address with BranchF, 1E to "Data" field
and press "Set". It's all.

Thank you for using our software!
VB decompiling Forum VB Decompiler Forum / VB decompiling Forum / Patching - Get the VA? Top
Your Reply Click this icon to move up to the quoted message

» Username  » Password 
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.