Function at 0x401498
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 0x4014d6
xor eax, eax
jmp 0x401799
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 0x401771
mov edi, dword [ebp - 0x31c]
xor ecx, ecx
mov byte [ebp - 0x311], 0
cmp edi, esi
jbe 0x401747
mov bl, byte [ebp + ecx - 0x108]
inc ecx
test bl, bl
je 0x401766
cmp bl, 0xa
je 0x401724
cmp bl, 0xd
je 0x401724
cmp bl, 0x3a
jne 0x401548
mov byte [ebp - 0x311], 1
cmp bl, 0x7f
ja 0x401556
movzx ax, bl
jmp 0x401719
mov al, bl
add al, 0x3e
cmp al, 0x1d
ja 0x401594
cmp ecx, edi
jae 0x401594
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x401594
cmp al, 0xbf
ja 0x401594
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 0x401736
mov eax, edi
sub eax, ecx
cmp eax, 1
jbe 0x40162a
cmp bl, 0xe0
jne 0x4015b5
mov al, byte [ebp + ecx - 0x108]
cmp al, 0xa0
jb 0x40162a
cmp al, 0xbf
jbe 0x4015ea
cmp bl, 0xe1
jb 0x4015bf
cmp bl, 0xec
jbe 0x4015c7
mov al, bl
add al, 0x12
cmp al, 1
ja 0x4015d6
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x4015d6
cmp al, 0xbf
jbe 0x4015ea
cmp bl, 0xed
jne 0x40162a
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x40162a
cmp al, 0x9f
ja 0x40162a
mov dl, byte [ebp + ecx - 0x107]
cmp dl, 0x80
jb 0x40162a
cmp dl, 0xbf
ja 0x40162a
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 0x401736
lea eax, [edi - 2]
cmp eax, 1
jbe 0x401766
cmp bl, 0xf0
jne 0x401650
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x90
jb 0x401766
cmp dl, 0xbf
jbe 0x40168b
mov al, bl
add al, 0xf
cmp al, 2
ja 0x401669
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x80
jb 0x401669
cmp dl, 0xbf
jbe 0x40168b
cmp bl, 0xf4
jne 0x401766
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x80
jb 0x401766
cmp dl, 0x8f
ja 0x401766
mov al, byte [ebp + ecx - 0x107]
mov byte [ebp - 0x313], al
cmp al, 0x80
jb 0x401766
cmp al, 0xbf
ja 0x401766
mov al, byte [ebp + ecx - 0x106]
mov byte [ebp - 0x312], al
cmp al, 0x80
jb 0x401766
cmp al, 0xbf
ja 0x401766
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 0x401736
cmp esi, 0x104
je 0x40175f
xor eax, eax
mov word [ebp + esi*2 - 0x310], ax
cmp ecx, edi
jb 0x40151a
cmp byte [ebp - 0x311], 0
jne 0x401775
cmp word [ebp - 0x310], 0x5c
je 0x401775
push dword [ebp - 0x318]
call fcn.00401361
pop ecx
jmp 0x40177b
push 0xce
jmp 0x40176b
push 0xa1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x401798
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.00401381
add esp, 0x14
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.004017b4
leave
ret