1
0
mirror of synced 2025-02-22 13:09:57 +01:00

- OpenParrotLoader: adjust logging

This commit is contained in:
Poliwrath 2021-08-26 22:31:06 -04:00
parent 3ffa2517c2
commit 148bbdd88b

View File

@ -42,7 +42,7 @@ int LoadHookDLL(char *dllLocation, DWORD_PTR address)
Sleep(1000); Sleep(1000);
if (!RunTo(addy + addyOffset, 0, addy)) if (!RunTo(addy + addyOffset, 0, addy))
{ {
printf("Failed to Load DLL!"); printf("Failed to Load DLL: %s\n", dllLocation);
return 0; return 0;
} }
#ifdef _M_IX86 #ifdef _M_IX86
@ -51,7 +51,7 @@ int LoadHookDLL(char *dllLocation, DWORD_PTR address)
if (mycontext.Rax == 0) if (mycontext.Rax == 0)
#endif #endif
{ {
printf("Failed to Load DLL!"); printf("Failed to Load DLL: %s\n", dllLocation);
return 0; return 0;
} }
GetThreadContext(pi.hThread, &mycontext); GetThreadContext(pi.hThread, &mycontext);
@ -66,7 +66,7 @@ int LoadHookDLL(char *dllLocation, DWORD_PTR address)
Sleep(100); Sleep(100);
//WriteProcessMemory(pi.hProcess, (LPVOID)OEP, backbuf, 256, 0); //WriteProcessMemory(pi.hProcess, (LPVOID)OEP, backbuf, 256, 0);
Sleep(100); Sleep(100);
printf("DLL Loaded!\n");// %08x\n", mycontext.Eax); printf("DLL Loaded! %s\n", dllLocation);// %08x\n", mycontext.Eax);
return 1; return 1;
} }
int RunTo(DWORD_PTR Address, DWORD Mode, DWORD_PTR Eip) int RunTo(DWORD_PTR Address, DWORD Mode, DWORD_PTR Eip)
@ -121,7 +121,7 @@ DWORD GetVal(HKEY hKey, LPCTSTR lpValue)
if (nError == ERROR_FILE_NOT_FOUND) if (nError == ERROR_FILE_NOT_FOUND)
data = 0; // The value will be created and set to data next time SetVal() is called. data = 0; // The value will be created and set to data next time SetVal() is called.
else if (nError) else if (nError)
printf("Error: Could not get registry value %s", lpValue); printf("Error: Could not get registry value %s\n", lpValue);
return data; return data;
} }
@ -130,11 +130,11 @@ int main(int argc, char *argv[])
{ {
if (argc == 1 || argc > 4) if (argc == 1 || argc > 4)
{ {
printf("Please use the following format: "); printf("Please use the following format:\n");
#if _M_IX86 #if _M_IX86
printf("OpenParrotLoader.exe <DLL> c:\\games\\id6\\id6.exe <param>"); printf("OpenParrotLoader.exe <DLL> <EXE> <param>\n");
#else #else
printf("OpenParrotLoader64.exe <DLL> c:\\games\\id6\\id6.exe <param>"); printf("OpenParrotLoader64.exe <DLL> <EXE> <param>\n");
#endif #endif
return 0; return 0;
} }
@ -162,14 +162,14 @@ int main(int argc, char *argv[])
if (hFind == INVALID_HANDLE_VALUE) if (hFind == INVALID_HANDLE_VALUE)
{ {
printf("Unable to find %s", argv[2]); printf("Unable to find %s\n", argv[2]);
_getch(); _getch();
return 0; return 0;
} }
if (hFind2 == INVALID_HANDLE_VALUE) if (hFind2 == INVALID_HANDLE_VALUE)
{ {
printf("Unable to find %s", szDir2); printf("Unable to find %s\n", szDir2);
_getch(); _getch();
return 0; return 0;
} }
@ -191,7 +191,7 @@ int main(int argc, char *argv[])
&pi) // Pointer to PROCESS_INFORMATION structure. &pi) // Pointer to PROCESS_INFORMATION structure.
) )
{ {
printf("Failed to load process!"); printf("Failed to load process!\n");
_getch(); _getch();
return 1; return 1;
} }
@ -210,7 +210,7 @@ int main(int argc, char *argv[])
&pi) // Pointer to PROCESS_INFORMATION structure. &pi) // Pointer to PROCESS_INFORMATION structure.
) )
{ {
printf("Failed to load process!"); printf("Failed to load process!\n");
_getch(); _getch();
return 1; return 1;
} }
@ -224,7 +224,7 @@ int main(int argc, char *argv[])
if (!NT_SUCCESS(NtQueryInformationProcess(pi.hProcess, ProcessBasicInformation, &pbi, pbiSize, &pbiSize))) if (!NT_SUCCESS(NtQueryInformationProcess(pi.hProcess, ProcessBasicInformation, &pbi, pbiSize, &pbiSize)))
{ {
printf("Failed to get process information!"); printf("Failed to get process information!\n");
_getch(); _getch();
return 1; return 1;
} }
@ -236,7 +236,7 @@ int main(int argc, char *argv[])
if (read != sizeof(DWORD_PTR)) if (read != sizeof(DWORD_PTR))
{ {
printf("Failed to get process environment!"); printf("Failed to get process environment!\n");
_getch(); _getch();
return 1; return 1;
} }