Three executables instead of one, broken command line, silent failures.
kweatherman opened this issue · 1 comments
- The project build doesn't match the release output.
If you build it you will get three separate executables: "fakepdb_coff.exe", "fakepdb_pdb.exe", "fakepdb_pe.exe", rather than a single "fakepdb.exe" executable.
Not a problem for me, but was unexpected. Are you sure you pushed up the same code that you used to build the distributed release? - The argument parsing for the "fakepdb_pdb" project is broken @ [command_pdb_generate.h line #41].
(https://github.com/Mixaill/FakePDB/blob/master/src_cpp/src_pdb/commands/command_pdb_generate.h#L41)
The "Available commands" output says "pdb_generate [-l] ". But is no way to actually supply the "-l" as it will always be parsed as the json input path regardless. Also the code looks for an optional "exe" command line option but this is not mentioned in the usage text.
Also none of the arguments are sanity checked. If a parsing fail is detected at all it will output ".json file does not exists" regardless of the actual problem.
I suggest a more robust argument parser that does a lot of the work automatically for you. Since you go the heavy OOP route, maybe one of the options on this page 3-ways-to-parse-command-line-arguments or similar.
Finally why require "pdb_generate" at all since it's a single executable anyhow? We are missing the master OOP "main.cpp". - If something goes wrong during PDB creation, the tool silently exists with no error or warning messages at all.
- A minor thing, you refer to all executable modules as "exe", when the IDA input could be DLL files to. It would be better to use a more encompassing term like "module" avoid confusion.
Some humble suggestions:
Why structure your code this way with so many levels and redundancy? Unless you really do want three sperate executables?
Why not then just make one "main.cpp" that just parses all possible options (again using a more robust command line argument parser)? You just need to architect it such that you break each command down.
P.S. Like the Fallout game reference. I'm one of the original developers of the game.
Hello kweatherman:
How can I compile this tool? I see that the author updated the code, but not the distribution. I see you mentioned that the build will appear fakepdb_coff.exe", "fakepdb_pdb.exe", "fakepdb_pe.exe these three exe, but when I compile in linux, also appear three executable files, but no.exe, Is it necessary for.exe to appear in the windows environment? How do you compile them on windows? Thank you!