Function at 0x5f8590
Capabilities:
Enumerate files on windows

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x58
lea rbp, [rsp + 0x80]
mov rdi, rcx
mov rsi, rdx
test rcx, rcx
je 0x5f8838
test rdx, rdx
je 0x5f8838
mov r12, qword [sym.imp.msvcrt.dll__errno]
call r12
mov r13, qword [rdi]
mov dword [rax], 0
test r13, r13
je 0x5f86b8
mov rcx, qword [r13 + 0x250]
mov rdx, r13
call qword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
je 0x5f8a70
mov r14, qword [rdi]
cmp word [r14 + 0x2c], 0
lea r8, [r14 + 0x2c]
je 0x5f8aa3
xor eax, eax
jmp 0x5f861c
cmp rax, 0xff
je 0x5f884c
mov rdx, rax
add rax, 1
cmp word [r14 + rax*2 + 0x2c], 0
jne 0x5f8610
lea rsi, [rdx + 2]
mov r9d, esi
lea rax, [r14 + 0x258]
xor edx, edx
mov ecx, 0xfde9
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x100
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x5f8689
xor eax, eax
nop dword [rax]
movzx ecx, word [r14 + rax*2 + 0x2c]
mov rdx, qword [rdi]
mov byte [rdx + rax + 0x258], cl
add rax, 1
cmp rax, rsi
jne 0x5f8670
mov rax, qword [rdi]
mov byte [rax + 0x357], 0
mov r13, qword [rdi]
add r13, 0x258
mov rax, r13
lea rsp, [rbp - 0x28]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
cmp byte [rsi], 0
je 0x5f8a78
mov rdx, rsi
xor eax, eax
jmp 0x5f86db
cmp eax, 0x80000000
je 0x5f8a78
add rdx, 1
add eax, 1
cmp byte [rdx], 0
jne 0x5f86d0
and eax, 0x7fffffff
mov r14d, eax
lea rax, [r14 - 1]
mov rbx, r14
cmp rax, 0x7ffffffb
ja 0x5f8a78
mov edx, 1
mov ecx, 0x358
call sym.calloc
mov qword [rdi], rax
test rax, rax
je 0x5f8ac4
add r14, 1
mov ecx, 0xfde9
mov r8, rsi
xor edx, edx
mov dword [rsp + 0x28], 0
mov r15, qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov r9d, r14d
mov qword [rsp + 0x20], 0
call r15
mov ecx, 0xfde9
mov r11d, eax
test eax, eax
jle 0x5f885c
lea eax, [r11 + 2]
cdqe
lea rax, [rax + rax + 0xf]
and rax, 0xfffffffffffffff0
call fcn.006ef990
xor edx, edx
sub rsp, rax
mov dword [rbp - 0x3c], r11d
mov r9d, r14d
mov r8, rsi
lea r10, [rsp + 0x40]
mov dword [rsp + 0x28], r11d
mov qword [rsp + 0x20], r10
mov qword [rbp - 0x38], r10
call r15
mov r10, qword [rbp - 0x38]
mov r11d, dword [rbp - 0x3c]
test eax, eax
je 0x5f8a86
lea ecx, [r11 - 1]
movsxd rcx, ecx
add rcx, rcx
movzx eax, word [r10 + rcx - 2]
cmp ax, 0x2a
je 0x5f87db
mov qword [rbp - 0x38], r10
add rcx, r10
cmp ax, 0x2f
je 0x5f881f
cmp ax, 0x5c
je 0x5f881f
lea rdx, [0x008d9f00]
call sym.wcscpy
mov r10, qword [rbp - 0x38]
mov rbx, qword [rdi]
mov rcx, r10
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov qword [rbx + 0x250], rax
mov r14, qword [rdi]
cmp qword [r14 + 0x250], 0xffffffffffffffff
jne 0x5f85f7
mov rcx, r14
call sym.free
mov qword [rdi], 0
call r12
mov dword [rax], 0x16
jmp 0x5f869d
lea rdx, [0x008d9f06]
call sym.wcscpy
mov r10, qword [rbp - 0x38]
jmp 0x5f87db
call qword [sym.imp.msvcrt.dll__errno]
xor r13d, r13d
mov dword [rax], 0x16
jmp 0x5f869d
mov esi, 0x100
mov r9d, 0x100
jmp 0x5f8633
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x459
je 0x5f8a38
lea eax, [r14 + 2]
cdqe
lea rax, [rax + rax + 0xf]
and rax, 0xfffffffffffffff0
call fcn.006ef990
sub rsp, rax
lea rdx, [rsp + 0x40]
mov r10, rdx
cmp ebx, 0xe
jbe 0x5f8ab3
mov rcx, r14
xor eax, eax
pxor xmm3, xmm3
and ecx, 0xfffffff0
nop dword [rax]
movdqu xmm0, xmmword [rsi + rax]
movdqu xmm1, xmm3
pcmpgtb xmm1, xmm0
movdqu xmm2, xmm0
punpcklbw xmm2, xmm1
punpckhbw xmm0, xmm1
movups xmmword [rdx + rax*2], xmm2
movups xmmword [rdx + rax*2 + 0x10], xmm0
add rax, 0x10
cmp rax, rcx
jne 0x5f88a8
mov rax, r14
and rax, 0xfffffffffffffff0
cmp r14, rax
je 0x5f8a30
movsx cx, byte [rsi + rax]
mov word [rdx + rax*2], cx
add rax, 1
cmp r14, rax
jbe 0x5f8a30
movsx cx, byte [rsi + rax]
mov word [rdx + rax*2], cx
lea rcx, [rax + 1]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 1]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 2]
cmp rcx, r14
jae 0x5f8a30
movsx r8w, byte [rsi + rax + 2]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 3]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 3]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 4]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 4]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 5]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 5]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 6]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 6]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 7]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 7]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 8]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 8]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 9]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 9]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 0xa]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 0xa]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 0xb]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 0xb]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 0xc]
cmp r14, rcx
jbe 0x5f8a30
movsx r8w, byte [rsi + rax + 0xc]
mov word [rdx + rcx*2], r8w
lea rcx, [rax + 0xd]
cmp r14, rcx
jbe 0x5f8a30
movsx ax, byte [rsi + rax + 0xd]
mov word [rdx + rcx*2], ax
nop dword [rax]
mov r11d, r14d
jmp 0x5f87a2
mov dword [rsp + 0x28], 0
mov r9d, r14d
mov r8, rsi
xor edx, edx
mov qword [rsp + 0x20], 0
xor ecx, ecx
call r15
mov r11d, eax
test eax, eax
jle 0x5f886d
xor ecx, ecx
jmp 0x5f8759
xor r13d, r13d
jmp 0x5f869d
call r12
mov dword [rax], 2
jmp 0x5f869d
mov rcx, qword [rdi]
call sym.free
mov qword [rdi], 0
call r12
mov dword [rax], 0x16
jmp 0x5f869d
mov esi, 1
mov r9d, 1
jmp 0x5f8633
movsx ax, byte [rsi]
mov word [rdx], ax
mov eax, 1
jmp 0x5f88f9
call r12
xor r13d, r13d
mov dword [rax], 0xc
jmp 0x5f869d