joyce8/EMBER2024-capa huggingface dataset:
Function at 0x433ba0
Capabilities:
Query environment variable

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
lea rcx, str.GCC_COLORS
call sub.msvcrt.dll_getenv
test rax, rax
mov rbp, rax
je 0x433adc
movzx r14d, byte [rax]
xor eax, eax
test r14b, r14b
je 0x433ae1
lea rdi, [rbp + 1]
xor r13d, r13d
xor esi, esi
xor r12d, r12d
jmp 0x4339d0
test r12, r12
je 0x4339c8
cmp r14b, 0x3b
je 0x4339c8
sub r14d, 0x30
cmp r14b, 9
ja 0x433adc
nop dword [rax]
movzx r14d, byte [rdi]
add rdi, 1
lea rax, [rdi - 1]
test r14b, r14b
je 0x433a08
cmp r14b, 0x3a
je 0x433a08
cmp r14b, 0x3d
jne 0x4339a8
cmp rax, rbp
je 0x433adc
test r12, r12
jne 0x433adc
sub rax, rbp
mov r12, rdi
mov rsi, rax
jmp 0x4339c8
test r12, r12
mov rcx, qword [0x004bfae0]
je 0x433ac8
lea rbx, [0x004bfae0]
sub rax, r12
test rcx, rcx
mov r13, rax
je 0x433a5d
lea rbx, [0x004bfae0]
jmp 0x433a45
mov rcx, qword [rbx + 0x18]
add rbx, 0x18
test rcx, rcx
je 0x433a5d
movzx eax, byte [rbx + 0x10]
cmp rax, rsi
jne 0x433a38
mov r8, rsi
mov rdx, rbp
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x433a38
test r12, r12
mov rcx, qword [rbx + 8]
je 0x433ab1
test rcx, rcx
je 0x433ab1
cmp byte [rbx + 0x11], 0
jne 0x433af0
lea rcx, [r13 + 7]
call fcn.0048c870
mov r8, r13
mov rdx, r12
mov rbp, rax
mov eax, 0x5b1b
mov word [rbp], ax
lea rcx, [rbp + 2]
call sub.msvcrt.dll_memcpy
lea rax, [rbp + r13 + 2]
mov qword [rbx + 8], rbp
mov dword [rax], 0x4b5b1b6d
mov byte [rax + 4], 0
mov byte [rbx + 0x11], 1
movzx r14d, byte [rdi - 1]
test r14b, r14b
je 0x433adc
mov rbp, rdi
xor r12d, r12d
jmp 0x4339c8
sub rax, rbp
test rcx, rcx
mov rsi, rax
jne 0x433a2a
test r14b, r14b
jne 0x433ab6
mov eax, 1
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
call fcn.004a6450
jmp 0x433a71
sub rsp, 0x38
cmp ecx, 1
je 0x433bef
cmp ecx, 2
jne 0x433bd0
mov ecx, 0xfffffff4
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov rcx, rax
lea rax, [rax - 1]
cmp rax, 0xfffffffffffffffd
jbe 0x433be0
xor eax, eax
add rsp, 0x38
ret
test ecx, ecx
je 0x433bc6
jmp 0x4bd1a0
lea rdx, [rsp + 0x2c]
call qword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x433bc6
add rsp, 0x38
jmp 0x433960

Function at 0x433c00
Capabilities:
Query environment variable

Disassembly:
sub rsp, 0x28
cmp ecx, 1
je 0x433c28
and ecx, 0xfffffffd
jne 0x433c20
xor edx, edx
mov eax, edx
add rsp, 0x28
ret
jmp 0x4bd1b9
lea rcx, str.GCC_URLS
call sub.msvcrt.dll_getenv
test rax, rax
je 0x433c70
cmp byte [rax], 0
je 0x433c0e
movzx edx, byte [rax]
cmp edx, 0x6e
je 0x433c60
cmp edx, 0x73
jne 0x433c51
cmp byte [rax + 1], 0x74
je 0x433c88
mov edx, 2
jmp 0x433c10
cmp byte [rax + 1], 0x6f
jne 0x433c46
cmp byte [rax + 2], 0
je 0x433c0e
jmp 0x433c46
lea rcx, str.TERM_URLS
call sub.msvcrt.dll_getenv
test rax, rax
jne 0x433c39
jmp 0x433c51
cmp byte [rax + 2], 0
mov edx, 1
je 0x433c10
jmp 0x433c51
Function at 0x43e130
Capabilities:
Write file on windows

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
test r8, r8
mov rdi, rcx
mov rbp, rdx
mov rsi, r8
je 0x43e19a
mov r12, qword [sym.imp.KERNEL32.dll_WriteFile]
lea r13, [rsp + 0x3c]
mov rbx, r8
jmp 0x43e169
mov eax, dword [rsp + 0x3c]
sub rbx, rax
je 0x43e19a
mov r8d, 0xffffffff
mov rdx, rsi
mov r9, r13
mov qword [rsp + 0x20], 0
cmp rbx, r8
mov rcx, rdi
cmovbe r8, rbx
sub rdx, rbx
add rdx, rbp
mov dword [rsp + 0x3c], r8d
call r12
test eax, eax
jne 0x43e160
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
Function at 0x443060
Capabilities:
Read file on windows

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov rbx, rcx
mov rcx, qword [rcx + 0x10]
call sub.msvcrt.dll_feof
test eax, eax
je 0x443080
xor eax, eax
add rsp, 0x28
pop rbx
pop rsi
ret
mov rcx, qword [rbx + 0x10]
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x443076
mov rcx, rbx
call fcn.00442f60
mov rax, qword [rbx + 0x30]
mov edx, 1
mov rcx, qword [rbx + 0x18]
mov r8, qword [rbx + 0x28]
mov r9, qword [rbx + 0x10]
add rcx, rax
sub r8, rax
call sub.msvcrt.dll_fread
mov rcx, qword [rbx + 0x10]
mov rsi, rax
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x443076
add qword [rbx + 0x30], rsi
test rsi, rsi
setne al
add rsp, 0x28
pop rbx
pop rsi
ret
Function at 0x457690
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
movzx r12d, word [rdx + 0x4e]
and r12w, 0xf000
mov r13, rcx
mov rbp, rdx
cmp r12w, 0x3000
mov r15d, r8d
mov r14, r9
je 0x4577d8
cmp r12w, 0x8000
mov ecx, 0x2010
mov esi, 0x2000
jne 0x4576dd
mov rsi, qword [rdx + 0x60]
lea rcx, [rsi + 0x10]
call fcn.0048c870
xor ebx, ebx
mov rdi, rax
nop word [rax + rax]
mov ecx, dword [rbp + 0x80]
lea rdx, [rdi + rbx]
mov r8d, esi
sub r8d, ebx
call sub.msvcrt.dll__read_1
cdqe
test rax, rax
jle 0x457730
add rbx, rax
cmp rsi, rbx
jne 0x4576f0
cmp r12w, 0x8000
je 0x457732
add rsi, rsi
mov rcx, rdi
lea rdx, [rsi + 0x10]
call fcn.0048c8f0
mov rdi, rax
jmp 0x4576f0
jne 0x4577b0
cmp r12w, 0x8000
sete dl
test r13, r13
setne al
test dl, al
je 0x45774e
cmp rbx, rsi
jne 0x457800
lea rax, [rbp + 0x60]
mov rdx, r14
mov rcx, r13
mov qword [rsp + 0x20], rbx
mov qword [rsp + 0x30], rax
lea rax, [rbp + 0x30]
mov r8, rdi
mov qword [rsp + 0x28], rax
lea r9, [rsi + 0x10]
call fcn.0044d890
test rax, rax
mov qword [rbp + 0x28], rax
movzx eax, byte [rbp + 0x8a]
setne cl
mov edx, ecx
shl edx, 2
and eax, 0xfffffffb
or eax, edx
mov byte [rbp + 0x8a], al
mov eax, ecx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test r13, r13
je 0x4577c9
mov r8, qword [rbp + 8]
mov r9d, r15d
mov edx, 3
mov rcx, r13
call fcn.004528b0
mov rcx, rdi
call fcn.004a6450
xor ecx, ecx
jmp 0x457798
test rcx, rcx
je 0x4577d1
mov rax, qword [rdx + 8]
lea r9, str._s_is_a_block_device
mov edx, 3
mov qword [rsp + 0x20], rax
call fcn.00452790
xor ecx, ecx
jmp 0x457798
mov rax, qword [rbp + 8]
lea r9, str._s_is_shorter_than_expected
mov r8d, r15d
xor edx, edx
mov rcx, r13
mov qword [rsp + 0x20], rax
call fcn.00452790
jmp 0x45774e
Function at 0x458e30
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov r12d, dword [rsp + 0x90]
cmp r9d, 3
mov rbx, rcx
mov rdi, rdx
mov ebp, r8d
mov esi, r9d
je 0x458ea8
call fcn.00457ad0
test rax, rax
mov r8, rax
je 0x458e93
cmp esi, 4
mov dword [rsp + 0x28], r12d
mov r9d, ebp
mov rdx, rdi
sete al
sete r13b
mov rcx, rbx
movzx eax, al
add eax, eax
mov dword [rsp + 0x20], eax
call fcn.00457c50
test rax, rax
jne 0x458efa
test r13b, r13b
je 0x458efa
xor eax, eax
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov rdx, qword [rcx + 0x1e8]
mov rax, qword [rcx + 0x1c0]
cmp rax, qword [rdx + 0x10]
je 0x458ec3
mov dword [rax - 0x20], 0
mov r8d, ebp
mov r9d, 3
mov rdx, rdi
mov rcx, rbx
call fcn.00457ad0
test rax, rax
mov r8, rax
je 0x458e93
mov dword [rsp + 0x28], r12d
mov r9d, ebp
mov rdx, rdi
mov rcx, rbx
mov dword [rsp + 0x20], 0
call fcn.00457c50
mov r9d, r12d
mov r8d, esi
mov rdx, rax
mov rcx, rbx
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp fcn.00458800

