FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SimpleShellcodeInjector/SimpleShellcodeInjector.c at master · SuperDolby/SimpleShellcodeInjector · GitHub
SuperDolby
SimpleShellcodeInjector
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SimpleShellcodeInjector
/
SimpleShellcodeInjector.c
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (24 loc) · 819 Bytes
Breadcrumbs
SimpleShellcodeInjector
/
SimpleShellcodeInjector.c
Copy path
File metadata and controls
30 lines (24 loc) · 819 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
28
29
30
#include
<stdio.h>
#include
<Windows.h>
int
main
(
int
argc
,
char
*
argv
[]) {
unsigned
int
char_in_hex
;
char
*
shellcode
=
argv
[
1
];
unsigned
int
iterations
=
strlen
(
shellcode
);
unsigned
int
memory_allocation
=
strlen
(
shellcode
) /
2
;
for
(
unsigned
int
j
=
0
;
j
<
iterations
-
1
;
j
++
){
if
(
shellcode
[
j
]
==
'x'
){
shellcode
[
j
]
=
'0'
;
}
}
for
(
unsigned
int
i
=
0
;
i
<
iterations
-
1
;
i
++
) {
sscanf
(
shellcode
+
2
*
i
,
"%2X"
,
&
char_in_hex
);
shellcode
[
i
]
=
(
char
)
char_in_hex
;
}
void
*
exec
=
VirtualAlloc
(
0
,
memory_allocation
,
MEM_RESERVE
|
MEM_COMMIT
,
PAGE_READWRITE
);
memcpy
(
exec
,
shellcode
,
memory_allocation
);
DWORD
ignore
;
VirtualProtect
(
exec
,
memory_allocation
,
PAGE_EXECUTE
,
&
ignore
);
printf
(
"11"
);
(
*
(
void
(
*
)())
exec
)();
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL