Function at 0x403cd0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x40
push ebx
mov ebx, dword [esp + 0x4c]
test ebx, ebx
push ebp
push esi
push edi
je 0x403cea
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x403cea
mov byte [ebx], 0
mov esi, dword [esp + 0x54]
test esi, esi
je 0x403dc9
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
push esi
call edi
cmp eax, 5
jl 0x403dc9
push esi
call edi
lea eax, [eax + esi - 4]
push eax
push str..TTF
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x403dc9
test ebx, ebx
je 0x403dc9
cmp dword [esp + 0x5c], 2
jb 0x403dc9
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x403dc9
push 0
lea ecx, [esp + 0x58]
push ecx
push 0xc
lea edx, [esp + 0x40]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403dc2
cmp dword [esp + 0x54], 0xc
jne 0x403dc2
mov ax, word [esp + 0x38]
xor ebx, ebx
mov bh, al
xor esi, esi
mov bl, ah
test ebx, ebx
jbe 0x403dc2
mov ebp, 0x10
lea esp, [esp]
cmp esi, 0x28
jae 0x403dc2
push 0
lea eax, [esp + 0x58]
push eax
push ebp
lea ecx, [esp + 0x30]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403dc2
cmp dword [esp + 0x54], ebp
jne 0x403dc2
cmp dword [esp + 0x24], 0x656d616e
je 0x403dd3
inc esi
cmp esi, ebx
jb 0x403d90
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
mov eax, dword [esp + 0x2c]
mov esi, eax
mov edx, eax
mov ecx, eax
and esi, 0xff0000
shl ecx, 0x10
shr edx, 0x10
and eax, 0xff00
or esi, edx
or ecx, eax
push 0
shl ecx, 8
shr esi, 8
push 0
or esi, ecx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, esi
jne 0x403dc2
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea edx, [esp + 0x58]
push edx
push 6
lea eax, [esp + 0x1c]
push eax
push edi
call ebx
test eax, eax
je 0x403dc2
cmp dword [esp + 0x54], 6
jne 0x403dc2
mov eax, dword [esp + 0x12]
xor ecx, ecx
mov ch, al
mov cl, ah
mov esi, ecx
test esi, esi
je 0x403dc2
mov ebp, dword [esp + 0x60]
push 0
lea edx, [esp + 0x58]
push edx
push 0xc
lea eax, [esp + 0x24]
push eax
push edi
dec esi
call ebx
test eax, eax
je 0x403dc2
cmp dword [esp + 0x54], 0xc
jne 0x403dc2
cmp ebp, 1
jne 0x403e8b
mov ax, word [esp + 0x18]
movzx cx, ah
mov ch, al
cmp cx, bp
jne 0x403ec5
mov ax, word [esp + 0x1e]
movzx dx, ah
mov dh, al
cmp dx, 5
jmp 0x403ec3
test ebp, ebp
jne 0x403ec5
mov ax, word [esp + 0x18]
movzx cx, ah
mov ch, al
cmp cx, 3
jne 0x403ec5
mov ax, word [esp + 0x1c]
movzx dx, ah
mov dh, al
cmp dx, word [0x415050]
jne 0x403ec5
mov ax, word [esp + 0x1e]
movzx cx, ah
mov ch, al
cmp cx, 4
je 0x403ede
test esi, esi
jne 0x403e40
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x40
ret
mov eax, dword [esp + 0x2c]
mov esi, eax
and esi, 0xff0000
mov edx, eax
mov ecx, eax
shl ecx, 0x10
shr edx, 0x10
or esi, edx
and eax, 0xff00
or ecx, eax
mov ax, word [esp + 0x14]
xor edx, edx
mov dh, al
shl ecx, 8
shr esi, 8
or esi, ecx
mov ebp, dword [esp + 0x5c]
xor ecx, ecx
xor ebx, ebx
mov dl, ah
mov ax, word [esp + 0x22]
mov ch, al
add esi, edx
mov cl, ah
mov eax, dword [esp + 0x20]
mov bh, al
add esi, ecx
dec ebp
mov bl, ah
cmp ebp, ebx
jbe 0x403f38
mov dword [esp + 0x5c], ebx
mov ebp, ebx
push 0
push 0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, esi
jne 0x403dc2
mov esi, dword [esp + 0x58]
push 0
lea edx, [esp + 0x58]
push edx
push ebp
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403dc2
cmp ebp, dword [esp + 0x54]
jne 0x403dc2
push edi
mov byte [esi + ebp], 0
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
lea eax, [ebx + 1]
pop ebx
add esp, 0x40
ret