Function at 0x45cf80
Capabilities:
Write file on windows

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x30
lea rax, [0x00582ac0]
movzx r8d, byte [rcx + 4]
mov rdi, rdx
movzx edx, r8b
mov rsi, rcx
shl rdx, 4
add rax, rdx
mov edx, dword [rax]
cmp edx, 1
je 0x45d040
cmp edx, 2
je 0x45d000
test edx, edx
jne 0x45cfeb
movzx edx, word [rsi + 8]
test dl, 2
jne 0x45d0b8
and edx, 0x10
jne 0x45d040
mov rbx, qword [rax + 8]
movzx ecx, byte [rbx]
nop dword [rax]
add rbx, 1
mov rdx, rdi
call sub.msvcrt.dll_putc
movzx ecx, byte [rbx]
test ecx, ecx
jne 0x45cfd8
add rsp, 0x30
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
cmp r8b, 0x45
je 0x45d0d0
mov rcx, qword [rsi + 0x18]
mov r9, rdi
mov edx, 1
mov r8d, dword [rsi + 0x10]
call sub.msvcrt.dll_fwrite
cmp byte [rsi + 4], 0x45
jne 0x45cfeb
mov rdx, rdi
mov ecx, 0x22
add rsp, 0x30
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
jmp sub.msvcrt.dll_fputc
mov rax, qword [rsi + 0x10]
mov edx, dword [rax + 8]
mov rbp, qword [rax]
test edx, edx
je 0x45cfeb
lea r12, [rsp + 0x26]
xor ebx, ebx
jmp 0x45d083
mov rax, qword [rax]
mov rdx, rdi
movzx ecx, byte [rax + rbx]
call sub.msvcrt.dll_fputc
mov rax, qword [rsi + 0x10]
add rbx, 1
mov edx, dword [rax + 8]
cmp rbx, rdx
jae 0x45cfeb
lea rdx, [rbp + rbx]
cmp byte [rdx], 0
jns 0x45d060
mov rcx, r12
call fcn.0045b3a0
mov r9, rdi
mov edx, 1
mov rcx, r12
lea rbx, [rbx + rax - 1]
mov r8d, 0xa
call sub.msvcrt.dll_fwrite
jmp 0x45d06f
lea rax, [0x00583040]
sub r8d, 0x26
movsxd r8, r8d
mov rbx, qword [rax + r8*8]
jmp 0x45cfd1
mov rdx, rdi
mov ecx, 0x22
call sub.msvcrt.dll_fputc
jmp 0x45d00a
Function at 0x469460
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x40
mov eax, dword [rdx + 0x18]
movzx edi, byte [rcx + 0x4d9]
test eax, eax
mov rsi, rcx
mov rbx, rdx
je 0x469489
cmp qword [rdx + 8], 0
je 0x4694a0
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
cmp byte [rcx + 0x4c6], 0
mov byte [rcx + 0x4c6], 0
mov ecx, 0x800
setne r12b
call fcn.0048c870
mov qword [rbx + 8], rax
cmp byte [rsi + 0x4d9], 0
jne 0x469658
mov eax, dword [rbx + 0x18]
test dil, dil
mov r13, qword [rbx]
lea ebp, [rax + 1]
je 0x469610
mov dword [rsp + 0x28], ebp
xor r8d, r8d
xor edx, edx
mov rcx, rsi
mov qword [rsp + 0x20], r13
mov r9, qword [rbx + 0x20]
call fcn.00466200
cmp byte [rsi + 0x23], 0
mov edi, 0x100
mov byte [rsi + 0x23], 1
mov edx, dword [rbx + 0x1c]
lea rbp, [rsp + 0x3c]
setne r13b
jmp 0x46953e
test rcx, rcx
je 0x4695e8
mov r9, qword [rbx + 0x28]
mov qword [rcx + r8*8], rax
lea r9, [r9 + r8*4]
test r9, r9
je 0x469538
mov dword [r9], r10d
mov edx, dword [rbx + 0x1c]
add edx, 1
mov dword [rbx + 0x1c], edx
lea r14d, [rdx + 1]
cmp rdi, r14
jae 0x469568
mov rcx, qword [rbx + 8]
mov rdx, r14
shl rdx, 4
call fcn.0048c8f0
mov qword [rbx + 8], rax
cmp byte [rsi + 0x4d9], 0
jne 0x4695a0
lea rdi, [r14 + r14]
mov rdx, rbp
mov rcx, rsi
call fcn.00468bf0
cmp byte [rax + 4], 0x16
je 0x4695c0
mov r8d, dword [rbx + 0x1c]
cmp byte [rsi + 0x4d9], 0
mov r10d, dword [rsp + 0x3c]
mov rcx, qword [rbx + 8]
mov rdx, r8
jne 0x469518
test rcx, rcx
je 0x4695e8
mov qword [rcx + r8*8], rax
jmp 0x469538
mov rcx, qword [rbx + 0x28]
lea rdx, [r14*8]
test rcx, rcx
je 0x4695f8
call fcn.0048c8f0
mov qword [rbx + 0x28], rax
jmp 0x469564
mov rcx, rsi
call fcn.00466a20
mov byte [rsi + 0x4c6], r12b
mov byte [rsi + 0x23], r13b
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov qword [0], rax
ud2
mov rcx, rdx
call fcn.0048c870
mov qword [rbx + 0x28], rax
jmp 0x469564
mov rax, qword [rsi + 0x88]
mov rdx, qword [rax]
test rdx, rdx
je 0x46966b
lea rax, [r13 + rbp*8]
mov qword [rsi + 0x88], rdx
pxor xmm0, xmm0
movq xmm1, rax
movups xmmword [rdx + 0x20], xmm0
movq xmm0, r13
punpcklqdq xmm0, xmm1
mov dword [rdx + 0x30], 0
movups xmmword [rdx + 0x10], xmm0
jmp 0x4694f9
mov ecx, 0x400
call fcn.0048c870
mov qword [rbx + 0x28], rax
jmp 0x4694cd
mov ecx, 0x38
call fcn.0048c870
mov ecx, 7
mov rdx, rax
xor eax, eax
mov rdi, rdx
rep stosq qword [rdi], rax
mov rax, qword [rsi + 0x88]
mov qword [rdx + 8], rax
mov qword [rax], rdx
jmp 0x46961f
Function at 0x46b400
Capabilities:
Write file on windows

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
cmp byte [rsp + 0x80], 0
mov rbx, rcx
mov rbp, rdx
mov edi, r8d
mov r13d, r9d
jne 0x46b4a0
mov rcx, rbx
call sub.msvcrt.dll_strlen
test edi, edi
mov rsi, rax
mov r12d, eax
je 0x46b44d
test r13d, r13d
jne 0x46b470
lea r12d, [rdi + 1]
mov rdx, rbp
mov ecx, 0x20
add r12d, esi
call sub.msvcrt.dll_fputc
mov rdx, rbp
mov rcx, rbx
call sub.msvcrt.dll_fputs
mov eax, r12d
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
lea eax, [rdi + rax]
cmp r13d, eax
jae 0x46b439
mov r9, rbp
mov r8d, 3
mov edx, 1
lea rcx, [0x00583e20]
mov r12d, 1
call sub.msvcrt.dll_fwrite
jmp 0x46b43d
mov rdx, qword [rsp + 0x88]
call fcn.0046b2d0
mov rbx, rax
jmp 0x46b422
Function at 0x46fe70
Capabilities:
Read file on windows

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov r13, qword [rsp + 0x80]
mov rbp, qword [rsp + 0x90]
mov edi, edx
mov rbx, rcx
mov rdx, r8
mov ecx, edi
xor r8d, r8d
mov rsi, r9
call fcn.00499140
test rax, rax
js 0x46ff50
mov r9, qword [rsp + 0x88]
mov rdx, rsi
mov r8, r13
mov rcx, rbx
call fcn.0046e850
test rax, rax
mov rdx, rax
mov qword [rbp + 8], rax
je 0x46ff26
xor ebx, ebx
test rsi, rsi
mov qword [rbp], rax
mov r12d, esi
mov qword [rbp + 0x10], rsi
jne 0x46feee
jmp 0x46ff35
je 0x46ff30
add rbx, rax
cmp rbx, rsi
jae 0x46ff35
mov rdx, qword [rbp + 8]
mov r8d, r12d
mov ecx, edi
sub r8d, ebx
call sub.msvcrt.dll__read_1
cdqe
test rax, rax
jns 0x46fee0
call qword [sym.imp.msvcrt.dll__errno]
mov rcx, qword [rsp + 0x88]
lea rdx, str.read
mov r8d, dword [rax]
call r13
mov rcx, qword [rbp + 8]
call fcn.004a6450
xor eax, eax
jmp 0x46ff3a
cmp rbx, rsi
jb 0x46ff70
mov eax, 1
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
call qword [sym.imp.msvcrt.dll__errno]
mov rcx, qword [rsp + 0x88]
lea rdx, str.lseek
mov r8d, dword [rax]
call r13
xor eax, eax
jmp 0x46ff3a
mov rcx, qword [rsp + 0x88]
xor r8d, r8d
lea rdx, str.file_too_short
call r13
mov rcx, qword [rbp + 8]
call fcn.004a6450
xor eax, eax
jmp 0x46ff3a
Function at 0x487a00
Capabilities:
Read file on windows

Disassembly:
push r13
mov eax, 0x1118
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.00497ea0
sub rsp, rax
movdqa xmm0, xmmword [0x00586de0]
mov ebp, 0x1000
movaps xmmword [rsp + 0x20], xmm0
lea r12, [rsp + 0x20]
mov rdi, rcx
mov r13, rdx
mov dword [rsp + 0x38], 0
lea rsi, [rsp + 0xc0]
mov qword [rsp + 0x30], 0
nop dword [rax + rax]
xor ebx, ebx
nop word [rax + rax]
mov r8, rbp
mov r9, rdi
mov edx, 1
lea rcx, [rsi + rbx]
sub r8, rbx
call sub.msvcrt.dll_fread
add rbx, rax
cmp rbx, 0xfff
ja 0x487ab8
test rax, rax
jne 0x487a58
mov rcx, rdi
call sub.msvcrt.dll_ferror
test eax, eax
mov edi, eax
jne 0x487adf
lea rbp, [rsp + 0x20]
test rbx, rbx
jne 0x487acf
mov rdx, r13
mov rcx, rbp
call fcn.004876b0
mov eax, edi
add rsp, 0x1118
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
test rax, rax
je 0x487a80
mov r8, r12
mov edx, 0x1000
mov rcx, rsi
call fcn.00486e20
jmp 0x487a50
mov r8, rbp
mov rdx, rbx
mov rcx, rsi
call fcn.00487760
jmp 0x487a98
mov edi, 1
jmp 0x487aa3
Function at 0x48a3a0
Capabilities:
Get common file path

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov rax, qword [0x005a0b20]
test rax, rax
je 0x48a3c0
add rsp, 0x28
pop rbx
pop rsi
ret
xor edx, edx
xor ecx, ecx
mov rsi, qword [sym.imp.KERNEL32.dll_GetTempPathA]
call rsi
test eax, eax
mov ebx, eax
jne 0x48a3f0
mov rax, qword [0x005a0b20]
test rax, rax
je 0x48a420
add rsp, 0x28
pop rbx
pop rsi
ret
mov ecx, eax
call fcn.0048c870
mov ecx, ebx
mov rdx, rax
mov qword [0x005a0b20], rax
call rsi
test eax, eax
jne 0x48a3d3
mov rcx, qword [0x005a0b20]
call fcn.004a6450
mov qword [0x005a0b20], 0
lea rcx, [0x005871d0]
call fcn.0048c9a0
mov qword [0x005a0b20], rax
jmp 0x48a3b2

