Skip to content

Commit

Permalink
$fully_updated
Browse files Browse the repository at this point in the history
  • Loading branch information
xharen committed Nov 2, 2022
1 parent e0252cc commit 13379c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Kruzinjector/appmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,19 @@ bool StartInject(int injectType, const char* injectName, const char* dllFile)
if (!sourceData) {
printf("[!] Dll file can't allocate.\n");
Dll.close();
return -7;
return false;
}

Dll.seekg(0, std::ios::beg);
Dll.read(reinterpret_cast<char*>(sourceData), dllSize);
Dll.close();

if (reinterpret_cast<IMAGE_DOS_HEADER*>(sourceData)->e_magic != 0x5A4D) /* Checks MZ */
{
printf("[!] Invalid dll file.\n");
return false;
}

Dll.seekg(0, std::ios::beg);
Dll.read(reinterpret_cast<char*>(sourceData), dllSize);
Dll.close();

IMAGE_FILE_HEADER* fileHeader = nullptr;
fileHeader = &reinterpret_cast<IMAGE_NT_HEADERS*>(sourceData + reinterpret_cast<IMAGE_DOS_HEADER*>(sourceData)->e_lfanew)->FileHeader;

Expand Down

0 comments on commit 13379c0

Please sign in to comment.