0% found this document useful (0 votes)
49 views7 pages

Accessing MSVBVM60 API in VB IDE

This document describes how to modify VB files to access APIs exported by MSVBVM60 without declaring or adding references. It involves using PE Explorer to view exported functions from MSVBVM60.dll and Type Library Editor to modify VBA6.DLL. As an example, it shows how to add a new constant called vbQuote and a new function called GetByte that calls an exported API. The process involves modifying the type library, replacing the resource in VBA6.DLL with PE Explorer, and then the new API/constant can be accessed from VB.

Uploaded by

Alexander Mejia
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views7 pages

Accessing MSVBVM60 API in VB IDE

This document describes how to modify VB files to access APIs exported by MSVBVM60 without declaring or adding references. It involves using PE Explorer to view exported functions from MSVBVM60.dll and Type Library Editor to modify VBA6.DLL. As an example, it shows how to add a new constant called vbQuote and a new function called GetByte that calls an exported API. The process involves modifying the type library, replacing the resource in VBA6.DLL with PE Explorer, and then the new API/constant can be accessed from VB.

Uploaded by

Alexander Mejia
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

AccessingMSVBVM60APIfromVBIDE. I'mwritingthismoreasaninformativethingthanarealusefultechnique.I'mgonnatrytoexplainhow topatch/modvbfilesinordertohaveaccesstoanyAPIexportedbyMSVBVM60withoutdeclaringor addinganythingelsetoyourproject. ThetoolsI'mgoingtobeusingtodothisare: 1PEExplorer PEExploreristhemostfeaturepackedprogramforinspectingtheinnerworkingsofyourown software,andmoreimportantly,thirdpartyWindowsapplicationsandlibrariesforwhichyoudonot havesourcecode. Link:[Link] 2TypeLibraryEditor ThePowerVBTypeLibraryEditorcontrolisusedinallofthetypelibraryeditingtoolsprovidedwith AdvancedVisualBasic6:[Link] isessentiallythesameregardlessoftheexe/addinthatthecontrolishostedin.

Theeditingoperations fallintotwocategories,thosedonebyeditingfieldsintherighthandsideofthecontrol,and [Link] menucommandsforeachtypeofselection. Link:[Link] [Link](locatedinthesytem32 folder)[Link],File>Open>navigatetothe [Link],oncewehavethefileopenwegotoview>exportor Ctrl+E. [Link] commonlyusedinvbandwelldocumented,[Link] aboutthem.

[Link],navigatetoyourdesktopandcreatea foldercalledMSVBVM_Testandsavethetextfilethere.NowwecanclosePEExp. BeforestartmoddingourVB,IhighlyrecommendtoinstalltheSP6becauseifyouinstallthispatch lateritwilloverwriteallourwork. [Link],[Link] abackupofit,justincasesomethinggoeswrongorwewanttorestoreourVB. Letsstartwithasimplechange,closeallVBinstancesthatmightberunning,nowopenTypeLibrary Editor,File>Open>[Link]. Youshouldseesomethinglikethis

NowletssavetheTLBinthefolderwecreatedpreviouslyinthedesktopMSVBVM_Testnamethe [Link]. [Link] newconstanttoVBcalledvbQuotethisnewconstantwillrepresenta,inthatwaywecanuse vbQuoteinsteadofchr$(34)or.

GotothelefthadsidetreeviewandfindamodulecalledConstants,Expandthatmoduleandyouwill seeabunchofknownVBconstants(vbBack,vbCr,etc).RightClickontheconstantmoduleandclick AddConstantthiswilladdanewconstantcalledConstant1. NowselectthatconstantRightClick>[Link] typeLPSTRandintheConstantValuefieldtype,clickupdateandsavethefile.

Itshouldlooklikethis

[Link]>Open>naviagteto [Link],View>ResourcesorCtrl+R

SelectthefirstTypeLibrary. ClickResourceEditor NavigatetotheTLBfilelocatedinthefolderwecreatedpreviouslyandreplacetheresourcewiththe [Link],nowyoushouldhaveanewconstantavailable.

AddingnewAPIs. Thisprocedureisprettymuchsimilartothefirstonebut,thistimeinsteadofaddingaconstantwe gonnaaddanewAPI. FirstwegonnacreateanewmoduletostoreallyournewAPIs,rightclickonVBAAddType>Module ,renamethemoduletoMemory. RightclickonthemodulejustcreatedandAddFunction>Function. NowwegonnarenamethisnewfunctiontoGetByte,thisisgonnabeacalltoGetMem1exportedby MSVBVM60,InthispictureyoucanseeI'musingtheordinal#317(checkthetextwesavedatthe beginningwithalltheexportedfunctionstoverifythis)

Atthispointyoujustneedtosaveandrepeatthefirstprocessagain(replaceTLB),thisisself explanatory,butI'mpastingsomemorescreencapssoyoucanseeallthevalues.

Usingthistechniqueyoucanaddawholesetofmemoryfunctions,oranyotherapiyouwantfrom MSVBVM60. Well,IhopeyoufindthisusefuloratleastFUNNY! Havefunk!Cobein.

You might also like