use CResourceEditor helper methods
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4631 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
90422d4789
commit
d2ab1be975
1 changed files with 35 additions and 37 deletions
|
@ -8,6 +8,7 @@
|
|||
#include "Plugins.h"
|
||||
#include "Platform.h"
|
||||
#include "util.h"
|
||||
#include "ResourceEditor.h"
|
||||
|
||||
#include "dirreader.h"
|
||||
|
||||
|
@ -85,18 +86,16 @@ vector<unsigned char> read_file(const string& filename) {
|
|||
void Plugins::GetExports(const string &pathToDll, bool displayInfo)
|
||||
{
|
||||
vector<unsigned char> dlldata;
|
||||
PIMAGE_NT_HEADERS NTHeaders;
|
||||
try {
|
||||
dlldata = read_file(pathToDll);
|
||||
} catch (NSISException&) {
|
||||
NTHeaders = CResourceEditor::GetNTHeaders(&dlldata[0]);
|
||||
} catch (std::runtime_error&) {
|
||||
return;
|
||||
}
|
||||
|
||||
const string dllName = remove_file_extension(get_file_name(pathToDll));
|
||||
|
||||
LONG lfanew = FIX_ENDIAN_INT32(PIMAGE_DOS_HEADER(&dlldata[0])->e_lfanew);
|
||||
PIMAGE_NT_HEADERS NTHeaders = PIMAGE_NT_HEADERS(&dlldata[0] + lfanew);
|
||||
if (NTHeaders->Signature == IMAGE_NT_SIGNATURE)
|
||||
{
|
||||
FIX_ENDIAN_INT16_INPLACE(NTHeaders->FileHeader.Characteristics);
|
||||
if (NTHeaders->FileHeader.Characteristics & IMAGE_FILE_DLL)
|
||||
{
|
||||
|
@ -136,7 +135,6 @@ void Plugins::GetExports(const string &pathToDll, bool displayInfo)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Plugins::IsPluginCommand(const string& token) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue