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

Added support for checking presumably missing dependencies #585

Merged
merged 9 commits into from
Jun 14, 2019

Conversation

ladislav-zezula
Copy link
Contributor

No description provided.

@@ -57,7 +60,7 @@ class ImportTable
/// @{
void computeHashes();
void clear();
void addLibrary(std::string name);
void addLibrary(std::string name, bool bIsMissingDependency = false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using hungarian notation anywhere in our projects so it seems rather inconsistent. Could you please rename it to isMissingDependency?

#include "retdec/utils/dynamic_buffer.h"
#include "retdec/fileformat/file_format/pe/pe_format.h"

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the very first thing in the file. Followed by includes.

}

desc.push_back("Number of missing dependencies: ");
sprintf(szNumDeps, "%u", (unsigned)fileinfo.getNumberOfMissingDeps());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have conversion functions available in utils/conversion.h. numToStr can be used here.

return false;
}

sprintf(szIndex, "%u", (unsigned)recIndex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. numToStr.

return false;
}

sprintf(szIndex, "%u", (unsigned)recIndex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numToStr

const auto numberOfMissingDeps = fileinfo.getNumberOfMissingDeps();

Value jMissingDeps;
jMissingDeps["count"] = (unsigned int)numberOfMissingDeps;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing with fileinfo is that we present everything in JSON as strings and I think everyone working with fileinfo JSONs kinda expects this. Would it be possible to present this value as string too?

@ladislav-zezula
Copy link
Contributor Author

Fixed in commit 44063e76f38f4c1a952fb0541f48a2a608aa0566

@metthal metthal merged commit 15b9658 into master Jun 14, 2019
metthal added a commit that referenced this pull request Jun 17, 2019
@ladislav-zezula ladislav-zezula deleted the LZ_CheckMissingDependencies branch June 18, 2019 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants