Function at 0x40c8d0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x228
push ebx
push ebp
push esi
push edi
mov ecx, 0x7f
xor eax, eax
lea edi, [esp + 0x39]
mov byte [esp + 0x38], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x23c]
test eax, eax
jne 0x40c907
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x228
ret
mov eax, dword [eax]
push 0x420c40
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x40c938
push str._not_found_
call fcn.0040c4f0
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x228
ret
mov ecx, 7
xor eax, eax
lea edi, [esp + 0x19]
mov byte [esp + 0x18], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, str.MEG_Font_v1
or ecx, 0xffffffff
xor eax, eax
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ebp
push ecx
lea ecx, [esp + 0x20]
push 1
push ecx
mov dword [esp + 0x20], 0
call ebx
add esp, 0x10
lea esi, [esp + 0x18]
mov edi, str.MEG_Font_v1
mov dl, byte [edi]
mov cl, byte [esi]
mov al, dl
cmp dl, cl
jne 0x40c9a9
test al, al
je 0x40c9a5
mov cl, byte [edi + 1]
mov dl, byte [esi + 1]
mov al, cl
cmp cl, dl
jne 0x40c9a9
add edi, 2
add esi, 2
test al, al
jne 0x40c981
xor eax, eax
jmp 0x40c9ae
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40c9ba
mov dword [esp + 0x10], 1
lea edi, [esp + 0x18]
mov esi, str.MEG_Font_v2
mov dl, byte [esi]
mov cl, byte [edi]
mov al, dl
cmp dl, cl
jne 0x40c9eb
test al, al
je 0x40c9e7
mov cl, byte [esi + 1]
mov dl, byte [edi + 1]
mov al, cl
cmp cl, dl
jne 0x40c9eb
add esi, 2
add edi, 2
test al, al
jne 0x40c9c3
xor eax, eax
jmp 0x40c9f0
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40ca38
mov dword [esp + 0x10], 2
mov edi, dword [sym.imp.MSVCRT.dll_fgetc]
push ebp
call edi
push ebp
lea esi, [esp + 0x40]
call edi
add esp, 8
test eax, eax
je 0x40ca20
mov byte [esi], al
push ebp
inc esi
call edi
add esp, 4
test eax, eax
jne 0x40ca13
mov al, byte [esp + 0x38]
test al, al
jne 0x40ca61
mov esi, dword [esp + 0x23c]
mov dword [esi + 4], 0
jmp 0x40caae
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40c9fc
push str._bad_header_
call fcn.0040c4f0
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x228
ret
lea edx, [esp + 0x38]
test edx, edx
je 0x40caa2
lea edi, [esp + 0x38]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edx, eax
lea edi, [esp + 0x3c]
or ecx, 0xffffffff
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x23c]
mov esi, ecx
mov dword [ecx + 4], edx
push ebp
push 4
lea edx, [esi + 8]
push 1
push edx
call ebx
push ebp
push 4
lea eax, [esi + 0xc]
push 1
push eax
call ebx
push ebp
push 4
lea ecx, [esi + 0x10]
push 1
push ecx
call ebx
push ebp
push 0x100
lea edx, [esi + 0x14]
push 1
push edx
call ebx
add esp, 0x40
add esi, 0x118
mov dword [esp + 0x14], 0x100
lea edi, [esi - 2]
push ebp
push 2
push 1
lea eax, [edi - 2]
push eax
call ebx
mov eax, dword [esp + 0x20]
add esp, 0x10
cmp eax, 2
jl 0x40cb13
push ebp
push 2
push 1
push edi
call ebx
add esp, 0x10
push ebp
push 2
push 1
push esi
call ebx
push ebp
lea edi, [esi + 8]
push 2
push 1
push edi
call ebx
push ebp
lea eax, [esi + 0xc]
push 2
push 1
push eax
call ebx
mov cx, word [edi]
add esp, 0x30
inc cx
mov word [esi], cx
mov eax, dword [edi]
test eax, eax
je 0x40cb74
mov eax, dword [esi + 0xc]
test eax, eax
je 0x40cb74
mov byte [esi + 0x10], 1
mov edx, dword [esi + 0xc]
imul edx, dword [edi]
shl edx, 2
push edx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov dword [esi + 0x14], eax
mov ecx, dword [esi + 0xc]
imul ecx, dword [edi]
shl ecx, 2
push ebp
push ecx
push 1
push eax
call ebx
add esp, 0x14
jmp 0x40cb7b
mov dword [esi + 0x14], 0
mov eax, dword [esp + 0x14]
add esi, 0x64
dec eax
mov dword [esp + 0x14], eax
jne 0x40caee
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x228
ret