Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three executables instead of one, broken command line, silent failures. #37

Open
kweatherman opened this issue Jul 19, 2023 · 1 comment

Comments

@kweatherman
Copy link

kweatherman commented Jul 19, 2023

  1. 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?
  2. 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".
  3. If something goes wrong during PDB creation, the tool silently exists with no error or warning messages at all.
  4. 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.

@1392081456
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants