Function at 0x406b20
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 8]
mov dword [ebp - 0x10], ebx
mov dword [ebp - 8], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp - 0xc], edi
jne 0x406b6e
push dword [ebp + 8]
push str.GetTTFNameString
push str._s:_failed_opening_file___s__n
call fcn.00405fe2
add esp, 0xc
jmp 0x406d9b
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
lea eax, [ebp - 8]
push eax
push 0xc
lea eax, [ebp - 0x38]
push eax
push edi
call esi
movzx ax, byte [ebp - 0x33]
mov ah, byte [ebp - 0x34]
mov word [ebp - 0x34], ax
movzx ax, byte [ebp - 0x37]
mov ah, byte [ebp - 0x38]
mov word [ebp - 0x38], ax
cmp word [ebp - 0x38], 1
movzx ax, byte [ebp - 0x35]
mov ah, byte [ebp - 0x36]
mov word [ebp - 0x36], ax
jne 0x406da0
cmp ax, bx
jne 0x406da0
cmp word [ebp - 0x34], bx
mov dword [ebp - 4], ebx
jbe 0x406d94
push ebx
lea eax, [ebp - 8]
push eax
push 0x10
lea eax, [ebp - 0x48]
push eax
push edi
call esi
push 5
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea eax, [ebp - 0x18]
push eax
push str.name
mov byte [ebp - 0x14], bl
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x406c0c
movzx eax, word [ebp - 0x34]
inc dword [ebp - 4]
cmp dword [ebp - 4], eax
jl 0x406bc7
jmp 0x406d94
mov eax, dword [ebp - 0x3c]
xor ecx, ecx
mov ch, byte [ebp - 0x3c]
shr eax, 0x10
xor edx, edx
mov dh, al
movzx eax, ah
mov cl, byte [ebp - 0x3b]
push ebx
push ebx
movzx edx, dx
shl ecx, 0x10
or ecx, edx
or ecx, eax
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x3c], ecx
xor ecx, ecx
mov ch, byte [ebp - 0x40]
shr eax, 0x10
xor edx, edx
mov dh, al
movzx eax, ah
mov cl, byte [ebp - 0x3f]
movzx edx, dx
shl ecx, 0x10
or ecx, edx
or ecx, eax
push ecx
push edi
mov dword [ebp - 0x40], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 8]
push eax
push 6
lea eax, [ebp - 0x20]
push eax
push edi
call esi
movzx ax, byte [ebp - 0x1d]
mov ah, byte [ebp - 0x1e]
mov dword [ebp - 4], ebx
mov word [ebp - 0x1e], ax
cmp word [ebp - 0x1e], bx
movzx ax, byte [ebp - 0x1b]
mov ah, byte [ebp - 0x1c]
mov word [ebp - 0x1c], ax
jbe 0x406d94
push ebx
lea eax, [ebp - 8]
push eax
push 0xc
lea eax, [ebp - 0x2c]
push eax
push edi
call esi
movzx ax, byte [ebp - 0x25]
mov ah, byte [ebp - 0x26]
mov word [ebp - 0x26], ax
movzx ax, byte [ebp - 0x2b]
mov ah, byte [ebp - 0x2c]
mov word [ebp - 0x2c], ax
movzx ax, byte [ebp - 0x27]
mov ah, byte [ebp - 0x28]
mov word [ebp - 0x28], ax
movzx ax, byte [ebp - 0x23]
mov ah, byte [ebp - 0x24]
mov word [ebp - 0x24], ax
movzx ax, byte [ebp - 0x21]
mov ah, byte [ebp - 0x22]
mov word [ebp - 0x22], ax
movzx eax, word [ebp - 0x26]
cmp eax, dword [ebp + 0xc]
jne 0x406cef
cmp word [ebp - 0x2c], 3
jne 0x406cef
cmp word [ebp - 0x28], 0x409
je 0x406d00
movzx eax, word [ebp - 0x1e]
inc dword [ebp - 4]
cmp dword [ebp - 4], eax
jl 0x406c8d
jmp 0x406d94
movzx eax, word [ebp - 0x22]
movzx ecx, word [ebp - 0x1c]
add eax, dword [ebp - 0x40]
movzx edi, word [ebp - 0x24]
push ebx
push ebx
add ecx, eax
push ecx
push dword [ebp - 0xc]
shr edi, 1
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
movzx eax, word [ebp - 0x24]
inc eax
inc eax
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push ebx
lea ecx, [ebp - 8]
push ecx
movzx ecx, word [ebp - 0x24]
push ecx
push eax
push dword [ebp - 0xc]
mov dword [ebp - 4], eax
call esi
xor esi, esi
cmp edi, ebx
jle 0x406d5c
mov eax, dword [ebp - 4]
lea eax, [eax + esi*2]
movzx cx, byte [eax + 1]
mov ch, byte [eax]
inc esi
cmp esi, edi
mov word [eax], cx
jl 0x406d47
mov esi, dword [ebp - 4]
push ebx
push ebx
push dword [ebp + 0x14]
mov word [esi + edi*2], bx
push dword [ebp + 0x10]
push edi
push esi
push ebx
push 0x4e4
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, ebx
mov ecx, dword [ebp + 0x10]
mov byte [eax + ecx], bl
je 0x406d8a
mov dword [ebp - 0x10], 1
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edi, dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x10]
jmp 0x406da2
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret