Decompiling/Unpacking a File (Reverse Engineering the Compiler) - visual-foxpro

I'm using a program that can pack/compile a folder with files into a single *.xyz file that only that program can decompile and read. In order for the program to create a compiled file the flag:
[Compile]
Decompile=1
must be in the file Meta.ini. If not, the file cannot be unpacked/decompiled and there is no way to get back the source files.
I have created a compiled file and have lost the source files. I forgot to add the decompile flag, so I currently have no way to unpack the file and continue my work. I can still compile and decompile files using the program as long as I include the flag. The file produced is in the FoxPro FPT format. The program is written in Visual Basic.
To Summarise:
I have a compiled/packed file that I need to decompile/unpack.
I have access to the program that can compile and decompile the file.
I don't have the required decompile flag in the file.
The file produced is in the FoxPro FPT format.
The program is written in Visual Basic.
I know where the flag needs to go but I have no way of inserting it without first decompiling/unpacking the file (that I know of). My options are either to find a way of decompiling the file itself, or find a way to isolate the decompiler from the rest of the program. Any help would be greatly appreciated.
Thanks

You are saying
I have access to the program that can compile and decompile the file.
Then simply modify the portion that checks that flag and decompile.

Related

Can I delete every other file than the compiled program?

When I build solution in Visual Studio (2022), it generates an EXE (or DLL if I chose a class library) just as expected, except it also generates some files, like PDB, and some CS files. I know what most of them do, but if I am making a software, which consists of multiple of these files, I wouldn't want or like some people looking at the application directory and find source files and/or source code and solutions. This makes me come up with a question: Would deleting every single file except the compiled EXE or DLL impact their usability, or is there any other circumstance(s) to avoid creating these files, like SLN or PDB?
Thanks in advance :)
I have not tried anything, because, I simply don't know how to prevent VS from creating these files, except compiled files.
The .pdb files are outputs of your compilation. You can suppress them with:
<DebugSymbols>false</DebugSymbols>
The other files, like .cs and .sln are inputs to your project. Deleting them will mean you cannot build your program any more. I don't understand why you would want them to be deleted. If they're appearing in your output directory, check that you don't have "Copy local" (CopyToOutputDirectory) set on those items in your project.

Problems of reading and writing files when using Visual Studio to run C++ programs

Recently I'm tring to use Visual Studio to write c++ programs. However, I don't know where to put the input and output files which the program will read. I tried to put the input and output files in the directory ''...\Projects\ConsoleApplication\ConsoleApplication'', which is the same directory with ConsoleApplication.vcxproj file. This works well when I press the start debugging button(F5). However, when I press the start without debugging button(ctrl+F5). The program can't read and write to the files. Can anyone explain what happended?
Generally the files needs to be in the working project environment. Right click on the sidebar and add them to the project. The root directory will work.
You need to give your file path in your programs,
ofstream f1("d:\\me.txt");

Debug the program using preprocessed file output?

Let say I have a file that has a lot of preprocessor macros that generate loads of code. Normally when debugging such a file I wouldn't be able to step into macroses like functions as debugger does not have line number information. On the other hand it is possible to generate a preprocessed file using /P directive to the compiler, which will result in a file that contains all generated code and no macros.
Is it possible to make Visual Studio use preprocessed file for debugging?
One solution (not very convenient though) is to copy the preprocessed file back to the source file and compile it again. One must remember to generate the processed file without line numbers and to keep the original source code somewhere.

visual studio 2010 c# simple compile help

Hey I developed a small application and would like to compile it, however it comes with loads of extra stuff I dont want. All I want is a stand alone .exe file but instead I am getting pdb vshost.exe files etc. Is there anyway to get rid of these as I just want 1 .exe
Just copy/paste the exe file out. VS uses those files internally, and one is full of debugging symbols. Your going to want it if you plan on stepping into the code.
All these ''extra stuff'' is not required to run your ''small application''. You can verify that by copying the .exe file to a location where it will be standing alone indeed.
If it is not standing alone, as you say in the comment below: perhaps part of your code does compile to .dll, or you reference external dlls? Could you supply a list of filenames of files that are created?

How can I detect an .exe file that is produced by vb6 and recognize different vb6 files from each other?

I'm writing a program to detect which ".exe" file is generated by "Visual Basic6". I found that at the "entry point" of each vb file, there is an address at offset 1 from "entry point" which points to a location that contains the string: "vb5!", is that a certain signature? Can I be sure that in every vb files this string is exist?
Then, I want to find the certain address of the beginning of the code, so that I can recognize every vb file from an other vb file.
Not exactly sure what you're trying to accomplish, but every VB6 exe, DLL or OCX will contain an import to MSVBVM60.dll. If it contains that, you can be pretty sure it's a VB6 exe.
About this
Then, I want to find the certain
address of the beginning of the code,
so that I can recognize every vb file
from an other vb file.
VB6 doesn't embed the same kind of metadata in the exe that .net does, so it'll be impossible to extract any "VB Code" from the executable. Depending on how it was compiled, you MIGHT be able to retrieve functionnames and such, but that's only if the PDB (program database) was embedded into the exe and not compiled into a seperate PDB file.
Worse, there are plenty of tools out there to compress an exe (any exe), and if that's done, there's almost no way you'll be able to tell where the exe came from, at least not from simply looking at the contents of the exe file.

Resources