Skip to content

Commit

Permalink
minor changes for LuaBridge compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
moccajoghurt committed Aug 7, 2018
1 parent 2e7eaa9 commit b295339
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void HiddenKernelDLLInjectionAttackTest() {
hProcess = (HANDLE)GetProcessByName("TestApp.exe");
}

if (!StealthInject("TestApp.exe", "InjectedDLL.dll")) {
if (!StealthInject("DarkSoulsIII.exe", "InjectedDLL.dll")) {
cout << "HiddenKernelDLLInjectionAttack() failed" << endl;
} else {
cout << "HiddenKernelDLLInjectionAttack() success" << endl;
Expand Down
Binary file modified AttackServices/HiddenKernelDLLInjectionAttack/AttackTest.exe
Binary file not shown.
1 change: 1 addition & 0 deletions PenetrationRoutines/AttackProvider/AttackProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AttackProvider {
// virtual BOOL WriteProcessMemory(HANDLE hProcess, void* address, void* writeBuf, SIZE_T writeSize, SIZE_T* bytesWritten) {return TRUE;};
// virtual BOOL SetTargetProcessByName(wstring){return FALSE;};
// virtual BOOL ExecuteAttack(){return FALSE;};
AttackProvider(){}
string GetAttackResults() {
return results;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include <Shlwapi.h>
#include "DLLInjectionProvider.h"

BOOL DLLInjectionProvider::SetTargetProcessByName(wstring name) {
bool DLLInjectionProvider::SetTargetProcessByName(const string _name) {
wstring name(_name.begin(), _name.end());
hProcess = GetProcessHandleByName(name);
if (hProcess == NULL) {
results += "SetTargetProcessByName() failed. Could not get HANDLE to target process. System Error Code: ";
Expand All @@ -13,7 +14,8 @@ BOOL DLLInjectionProvider::SetTargetProcessByName(wstring name) {
return TRUE;
}

BOOL DLLInjectionProvider::SetTargetDLL(wstring dllPath) {
bool DLLInjectionProvider::SetTargetDLL(const string _dllPath) {
wstring dllPath(_dllPath.begin(), _dllPath.end());
if (!PathFileExistsW(dllPath.c_str())) {
results += "SetTargetDLL() failed. File not found. System Error Code: ";
results += to_string(GetLastError());
Expand All @@ -24,7 +26,7 @@ BOOL DLLInjectionProvider::SetTargetDLL(wstring dllPath) {
return TRUE;
}

BOOL DLLInjectionProvider::ExecuteAttack() {
bool DLLInjectionProvider::ExecuteAttack() {
if (dllPath == L"" || hProcess == NULL) {
return FALSE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ using namespace std;

class DLLInjectionProvider : public AttackProvider {
public:
BOOL SetTargetProcessByName(wstring) ;
BOOL ExecuteAttack() ;
BOOL SetTargetDLL(wstring);
DLLInjectionProvider(){}
bool SetTargetProcessByName(const string);
bool ExecuteAttack();
bool SetTargetDLL(const string);

protected:
wstring dllPath = L"";
Expand Down

0 comments on commit b295339

Please sign in to comment.