Editing a compiled OCX

Posted on 2005-05-13
Last Modified: 2013-12-25
I need to edit a variable within an ocx I have compiled. The reason I can't just recompile is because the source containing the version of this ocx was lost on my backup drive.

So are there any utilities that would allow me to edit the ocx. I'm also trying to see if there is anything that will actually allow me to view the code within the ocx.

Question by:Shroder
    LVL 12

    Expert Comment

    Well, OCXen contain compiled code, so the process will not be trivial at all, unless you know how to work with a disassembler and a hex editor.

    If you google for "OCX VB disassemble" ( ), you'll get a number of tools which pretend to be able to disassemble an OCX. Once you know how where the value of the variable is stored, you can try to patch it with a hex editor.

    Good luck.

    Author Comment

    Can you give me a link to a good hex editor?
    LVL 12

    Accepted Solution

    I'm using the hex editor which comes with my text editor (UltraEdit).

    Here's a list of hex editors, some of them being open source: or

    Frhed appears to be a good choice, but I don't really know:

    Note that if you change the code, you probably need to change the checksum in the header of the file. There are some utilities to do this: or .

    HTH, J

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    System.badimageFormatException error 3 42
    Detect VBA Font Colors 15 46
    Visual Basic Excel Formatting error 4 48
    VBA filters 2 24
    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now