Function at 0x48b520
Capabilities:
Delete file

Disassembly:
push rsi
push rbx
sub rsp, 0x38
mov edx, dword [rcx + 0x18]
test edx, edx
mov rbx, rcx
jle 0x48b53a
mov rax, qword [rcx + 0x80]
call qword [rax + 0x18]
mov edx, dword [rbx + 0x2c]
test edx, edx
jle 0x48b54e
mov rax, qword [rbx + 0x80]
mov rcx, rbx
call qword [rax + 0x18]
mov rcx, qword [rbx + 0x60]
test rcx, rcx
je 0x48b55c
call sub.msvcrt.dll_fclose
mov rcx, qword [rbx + 0x68]
test rcx, rcx
je 0x48b56a
call sub.msvcrt.dll_fclose
cmp qword [rbx + 0x40], 0
je 0x48b600
mov edx, dword [rbx + 0x28]
test edx, edx
jne 0x48b5f0
mov rcx, qword [rbx + 0x38]
call fcn.004a6450
mov rcx, qword [rbx + 0x40]
call fcn.004a6450
mov rcx, qword [rbx + 0x48]
call fcn.004a6450
mov eax, dword [rbx + 0x70]
test eax, eax
jle 0x48b5cc
xor esi, esi
mov rax, qword [rbx + 0x78]
mov rcx, qword [rax + rsi*8]
call sub.msvcrt.dll_remove
mov rax, qword [rbx + 0x78]
mov rcx, qword [rax + rsi*8]
add rsi, 1
call fcn.004a6450
cmp dword [rbx + 0x70], esi
jg 0x48b5a0
mov rcx, qword [rbx + 0x78]
call fcn.004a6450
mov rax, qword [rbx + 0x80]
mov rax, qword [rax + 0x40]
test rax, rax
je 0x48b5e1
mov rcx, rbx
call rax
mov rcx, rbx
add rsp, 0x38
pop rbx
pop rsi
jmp fcn.004a6450
mov rcx, qword [rbx + 0x20]
call fcn.004a6450
jmp 0x48b57c
and dword [rbx], 0xfffffffe
lea r9, [rsp + 0x24]
mov edx, 1
mov rcx, rbx
lea r8, [rsp + 0x28]
call fcn.0048a8f0
jmp 0x48b575
Function at 0x4970d0
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.004a5d20
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.004a5d20
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 0x497140
Capabilities:
Allocate or change rwx memory

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rsi, dword [0x005a0c94]
test esi, esi
mov rbx, rcx
jle 0x497270
mov rax, qword [0x005a0c98]
xor r9d, r9d
add rax, 0x18
nop word [rax + rax]
mov r8, qword [rax]
cmp rbx, r8
jb 0x49718b
mov rdx, qword [rax + 8]
mov edx, dword [rdx + 8]
add r8, rdx
cmp rbx, r8
jb 0x497215
add r9d, 1
add rax, 0x28
cmp r9d, esi
jne 0x497170
mov rcx, rbx
call fcn.00497bc0
test rax, rax
mov rdi, rax
je 0x497292
mov rax, qword [0x005a0c98]
lea rbx, [rsi + rsi*4]
shl rbx, 3
add rax, rbx
mov qword [rax + 0x20], rdi
mov dword [rax], 0
call fcn.00497d00
mov edx, dword [rdi + 0xc]
mov r8d, 0x30
lea rcx, [rax + rdx]
mov rax, qword [0x005a0c98]
lea rdx, [rsp + 0x20]
mov qword [rax + rbx + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x497277
mov eax, dword [rsp + 0x44]
lea edx, [rax - 4]
and edx, 0xfffffffb
je 0x49720e
lea edx, [rax - 0x40]
and edx, 0xffffffbf
jne 0x497220
add dword [0x005a0c94], 1
add rsp, 0x50
pop rbx
pop rsi
pop rdi
ret
cmp eax, 2
mov r8d, 0x40
mov eax, 4
mov rcx, qword [rsp + 0x20]
cmove r8d, eax
mov rdx, qword [rsp + 0x38]
add rbx, qword [0x005a0c98]
mov r9, rbx
mov qword [rbx + 8], rcx
mov qword [rbx + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x49720e
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call fcn.004970d0
nop dword [rax]
xor esi, esi
jmp 0x497198
mov rax, qword [0x005a0c98]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov edx, dword [rdi + 8]
mov r8, qword [rax + rbx + 0x18]
call fcn.004970d0
lea rcx, str.Address__p_has_no_image_section
mov rdx, rbx
call fcn.004970d0
nop
nop word cs:[rax + rax]
nop dword [rax]

Function at 0x497830
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
lea r12, [0x005a0d00]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x005a0ce0]
test rbx, rbx
je 0x49788c
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 0x497883
test eax, eax
jne 0x497883
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x497868
mov rcx, r12
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
Function at 0x497bc0
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov rdx, qword [0x0058af20]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x497be0
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x497be8
ret
cmp word [r8 + 0x18], 0x20b
jne 0x497be0
movzx eax, word [r8 + 0x14]
sub rcx, rdx
lea rax, [r8 + rax + 0x18]
movzx r8d, word [r8 + 6]
test r8w, r8w
je 0x497c3d
lea edx, [r8 - 1]
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop word cs:[rax + rax]
mov r8d, dword [rax + 0xc]
cmp rcx, r8
mov rdx, r8
jb 0x497c34
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x497be0
add rax, 0x28
cmp rax, r9
jne 0x497c20
xor eax, eax
ret

Function at 0x497c40
Capabilities:
Parse pe header

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

Function at 0x497d00
Capabilities:
Parse pe header

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

Function at 0x4987f0
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x138
mov rbx, rcx
call sub.msvcrt.dll__errno
test rbx, rbx
mov dword [rax], 0
je 0x498930
cmp byte [rbx], 0
je 0x4988f8
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x498940
test al, 0x10
je 0x4988f8
lea rdi, [rsp + 0x20]
mov rdx, rbx
mov r8d, 0x104
mov rcx, rdi
call sub.msvcrt.dll__fullpath
mov rcx, rdi
call sub.msvcrt.dll_strlen
lea rcx, [rax + 0x24b]
mov rsi, rax
call sub.msvcrt.dll_malloc
test rax, rax
mov rbx, rax
je 0x49894f
lea rbp, [rsi + 1]
mov rdx, rdi
lea rcx, [rax + 0x244]
mov r8, rbp
call sub.msvcrt.dll_memcpy
cmp byte [rbx + 0x244], 0
mov rcx, rax
je 0x4988a0
movzx eax, byte [rbx + rsi + 0x243]
cmp al, 0x5c
je 0x4988a0
cmp al, 0x2f
jne 0x498918
lea rdx, [rbx + 0x130]
mov eax, 0x2a
mov word [rcx + rsi], ax
mov rdi, rdx
xor eax, eax
mov ecx, 0x20
mov qword [rbx + 0x238], 0xffffffffffffffff
mov dword [rbx + 0x240], 0
mov qword [rbx + 0x128], 0
rep stosq qword [rdi], rax
mov rax, rbx
mov dword [rdi], 0
add rsp, 0x138
pop rbx
pop rsi
pop rdi
pop rbp
ret
call sub.msvcrt.dll__errno
xor ebx, ebx
mov dword [rax], 0x14
mov rax, rbx
add rsp, 0x138
pop rbx
pop rsi
pop rdi
pop rbp
ret
mov edx, 0x5c
mov word [rcx + rsi], dx
mov rsi, rbp
jmp 0x4988a0
call sub.msvcrt.dll__errno
xor ebx, ebx
mov dword [rax], 0xe
jmp 0x498905
call sub.msvcrt.dll__errno
xor ebx, ebx
mov dword [rax], 2
jmp 0x498905
call sub.msvcrt.dll__errno
xor ebx, ebx
mov dword [rax], 0xc
jmp 0x498905