Log in

View Full Version : vb p-code patching


NikDH
January 24th, 2001, 09:46
I'm working in a prog that has vb p-code inside
Its protection consists of disabling some voices of the menu and i wanna enable them
Coz its a vb prog cant read the resources using a resource viewer but i dont think thats a great mess coz i think the menu voices r disabled by some calls to EnableMenuItem()
The problem comes out when i find out the call to that api and i wanna patch it: its inside msvbvm60.dll which interpretates the pcode inside the prog but i dont have to patch dll but the pcode in the prog
How can i find out the location to patch the pcode?
See ya
NikDH

iorior
January 25th, 2001, 19:28
You don't say if this is VB5 or VB6...

look at your prog with Hexworkshop (or Hview):
If you see something like that:

.......menu1mnu.....M
enu 1........

in hexa: 0002 0800 6D65 6E75 316D 6E75 0013 0306 004D
656E 7520 3100 0500 FF02 1F00

You can interpret like this:

02 0800 menu1mnu00 1303 0600 Menu 100 0500 FF021F00 0000

just change 0500 to 0400, and the menu is now enabled!!

If you don't have something like that with Hexworkshop, try to find in the dead listing the import fonction ".__vbaObjSet", with WDasm:

* Reference To: MSVBVM60.__vbaObjSet, Ord:0000h
|
:00404A2B E85CC8FFFF Call 0040128C
:00404A30 8945E4 mov dword ptr [ebp-1C], eax
:00404A33 6A00 push 00000000
:00404A35 8B45E4 mov eax, dword ptr [ebp-1C]
:00404A38 8B00 mov eax, dword ptr [eax]
:00404A3A FF75E4 push [ebp-1C]
:00404A3D FF5074 call [eax+74]

change the push 00000000 to push FFFFFFFF (used in the call [eax+74])
for enabled=true

PS: Send me your prog, or tell me where i can download it, i will try.
regards.
iorior