joyce8/EMBER2024-capa huggingface dataset:
Function at 0x140368370
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 0x1403683a0
xor eax, eax
jmp 0x140368463
mov rbp, rbx
cmp word [rax], si
je 0x1403683c5
or rax, 0xffffffffffffffff
inc rax
cmp word [rbp + rax*2], si
jne 0x1403683ac
lea rbp, [rbp + rax*2]
add rbp, 2
cmp word [rbp], si
jne 0x1403683a8
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.140362e98
movsxd r14, eax
test eax, eax
jne 0x140368403
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
jmp 0x140368399
mov rcx, r14
call fcn.140361778
mov rdi, rax
test rax, rax
jne 0x14036841c
xor ecx, ecx
call fcn.140360158
jmp 0x1403683f8
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.140362e98
test eax, eax
jne 0x14036844d
mov rcx, rdi
call fcn.140360158
jmp 0x140368457
xor ecx, ecx
call fcn.140360158
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 0x140368480
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 0x140368507
mov rsi, rbx
cmp word [rax], bp
je 0x1403684c6
or rax, 0xffffffffffffffff
inc rax
cmp word [rsi + rax*2], bp
jne 0x1403684b0
lea rsi, [rsi + rax*2]
add rsi, 2
cmp word [rsi], bp
jne 0x1403684ac
sub rsi, rbx
add rsi, 2
sar rsi, 1
add rsi, rsi
mov rcx, rsi
call fcn.140361778
mov rdi, rax
test rax, rax
je 0x1403684f4
mov r8, rsi
mov rdx, rbx
mov rcx, rax
call fcn.140371df0
mov rbp, rdi
xor ecx, ecx
call fcn.140360158
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 0x14036b55c
Capabilities:
Get geographical location

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x20
mov esi, edx
mov ebx, ecx
call fcn.1403613a8
mov ecx, ebx
lea r8, [rsp + 0x30]
and ecx, 0x3ff
mov r9d, 2
bts ecx, 0xa
mov edx, 0x20000001
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
xor edx, edx
test eax, eax
je 0x14036b5fd
cmp ebx, dword [rsp + 0x30]
je 0x14036b5f6
test esi, esi
je 0x14036b5f6
mov r10, qword [rdi + 0x98]
mov r9d, edx
movzx r8d, word [r10]
lea rcx, [r10 + 2]
lea eax, [r8 - 0x41]
cmp ax, 0x19
jbe 0x14036b5d1
sub r8w, 0x61
cmp r8w, 0x19
ja 0x14036b5de
movzx r8d, word [rcx]
inc r9d
add rcx, 2
jmp 0x14036b5bb
or rax, 0xffffffffffffffff
inc rax
cmp word [r10 + rax*2], dx
jne 0x14036b5e2
cmp r9d, eax
setne dl
mov eax, edx
jmp 0x14036b5ff
mov eax, 1
jmp 0x14036b5ff
xor eax, eax
mov rbx, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x40]
add rsp, 0x20
pop rdi
ret
Function at 0x14036baf0
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.140357b78
xor edx, edx
mov ecx, r14d
mov r12, rax
lea r8d, [rdx + 2]
call fcn.140357b78
mov rbp, rbx
sub rbp, rax
cmp r12, 0xffffffffffffffff
je 0x14036bc40
cmp rax, 0xffffffffffffffff
je 0x14036bc40
xor edi, edi
test rbp, rbp
jle 0x14036bbeb
lea edx, [rdi + 1]
mov ecx, 0x1000
call fcn.1403600e0
mov rbx, rax
test rax, rax
jne 0x14036bb78
lea edi, [rax + 0xc]
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], edi
jmp 0x14036bbe1
mov edx, 0x8000
mov ecx, r14d
call fcn.14035888c
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.14035ecf4
cmp eax, 0xffffffff
je 0x14036bbc1
cdqe
sub rbp, rax
test rbp, rbp
jg 0x14036bb88
mov edx, r15d
mov ecx, r14d
call fcn.14035888c
jmp 0x14036bbe1
cmp byte [rsi + 0x38], dil
je 0x14036bbd8
cmp dword [rsi + 0x34], 5
jne 0x14036bbd8
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], reloc.WS2_32.dll_listen
cmp byte [rsi + 0x30], dil
je 0x14036bbe1
mov edi, dword [rsi + 0x2c]
mov rcx, rbx
call fcn.140360158
jmp 0x14036bc54
jns 0x14036bc54
xor r8d, r8d
mov rdx, rbx
mov ecx, r14d
call fcn.140357b78
cmp rax, 0xffffffffffffffff
jne 0x14036bc0c
cmp byte [rsi + 0x30], dil
je 0x14036bc54
mov edi, dword [rsi + 0x2c]
jmp 0x14036bc54
mov ecx, r14d
call fcn.140364834
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x14036bc54
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [rsi + 0x38], 1
mov edi, reloc.WS2_32.dll_listen
mov dword [rsi + 0x34], eax
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], reloc.WS2_32.dll_listen
jmp 0x14036bc54
xor edi, edi
cmp byte [rsi + 0x30], dil
je 0x14036bc4d
mov eax, dword [rsi + 0x2c]
jmp 0x14036bc52
mov eax, reloc.WS2_32.dll_shutdown
mov edi, eax
xor r8d, r8d
mov rdx, r12
mov ecx, r14d
call fcn.140357b78
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 0x14036dc84
Capabilities:
Get disk information

