Function at 0x10021f80
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100363f0
mov eax, dword fs:[0]
push eax
sub esp, 0x34
push ebx
push esi
push edi
mov eax, dword [0x1004f100]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
xor esi, esi
cmp edi, esi
je 0x100221b3
xor eax, eax
cmp ax, word [edi]
je 0x100221b3
lea ecx, [ebp - 0x40]
push ecx
push esi
push edi
mov dword [ebp - 0x40], esi
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
test eax, eax
jne 0x10021ff4
push 2
jmp 0x100221b5
cmp dword [ebp - 0x20], esi
jne 0x10022000
push 0xd
jmp 0x100221b5
push esi
push 0x80
push 3
push esi
push 1
push 0x80000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x14], edi
cmp edi, 0xffffffff
je 0x100221bb
mov ebx, dword [ebp - 0x20]
and ebx, 0xfffffffe
add ebx, 2
push ebx
mov dword [ebp - 4], esi
call fcn.1002651c
mov esi, eax
add esp, 4
mov dword [ebp - 0x14], esi
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x10022096
xor edx, edx
push edx
mov word [ebx + esi - 2], dx
mov ecx, dword [ebp - 0x20]
lea eax, [ebp - 0x18]
push eax
push ecx
push esi
push edi
mov dword [ebp - 0x18], edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
test eax, eax
jne 0x100220a4
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.1002716e
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe
jmp 0x100221b5
call dword [sym.imp.KERNEL32.dll_CloseHandle]
movzx eax, word [esi]
mov edx, 0xbbef
cmp ax, dx
jne 0x1002212b
cmp byte [esi + 2], 0xbf
jne 0x10022135
push 0
push 0
push 0xffffffffffffffff
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
lea edi, [ebx + 1]
xor ecx, ecx
mov eax, edi
mov edx, 2
mul edx
seto cl
mov dword [ebp - 4], 2
mov dword [ebp - 0x1c], edi
neg ecx
or ecx, eax
push ecx
call fcn.1002651c
mov edi, eax
add esp, 4
test edi, edi
je 0x1002211b
mov ecx, dword [ebp - 0x1c]
push ecx
push edi
push 0xffffffffffffffff
push esi
push 0
push 0xfde9
jmp 0x10022182
push esi
call fcn.1002716e
add esp, 4
push 0xe
jmp 0x100221b5
mov edx, 0xfeff
cmp ax, dx
je 0x10022199
push 0
push 0
push 0xffffffffffffffff
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
lea edi, [ebx + 1]
xor ecx, ecx
mov eax, edi
mov edx, 2
mul edx
seto cl
mov dword [ebp - 4], 4
mov dword [ebp - 0x1c], edi
neg ecx
or ecx, eax
push ecx
call fcn.1002651c
mov edi, eax
add esp, 4
test edi, edi
je 0x1002211b
mov ecx, dword [ebp - 0x1c]
push ecx
push edi
push 0xffffffffffffffff
push esi
push 0
push 0
xor eax, eax
mov word [edi + ebx*2], ax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push esi
call fcn.1002716e
mov esi, edi
add esp, 4
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret