Skip to content

Commit ed1fd61

Browse files
author
Yasser Alhazmi
committed
bug fixes and code re-arrangement
1 parent 65a9575 commit ed1fd61

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Backstab/Driverloading.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ BOOL UnloadDriver(LPWSTR szPath, LPWSTR szServiceName) {
144144

145145
ret = _NtUnLoadDriver(&usDriverServiceName);
146146
if (ret != STATUS_SUCCESS) {
147-
printf("Error : NtUnLoadDriver: %x\n", ret);
147+
// printf("Error : NtUnLoadDriver: %x\n", ret);
148148
DeleteRegistryKey(szServiceName);
149149
return FALSE;
150150
}

Backstab/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BOOL Error(LPSTR szMethod) {
88
}
99

1010
BOOL Success(LPSTR szMethod) {
11-
printf("[+] %s:\n", szMethod);
11+
printf("[+] %s\n", szMethod);
1212
return TRUE;
1313
}
1414

Backstab/main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ int main(int argc, char* argv[]) {
255255
return Error("Could not load driver");
256256
}
257257
else {
258-
Success("Driver loaded as %ws\n", szServiceName);
258+
printf("Driver loaded as %ws\n", szServiceName);
259259
isRequestingDriverUnload = TRUE; // Set to unload the driver at the end of the operation
260260

261261
}
@@ -287,10 +287,10 @@ int main(int argc, char* argv[]) {
287287
{
288288
printf("\n");
289289
if (isUsingProcessName) {
290-
printf("Process Name : %ws", szProcessName);
290+
printf("Process Name: %ws\n", szProcessName);
291291
}
292292

293-
printf("[*] Process PID : %d\n", dwPid);
293+
printf("[*] Process PID: %d\n", dwPid);
294294
if (!ProcessGetProtectionLevel(dwPid, &dwProcessProtectionLevel))
295295
printf("[!] Failed to get the protection level of process with PID %d\n", dwPid);
296296
else
@@ -309,11 +309,13 @@ int main(int argc, char* argv[]) {
309309
else if (isRequestingProcessKill) {
310310
Info("Killing process\n");
311311
KillProcessHandles(hProtectedProcess);
312+
Success("Killing process succeeded");
312313
}
313314
else if (isUsingSpecificHandle)
314315
{
315-
Info("Killing Handle : 0x%x\n", strtol(szHandleToClose, 0, 16));
316+
Info("Closing Handle : 0x%x\n", strtol(szHandleToClose, 0, 16));
316317
ProcExpKillHandle(dwPid, strtol(szHandleToClose, 0, 16));
318+
Success("Closing handle succeeded");
317319
}
318320
else {
319321
printf("Please select an operation\n");

0 commit comments

Comments
 (0)