Function at 0x4017d2
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x31c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
xor esi, esi
push esi
push esi
push 3
push esi
push 1
push 1
push eax
mov dword [ebp - 0x318], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x401810
xor eax, eax
jmp 0x401ad3
push edi
push esi
lea eax, [ebp - 0x31c]
push eax
push 0x104
lea eax, [ebp - 0x108]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, esi
je 0x401aab
mov edi, dword [ebp - 0x31c]
xor ecx, ecx
mov byte [ebp - 0x311], 0
cmp edi, esi
jbe 0x401a81
mov bl, byte [ebp + ecx - 0x108]
inc ecx
test bl, bl
je 0x401aa0
cmp bl, 0xa
je 0x401a5e
cmp bl, 0xd
je 0x401a5e
cmp bl, 0x3a
jne 0x401882
mov byte [ebp - 0x311], 1
cmp bl, 0x7f
ja 0x401890
movzx ax, bl
jmp 0x401a53
mov al, bl
add al, 0x3e
cmp al, 0x1d
ja 0x4018ce
cmp ecx, edi
jae 0x4018ce
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x4018ce
cmp al, 0xbf
ja 0x4018ce
and bl, 0x1f
and al, 0x3f
movzx dx, bl
shl dx, 6
movzx ax, al
or dx, ax
mov word [ebp + esi*2 - 0x310], dx
inc esi
inc ecx
jmp 0x401a70
mov eax, edi
sub eax, ecx
cmp eax, 1
jbe 0x401964
cmp bl, 0xe0
jne 0x4018ef
mov al, byte [ebp + ecx - 0x108]
cmp al, 0xa0
jb 0x401964
cmp al, 0xbf
jbe 0x401924
cmp bl, 0xe1
jb 0x4018f9
cmp bl, 0xec
jbe 0x401901
mov al, bl
add al, 0x12
cmp al, 1
ja 0x401910
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x401910
cmp al, 0xbf
jbe 0x401924
cmp bl, 0xed
jne 0x401964
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x401964
cmp al, 0x9f
ja 0x401964
mov dl, byte [ebp + ecx - 0x107]
cmp dl, 0x80
jb 0x401964
cmp dl, 0xbf
ja 0x401964
and al, 0x3f
movzx ax, al
movzx bx, bl
shl bx, 6
and dl, 0x3f
or ax, bx
shl ax, 6
movzx dx, dl
or ax, dx
mov word [ebp + esi*2 - 0x310], ax
inc esi
inc ecx
inc ecx
jmp 0x401a70
lea eax, [edi - 2]
cmp eax, 1
jbe 0x401aa0
cmp bl, 0xf0
jne 0x40198a
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x90
jb 0x401aa0
cmp dl, 0xbf
jbe 0x4019c5
mov al, bl
add al, 0xf
cmp al, 2
ja 0x4019a3
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x80
jb 0x4019a3
cmp dl, 0xbf
jbe 0x4019c5
cmp bl, 0xf4
jne 0x401aa0
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x80
jb 0x401aa0
cmp dl, 0x8f
ja 0x401aa0
mov al, byte [ebp + ecx - 0x107]
mov byte [ebp - 0x313], al
cmp al, 0x80
jb 0x401aa0
cmp al, 0xbf
ja 0x401aa0
mov al, byte [ebp + ecx - 0x106]
mov byte [ebp - 0x312], al
cmp al, 0x80
jb 0x401aa0
cmp al, 0xbf
ja 0x401aa0
movzx edx, dl
and edx, 0x3f
movzx eax, bl
and eax, 7
shl eax, 6
or eax, edx
movzx edx, byte [ebp - 0x313]
and edx, 0x3f
shl eax, 6
or eax, edx
movzx edx, byte [ebp - 0x312]
and edx, 0x3f
shl eax, 6
or eax, edx
lea edx, [eax - 0x10000]
sar edx, 0xa
or edx, 0xd800
add ecx, 3
mov word [ebp + esi*2 - 0x310], dx
and eax, 0x3ff
inc esi
or eax, 0xdc00
mov word [ebp + esi*2 - 0x310], ax
inc esi
jmp 0x401a70
cmp esi, 0x104
je 0x401a99
xor eax, eax
mov word [ebp + esi*2 - 0x310], ax
cmp ecx, edi
jb 0x401854
cmp byte [ebp - 0x311], 0
jne 0x401aaf
cmp word [ebp - 0x310], 0x5c
je 0x401aaf
push dword [ebp - 0x318]
call fcn.0040169b
pop ecx
jmp 0x401ab5
push 0xce
jmp 0x401aa5
push 0xa1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x401ad2
mov eax, dword [ebp - 0x318]
push esi
lea ecx, [ebp - 0x310]
push ecx
push eax
push dword [ebp - 0x318]
push dword [ebp - 0x318]
call fcn.004016bb
add esp, 0x14
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.00401ae1
leave
ret