Disassembly:
push rbx
sub rsp, 0x30
mov rax, qword [0x140807800]
xor rax, rsp
mov qword [rsp + 0x28], rax
cmp ecx, 0x1a
jbe 0x14036dcce
call fcn.14034a388
mov dword [rax], reloc.WS2_32.dll_ntohs
call fcn.14034a3a8
mov dword [rax], reloc.WS2_32.dll_listen
call fcn.140344bfc
xor eax, eax
mov rcx, qword [rsp + 0x28]
xor rcx, rsp
call fcn.140334be0
add rsp, 0x30
pop rbx
ret
xor ebx, ebx
test ecx, ecx
jne 0x14036dcd9
lea eax, [rbx + 1]
jmp 0x14036dcbb
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 0x14036dcb9
cmp eax, 1
setne bl
mov eax, ebx
jmp 0x14036dcbb
Function at 0x14036e5f4
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.14034cc68
mov rax, qword [rbp - 0x31]
mov ebx, 0xfde9
cmp dword [rax + 0xc], ebx
jne 0x14036e67e
cmp byte [rbp - 0x21], r15b
je 0x14036e679
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, ebx
jmp 0x14036e6b4
call fcn.1403604b4
test eax, eax
jne 0x14036e6a0
cmp byte [rbp - 0x21], r15b
je 0x14036e698
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov r9d, 1
jmp 0x14036e6b4
cmp byte [rbp - 0x21], r15b
je 0x14036e6b1
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.140353ac0
test eax, eax
jne 0x14036e754
xor edx, edx
lea rcx, [rbp - 0x39]
call fcn.14034cc68
mov rax, qword [rbp - 0x31]
cmp dword [rax + 0xc], ebx
jne 0x14036e6f3
cmp byte [rbp - 0x21], r15b
je 0x14036e728
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
jmp 0x14036e728
call fcn.1403604b4
test eax, eax
jne 0x14036e714
cmp byte [rbp - 0x21], r15b
je 0x14036e70d
mov rax, qword [rbp - 0x39]
and dword [rax + 0x3a8], 0xfffffffd
mov ebx, 1
jmp 0x14036e728
cmp byte [rbp - 0x21], r15b
je 0x14036e725
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.140353ac0
mov rdi, qword [rbp - 9]
test eax, eax
jne 0x14036e754
mov rcx, qword [rbp + 0x27]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ebx, eax
jmp 0x14036e757
mov ebx, r15d
cmp byte [rbp + 0xf], r15b
je 0x14036e765
mov rcx, rdi
call fcn.140360158
cmp byte [rbp + 0x3f], r15b
je 0x14036e774
mov rcx, qword [rbp + 0x27]
call fcn.140360158
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 0x140371a20
Capabilities:
Parse pe header

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

Disassembly:
test rcx, rcx
je 0x140007a20
mov eax, 0
cmp word [rcx], 0x5a4d
jne 0x140007a1f
mov eax, dword [rcx + 0x3c]
cmp eax, 0x400
jg 0x140007a25
cdqe
add rax, rcx
cmp dword [rax], 0x4550
mov edx, 0
cmovne rax, rdx
ret
mov rax, rcx
jmp 0x140007a1f
mov eax, 0
jmp 0x140007a1f

Function at 0x1400080a0
Capabilities:
Execute syscall

Disassembly:
pop rax
mov qword [rsp + 8], rcx
mov qword [rsp + 0x10], rdx
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x20], r9
sub rsp, 0x28
mov rcx, r10
call fcn.140008050
add rsp, 0x28
mov rcx, qword [rsp + 8]
mov rdx, qword [rsp + 0x10]
mov r8, qword [rsp + 0x18]
mov r9, qword [rsp + 0x20]
mov r10, rcx
syscall
ret

Function at 0x1400116b0
Capabilities:
Write file on windows

Disassembly:
push rsi
push rbx
sub rsp, 0x38
lea rax, [rsp + 0x58]
mov rbx, rcx
mov ecx, 2
mov qword [rsp + 0x58], rdx
mov qword [rsp + 0x60], r8
mov qword [rsp + 0x68], r9
mov qword [rsp + 0x28], rax
call fcn.14001a1f0
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sub.msvcrt.dll_fwrite
mov rsi, qword [rsp + 0x28]
mov ecx, 2
call fcn.14001a1f0
mov rdx, rbx
mov rcx, rax
mov r8, rsi
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
nop
nop dword [rax]
Function at 0x140011720
Capabilities:
Allocate or change rwx memory

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rsi, dword [0x1409efcd4]
test esi, esi
mov rdi, rcx
mov rbp, rdx
mov rbx, r8
jle 0x1400118b0
mov rax, qword [0x1409efcd8]
xor ecx, ecx
add rax, 0x18
nop
mov rdx, qword [rax]
cmp rdi, rdx
jb 0x14001176c
mov r8, qword [rax + 8]
mov r8d, dword [r8 + 8]
add rdx, r8
cmp rdi, rdx
jb 0x1400117f5
add ecx, 1
add rax, 0x28
cmp ecx, esi
jne 0x140011750
mov rcx, rdi
call fcn.140012280
test rax, rax
mov r12, rax
je 0x140011902
mov rax, qword [0x1409efcd8]
lea rsi, [rsi + rsi*4]
shl rsi, 3
add rax, rsi
mov qword [rax + 0x20], r12
mov dword [rax], 0
call fcn.1400123c0
mov ecx, dword [r12 + 0xc]
lea rdx, [rsp + 0x20]
mov r8d, 0x30
add rcx, rax
mov rax, qword [0x1409efcd8]
mov qword [rax + rsi + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x1400118e5
mov eax, dword [rsp + 0x44]
lea edx, [rax - 0x40]
and edx, 0xffffffbf
je 0x1400117ee
lea edx, [rax - 4]
and edx, 0xfffffffb
jne 0x140011860
add dword [0x1409efcd4], 1
cmp ebx, 8
jae 0x140011821
test bl, 4
jne 0x1400118c0
test ebx, ebx
je 0x140011816
movzx eax, byte [rbp]
test bl, 2
mov byte [rdi], al
jne 0x1400118d4
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov eax, ebx
sub ebx, 1
mov rdx, qword [rbp + rax - 8]
cmp ebx, 8
mov qword [rdi + rax - 8], rdx
jb 0x140011816
and ebx, 0xfffffff8
xor eax, eax
mov edx, eax
add eax, 8
mov rcx, qword [rbp + rdx]
cmp eax, ebx
mov qword [rdi + rdx], rcx
jb 0x14001183a
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
cmp eax, 2
mov r8d, 4
mov eax, 0x40
mov rcx, qword [rsp + 0x20]
cmovne r8d, eax
mov rdx, qword [rsp + 0x38]
add rsi, qword [0x1409efcd8]
mov r9, rsi
mov qword [rsi + 8], rcx
mov qword [rsi + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x1400117ee
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call fcn.1400116b0
xor esi, esi
jmp 0x140011777
mov eax, dword [rbp]
mov ebx, ebx
mov dword [rdi], eax
mov eax, dword [rbp + rbx - 4]
mov dword [rdi + rbx - 4], eax
jmp 0x140011816
mov ebx, ebx
movzx eax, word [rbp + rbx - 2]
mov word [rdi + rbx - 2], ax
jmp 0x140011816
mov rax, qword [0x1409efcd8]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov edx, dword [r12 + 8]
mov r8, qword [rax + rsi + 0x18]
call fcn.1400116b0
lea rcx, str.Address__p_has_no_image_section
mov rdx, rdi
call fcn.1400116b0
nop
nop dword [rax]
nop word cs:[rax + rax]
Function at 0x140011ed0
Capabilities:
Get thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
lea rcx, [0x1409efd40]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x1409efd20]
test rbx, rbx
je 0x140011f24
mov rbp, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov ecx, dword [rbx]
call rbp
mov rsi, rax
call rdi
test eax, eax
jne 0x140011f1b
test rsi, rsi
je 0x140011f1b
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140011f00
lea rcx, [0x1409efd40]
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]

Function at 0x140012280
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r9, qword [0x1409e9670]
xor edx, edx
cmp word [r9], 0x5a4d
mov r8, rcx
jne 0x1400122ef
mov rcx, r9
call fcn.140012150
test eax, eax
je 0x1400122ef
movsxd rax, dword [r9 + 0x3c]
mov rcx, r8
sub rcx, r9
add r9, rax
movzx eax, word [r9 + 0x14]
lea rdx, [r9 + rax + 0x18]
movzx eax, word [r9 + 6]
test eax, eax
je 0x1400122ed
sub eax, 1
lea rax, [rax + rax*4]
lea r9, [rdx + rax*8 + 0x28]
mov r8d, dword [rdx + 0xc]
cmp rcx, r8
mov rax, r8
jb 0x1400122e4
add eax, dword [rdx + 8]
cmp rcx, rax
jb 0x1400122ef
add rdx, 0x28
cmp rdx, r9
jne 0x1400122d0
xor edx, edx
mov rax, rdx
add rsp, 0x28
ret
Function at 0x14001c770
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
lea rcx, [0x1409e4240]
jmp 0x1400130b0

Function at 0x14001c780
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
lea rcx, [0x1409e4240]
jmp 0x1400130b0
Function at 0x140001450
Capabilities:
Allocate or change rwx memory
Create thread
Inject thread
Spawn thread to rwx shellcode

Disassembly:
push r15
push r14
push r12
push rsi
push rdi
push rbx
sub rsp, 0x48
mov esi, r9d
mov rdi, r8
mov r15, rdx
mov r12, rcx
mov ecx, dword [rsp + 0xa0]
call qword [sym.imp.KERNEL32.dll_Sleep]
mov dword [rsp + 0x20], 0x40
xor r14d, r14d
mov rcx, 0xffffffffffffffff
xor edx, edx
mov r8, r15
mov r9d, 0x3000
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
test rax, rax
je 0x140001526
mov rbx, rax
mov qword [rsp + 0x40], 0
lea rax, [rsp + 0x40]
mov qword [rsp + 0x20], rax
mov rcx, 0xffffffffffffffff
mov rdx, rbx
mov r8, r12
mov r9, r15
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x140001523
mov qword [rsp + 0x20], rbx
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
lea r9, [0x140001440]
xor r14d, r14d
mov rcx, 0xffffffffffffffff
xor edx, edx
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_CreateRemoteThread]
mov qword [rdi], rax
test rax, rax
je 0x140001526
test esi, esi
je 0x14000151e
mov rcx, rax
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r14, rbx
jmp 0x140001526
xor r14d, r14d
mov rax, r14
add rsp, 0x48
pop rbx
pop rdi
pop rsi
pop r12
pop r14
pop r15
ret

