Skip to content

Commit

Permalink
If the service was started prior to activation of logging in the initial
Browse files Browse the repository at this point in the history
process (due to our file/url of interest code) then it's not interesting
and we shouldn't trigger an injection into services.exe

Also enable larger buffer sizes for RtlDecompressBuffer as suggested by
KillerInstinct
  • Loading branch information
spender-sandbox committed Jan 26, 2016
1 parent c95495a commit ed63d31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hook_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ HOOKDEF(NTSTATUS, WINAPI, RtlDecompressBuffer,
NTSTATUS ret = Old_RtlDecompressBuffer(CompressionFormat, UncompressedBuffer, UncompressedBufferSize,
CompressedBuffer, CompressedBufferSize, FinalUncompressedSize);

LOQ_ntstatus("misc", "pbh", "UncompressedBufferAddress", UncompressedBuffer, "UncompressedBuffer",
LOQ_ntstatus("misc", "pch", "UncompressedBufferAddress", UncompressedBuffer, "UncompressedBuffer",
ret ? 0 : *FinalUncompressedSize, UncompressedBuffer, "UncompressedBufferLength", ret ? 0 : *FinalUncompressedSize);

return ret;
Expand Down
4 changes: 2 additions & 2 deletions hook_services.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ HOOKDEF(BOOL, WINAPI, StartServiceA,
BOOLEAN dispret = servicename_from_handle(hService, servicename);
BOOL ret;

if (dispret && (wcsicmp(servicename, L"osppsvc") || !g_config.file_of_interest || !wcsicmp(our_process_path, g_config.file_of_interest)))
if (dispret && !g_config.suspend_logging && (wcsicmp(servicename, L"osppsvc") || !g_config.file_of_interest || !wcsicmp(our_process_path, g_config.file_of_interest)))
pipe("SERVICE:%Z", servicename);
ret = Old_StartServiceA(hService, dwNumServiceArgs,
lpServiceArgVectors);
Expand All @@ -209,7 +209,7 @@ HOOKDEF(BOOL, WINAPI, StartServiceW,
BOOLEAN dispret = servicename_from_handle(hService, servicename);
BOOL ret;

if (dispret && (wcsicmp(servicename, L"osppsvc") || !g_config.file_of_interest || !wcsicmp(our_process_path, g_config.file_of_interest)))
if (dispret && !g_config.suspend_logging && (wcsicmp(servicename, L"osppsvc") || !g_config.file_of_interest || !wcsicmp(our_process_path, g_config.file_of_interest)))
pipe("SERVICE:%Z", servicename);
ret = Old_StartServiceW(hService, dwNumServiceArgs,
lpServiceArgVectors);
Expand Down

0 comments on commit ed63d31

Please sign in to comment.