Dear All,

I have done a project in VBasic 10.0 for our product Design.

Unfortunately the program was deleted while re-installing the OS.

However we have managed to retrieve the files by using File Recovery software.

But now the .EXE file is working but the Vb program file is corrupted.

Please suggest an idea to retrieve the Vbcode from the program file or from the EXE File..

THANKS IN ADVANCE

S.Elancheliyan

The short answer is NO.

You will need to reverse-engineer the program and nobody knows how to do that. This is why Visual basic is so popular.

To begin with VBasic 10 would be VB.NET...
Second, Jupiter 2's reply is not entirely correct...

There are out there programs that "say" they can reverse engineer programs, i.e. decompile programs and while they are capable of doing such things, the result is less than readable. For each sub/function/property/event etc. there will be an identifier something like A123_57(a_,B_,C_) A1 and while you will be able to read basic logic structures (If, Do, For, Select) the variables will be just as unreadable as the proceedures.

Good Luck

You will have to rewrite the program. I 've rewritten many programs because sometime I forget something and a few months later I might want to change things.

Nowadays, I copy and paste all the modules text to a text file The Project and vbp, and text file are copied to a flash drive. When I get a reasonable amount of projects and data, I burn it to a Data CD.

The more you redo a project, the more things you think of to make the project better.

As to the request, at best, you can right-click the exe and view in notepad or wordpad or any text editor. You don't get the routines, only the names of the objects.

I burn all my projects to a data CD.

Thanks for the reply,

Actually in my case i' not only have the .EXE file but also the Vbprogram file.

While opening the file, it shows the following error.

Unable to read the project file 'xxxx.vbproj'.

D:\xxxx.vbproj(1,1): The project file could not be loaded.
Data at the root level is invalid.line 1, position 1.

Is this error can be solved?

Try opening it in Visual C++

Do you have the Full Version of Visual Studio? If so there are tools that might help, location in Start Menu >All Programs > Vsual Basic 6 > ...
Also, was the program written in a later version than what you have now to open it?

Well, unfortunatly Jupiter 2, elanch is using one of the .NET variants (2k2, 2k3, 2k5, 2k8, and soon 2k10).

elanch,

If I remember correctly, the vbproj file is an XML file and if I am correct you should be able to open it up with Notepad. The only one good thing that I can think of is that the error message has given you the place to look. Open up another *.vbproj file and the one giving you problems and see what is missing/wrong/etc...

Okay, just confirmed that it is an XML file (I have 2k8 Pro) and a blank form project looks like this...

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{EFB72206-21FC-42D4-BC38-BB31BAE8FF2A}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <StartupObject>WindowsApplication1.My.MyApplication</StartupObject>
    <RootNamespace>WindowsApplication1</RootNamespace>
    <AssemblyName>WindowsApplication1</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>WindowsForms</MyType>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <OptionExplicit>On</OptionExplicit>
    <OptionCompare>Binary</OptionCompare>
    <OptionStrict>Off</OptionStrict>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>WindowsApplication1.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>WindowsApplication1.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Drawing" />
    <Import Include="System.Diagnostics" />
    <Import Include="System.Windows.Forms" />
    <Import Include="System.Linq" />
    <Import Include="System.Xml.Linq" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Form1.vb">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Form1.Designer.vb">
      <DependentUpon>Form1.vb</DependentUpon>
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

so see what is wrong and correct the file and save.

Good Luck

It seems you will just have to rewrite the entire project file., perhaps using the info provided by VB5prgrmr.

"You can never escape a rewrite. It's what we all have to do, eventually."

This article has been dead for over six months. Start a new discussion instead.