Function at 0x140001540
Capabilities:
Check for outputdebugstring error
Print debug messages

Disassembly:
sub rsp, 0x38
mov ecx, 0x457
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rcx, str._api_
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x457
jne 0x1400015d3
call fcn.140001600
cmp byte [rax + 2], 0
jne 0x1400015d3
test byte [rax + 0xbc], 0x70
jne 0x1400015d3
call fcn.140001bc0
mov qword [rsp + 0x30], 0xffffffffffffffff
mov rax, qword [0x140050508]
mov edx, dword [rax]
mov rax, qword [0x140050510]
mov eax, dword [rax]
mov dword [rsp + 0x20], eax
mov rcx, qword [0x140050500]
lea r8, [rsp + 0x30]
mov r9d, 1
call fcn.140001450
test rax, rax
sete al
cmp qword [rsp + 0x30], 0xffffffffffffffff
sete cl
or cl, al
movzx eax, cl
neg eax
add rsp, 0x38
ret
xor ecx, ecx
call sub.msvcrt.dll_exit
int3
push rbp
sub rsp, 0x20
lea rbp, [rsp + 0x20]
call fcn.1400025b0
nop
add rsp, 0x20
pop rbp
jmp 0x140001540

Function at 0x1400015e0
Capabilities:
Print debug messages

Disassembly:
sub rsp, 0x38
mov ecx, 0x457
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rcx, str._api_
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x457
jne 0x1400015d3
call fcn.140001600
cmp byte [rax + 2], 0
jne 0x1400015d3
test byte [rax + 0xbc], 0x70
jne 0x1400015d3
call fcn.140001bc0
mov qword [rsp + 0x30], 0xffffffffffffffff
mov rax, qword [0x140050508]
mov edx, dword [rax]
mov rax, qword [0x140050510]
mov eax, dword [rax]
mov dword [rsp + 0x20], eax
mov rcx, qword [0x140050500]
lea r8, [rsp + 0x30]
mov r9d, 1
call fcn.140001450
test rax, rax
sete al
cmp qword [rsp + 0x30], 0xffffffffffffffff
sete cl
or cl, al
movzx eax, cl
neg eax
add rsp, 0x38
ret
xor ecx, ecx
call sub.msvcrt.dll_exit
int3
push rbp
sub rsp, 0x20
lea rbp, [rsp + 0x20]
call fcn.1400025b0
nop
add rsp, 0x20
pop rbp
jmp 0x140001540
Function at 0x140002110
Capabilities:
Allocate or change rwx memory

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x28
mov rsi, rdx
mov rdi, rcx
movsxd r13, dword [rcx + 0x3c]
mov ebx, dword [rcx + r13 + 0x54]
mov r8, rbx
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x14000217a
lea r9, [rsp + 0x20]
mov rcx, rsi
mov rdx, rbx
mov r8d, 0x40
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x14000217a
mov rcx, rsi
mov rdx, rdi
mov r8, rbx
call sub.msvcrt.dll_memcpy
mov r8d, dword [rsp + 0x20]
lea r9, [rsp + 0x20]
mov rcx, rsi
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
movzx eax, word [rdi + r13 + 6]
test ax, ax
je 0x14000221d
movsxd rcx, dword [rdi + 0x3c]
lea rbp, [rcx + rdi]
add rbp, 0x110
xor ebx, ebx
jmp 0x1400021b5
movzx eax, word [rdi + r13 + 6]
inc rbx
movzx ecx, ax
add rbp, 0x28
cmp rbx, rcx
jae 0x14000221d
cmp dword [rbp + 0x1c], 0
js 0x1400021a6
mov r14d, dword [rbp]
mov r15d, dword [rbp + 4]
lea r12, [rdi + r15]
add r15, rsi
mov rcx, r12
mov rdx, r15
mov r8, r14
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x1400021a0
mov rcx, r15
mov rdx, r14
mov r8d, 0x40
lea r9, [rsp + 0x24]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x1400021a0
mov rcx, r15
mov rdx, r12
mov r8, r14
call sub.msvcrt.dll_memcpy
mov r8d, dword [rsp + 0x24]
mov rcx, r15
mov rdx, r14
lea r9, [rsp + 0x24]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
jmp 0x1400021a0
add rsp, 0x28
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
Function at 0x1400022a0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x48
test rcx, rcx
je 0x140002474
mov r14, rdx
mov rbx, rcx
movsxd rcx, dword [rcx + 0x3c]
mov r15d, dword [rcx + rbx + 0x88]
mov r13d, dword [r15 + rbx + 0x1c]
add r13, rbx
mov rax, rdx
shr rax, 0x10
test ax, ax
je 0x140002334
mov ebp, dword [rbx + r15 + 0x18]
test ebp, ebp
je 0x140002474
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x30], r8
mov r12d, dword [rbx + r15 + 0x20]
mov esi, dword [rbx + r15 + 0x24]
add r12, rbx
add rsi, rbx
xor edi, edi
nop dword [rax + rax]
mov ecx, dword [r12]
add rcx, rbx
mov rdx, r14
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x14000234a
add r12, 4
add rsi, 2
dec ebp
jne 0x140002310
jmp 0x14000247b
movzx eax, r14w
mov ecx, dword [rbx + r15 + 0x10]
sub rax, rcx
mov edi, dword [r13 + rax*4]
jmp 0x140002478
movzx eax, word [rsi]
mov edi, dword [r13 + rax*4]
cmp r15d, edi
ja 0x140002478
mov rax, qword [rsp + 0x38]
add r15d, dword [rbx + rax + 0x8c]
cmp edi, r15d
jae 0x140002478
add rdi, rbx
mov rcx, rdi
mov edx, 0x2e
call sub.msvcrt.dll_strchr
mov rbx, rax
inc rbx
mov rsi, rbx
sub rsi, rdi
lea rcx, [rsi + 4]
mov edx, 2
call sub.msvcrt.dll_calloc
test rax, rax
je 0x140002474
mov r14, rax
lea r8, [rsi + 1]
mov qword [rsp + 0x20], rsi
xor ecx, ecx
mov rdx, rax
mov r9, rdi
call qword [sym.imp.msvcrt.dll_mbstowcs_s]
mov dword [r14 + rsi*2], 0x6c0064
mov word [r14 + rsi*2 + 4], 0x6c
lea rdx, [0x140050002]
mov r8d, 4
mov rcx, r14
call qword [sym.imp.msvcrt.dll__wcsnicmp]
test eax, eax
je 0x140002402
lea rdx, str.ext_
mov r8d, 4
mov rcx, r14
call qword [sym.imp.msvcrt.dll__wcsnicmp]
test eax, eax
jne 0x140002450
lea r8, [rsp + 0x40]
mov rcx, qword [rsp + 0x30]
mov rdx, r14
call fcn.140001630
test rax, rax
je 0x140002450
mov rsi, rax
mov rcx, r14
call sub.msvcrt.dll_free
mov rdi, qword [rsp + 0x40]
lea rcx, [rdi + 1]
mov edx, 2
call sub.msvcrt.dll_calloc
test rax, rax
je 0x140002474
mov r14, rax
add rdi, rdi
mov rcx, rax
mov rdx, rsi
mov r8, rdi
call sub.msvcrt.dll_memcpy
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rcx, rax
mov rdx, rbx
mov r8, r14
call fcn.1400022a0
mov rdi, rax
mov rcx, r14
call sub.msvcrt.dll_free
jmp 0x14000247b
xor edi, edi
jmp 0x14000247b
add rdi, rbx
mov rax, rdi
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret

Function at 0x1400027c0
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 fcn.140003610
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sub.msvcrt.dll_fwrite
mov rsi, qword [rsp + 0x28]
mov ecx, 2
call fcn.140003610
mov rdx, rbx
mov rcx, rax
mov r8, rsi
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
nop
nop dword [rax]