-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathtemplate.nim
More file actions
37 lines (28 loc) · 1.14 KB
/
template.nim
File metadata and controls
37 lines (28 loc) · 1.14 KB
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
31
32
33
34
35
36
37
import winim/lean
import sequtils
func toByteSeq*(str: string): seq[byte] {.inline.} =
## Converts a string to the corresponding byte sequence.
@(str.toOpenArrayByte(0, str.high))
when defined(embedded):
var enctext_int: seq[int] = REPLACE_encryptedPayload
var enctext: seq[byte] = enctext_int.map(proc(x: int): byte = byte(x))
else:
var enctext: seq[byte] = toByteSeq(readFile("REPLACE_shellcodeFile"))
# Stuff, that is always used comes in here
# TODO: Add all other nessesary imports from the snippets you're using here
# The existing ones can be removed obviously, as this is exemplary code ;-)
import winim/lean
# TODO: Add all your needed/wanted features in here or in the loader.nim file on disk.
when defined(USE_MESSAGEBOX):
proc promptMessage() =
MessageBoxA(0, cast[LPCSTR](cstring("Hello World")), cast[LPCSTR](cstring("Hello")), MB_OK)
when defined(USE_CALCULATION):
proc randomCalculation() =
var a = 5
var b = 10
echo "The result is: ", a + b
when isMainModule:
when defined(USE_MESSAGEBOX):
promptMessage()
when defined(USE_CALCULATION):
randomCalculation()