Function at 0x401e9d
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 0x401edb
xor eax, eax
jmp 0x40219e
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 0x402176
mov edi, dword [ebp - 0x31c]
xor ecx, ecx
mov byte [ebp - 0x311], 0
cmp edi, esi
jbe 0x40214c
mov bl, byte [ebp + ecx - 0x108]
inc ecx
test bl, bl
je 0x40216b
cmp bl, 0xa
je 0x402129
cmp bl, 0xd
je 0x402129
cmp bl, 0x3a
jne 0x401f4d
mov byte [ebp - 0x311], 1
cmp bl, 0x7f
ja 0x401f5b
movzx ax, bl
jmp 0x40211e
mov al, bl
add al, 0x3e
cmp al, 0x1d
ja 0x401f99
cmp ecx, edi
jae 0x401f99
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x401f99
cmp al, 0xbf
ja 0x401f99
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 0x40213b
mov eax, edi
sub eax, ecx
cmp eax, 1
jbe 0x40202f
cmp bl, 0xe0
jne 0x401fba
mov al, byte [ebp + ecx - 0x108]
cmp al, 0xa0
jb 0x40202f
cmp al, 0xbf
jbe 0x401fef
cmp bl, 0xe1
jb 0x401fc4
cmp bl, 0xec
jbe 0x401fcc
mov al, bl
add al, 0x12
cmp al, 1
ja 0x401fdb
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x401fdb
cmp al, 0xbf
jbe 0x401fef
cmp bl, 0xed
jne 0x40202f
mov al, byte [ebp + ecx - 0x108]
cmp al, 0x80
jb 0x40202f
cmp al, 0x9f
ja 0x40202f
mov dl, byte [ebp + ecx - 0x107]
cmp dl, 0x80
jb 0x40202f
cmp dl, 0xbf
ja 0x40202f
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 0x40213b
lea eax, [edi - 2]
cmp eax, 1
jbe 0x40216b
cmp bl, 0xf0
jne 0x402055
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x90
jb 0x40216b
cmp dl, 0xbf
jbe 0x402090
mov al, bl
add al, 0xf
cmp al, 2
ja 0x40206e
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x80
jb 0x40206e
cmp dl, 0xbf
jbe 0x402090
cmp bl, 0xf4
jne 0x40216b
mov dl, byte [ebp + ecx - 0x108]
cmp dl, 0x80
jb 0x40216b
cmp dl, 0x8f
ja 0x40216b
mov al, byte [ebp + ecx - 0x107]
mov byte [ebp - 0x313], al
cmp al, 0x80
jb 0x40216b
cmp al, 0xbf
ja 0x40216b
mov al, byte [ebp + ecx - 0x106]
mov byte [ebp - 0x312], al
cmp al, 0x80
jb 0x40216b
cmp al, 0xbf
ja 0x40216b
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 0x40213b
cmp esi, 0x104
je 0x402164
xor eax, eax
mov word [ebp + esi*2 - 0x310], ax
cmp ecx, edi
jb 0x401f1f
cmp byte [ebp - 0x311], 0
jne 0x40217a
cmp word [ebp - 0x310], 0x5c
je 0x40217a
push dword [ebp - 0x318]
call fcn.00401d66
pop ecx
jmp 0x402180
push 0xce
jmp 0x402170
push 0xa1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40219d
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.00401d86
add esp, 0x14
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.004021ac
leave
ret