Function at 0x40d180
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x54
push ebx
push esi
mov ebx, ecx
mov eax, dword [ebx + 0x2bc]
push edi
xor esi, esi
xor edi, edi
test eax, eax
jne 0x40d1a1
pop edi
pop esi
xor al, al
pop ebx
add esp, 0x54
ret 4
test eax, eax
push ebp
jbe 0x40d208
mov ebp, dword [esp + 0x68]
lea ebx, [ebx]
mov esi, dword [ebx + 0x2d4]
mov eax, dword [esi + edi]
add esi, edi
cmp eax, 0x2014b50
jne 0x40d25a
mov eax, ebp
lea edx, [eax + 1]
jmp 0x40d1d0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40d1d0
sub eax, edx
push eax
lea eax, [esi + 0x2e]
push eax
push ebp
call dword [sym.imp.MSVCR71.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x40d208
movzx ecx, word [esi + 0x20]
movzx edx, word [esi + 0x1e]
movzx eax, word [esi + 0x1c]
add eax, edi
add ecx, edx
lea edi, [eax + ecx + 0x2e]
cmp edi, dword [ebx + 0x2bc]
jb 0x40d1b0
cmp edi, dword [ebx + 0x2bc]
jae 0x40d25a
cmp dword [esi], 0x2014b50
mov dword [esp + 0x68], edi
jne 0x40d25a
lea eax, [ebx + 0xc]
push 0x4190c4
push eax
call dword [sym.imp.MSVCR71.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x40d25a
mov edi, dword [sym.imp.MSVCR71.dll_fseek]
push 2
push 0
push ebp
call edi
push ebp
call dword [sym.imp.MSVCR71.dll_ftell]
add esp, 0x10
cmp eax, 0x62
jae 0x40d266
push ebp
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 4
pop ebp
pop edi
pop esi
xor al, al
pop ebx
add esp, 0x54
ret 4
mov ecx, dword [esi + 0x2a]
push 0
push ecx
push ebp
call edi
push ebp
push 1
lea edx, [esp + 0x28]
push 0x1e
push edx
call dword [sym.imp.MSVCR71.dll_fread]
movzx eax, word [esp + 0x4a]
mov edx, dword [esp + 0x42]
mov ecx, 0xb
lea edi, [esp + 0x50]
rep movsd dword es:[edi], dword [esi]
movzx ecx, word [esp + 0x4c]
add eax, edx
movsw word es:[edi], word [esi]
movzx edx, word [esp + 0x6e]
lea esi, [ecx + eax + 0x1e]
movzx eax, word [esp + 0x6c]
movzx ecx, word [esp + 0x70]
add edx, eax
mov eax, dword [esp + 0x7a]
add esp, 0x1c
push eax
add eax, esi
lea edi, [edx + ecx + 0x2e]
push eax
push ebp
mov ecx, ebx
mov dword [esp + 0x1c], edi
call fcn.0040cdf0
mov eax, dword [ebx + 0x2bc]
xor edx, edx
test eax, eax
jbe 0x40d319
jmp 0x40d2e0
mov eax, dword [ebx + 0x2d4]
mov ecx, dword [eax + edx + 0x2a]
mov edi, dword [esp + 0x5e]
add eax, edx
cmp ecx, edi
jbe 0x40d2f9
sub ecx, esi
mov dword [eax + 0x2a], ecx
movzx ecx, word [eax + 0x20]
movzx edi, word [eax + 0x1e]
movzx eax, word [eax + 0x1c]
add eax, edx
add ecx, edi
lea edx, [eax + ecx + 0x2e]
cmp edx, dword [ebx + 0x2bc]
jb 0x40d2e0
mov edi, dword [esp + 0x10]
mov ecx, dword [ebx + 0x2c0]
push 0
sub ecx, esi
push ecx
push ebp
call dword [sym.imp.MSVCR71.dll_fseek]
mov eax, dword [esp + 0x74]
add esp, 0xc
test eax, eax
je 0x40d34e
mov edx, dword [ebx + 0x2d4]
push ebp
push 1
push eax
push edx
call dword [sym.imp.MSVCR71.dll_fwrite]
mov eax, dword [esp + 0x78]
add esp, 0x10
mov ecx, dword [ebx + 0x2bc]
mov edx, dword [ebx + 0x2d4]
push ebp
sub ecx, edi
push 1
sub ecx, eax
add edx, edi
push ecx
add edx, eax
push edx
call dword [sym.imp.MSVCR71.dll_fwrite]
mov eax, dword [ebx + 0x2bc]
dec word [ebx + 0x2b8]
dec word [ebx + 0x2ba]
sub eax, edi
mov edi, dword [ebx + 0x2c0]
push ebp
push 1
mov dword [ebx + 0x2bc], eax
lea eax, [ebx + 0x2b0]
push 0x16
sub edi, esi
push eax
mov word [ebx + 0x2c4], 0
mov dword [ebx + 0x2c0], edi
call dword [sym.imp.MSVCR71.dll_fwrite]
push ebp
call dword [sym.imp.MSVCR71.dll_ftell]
push ebp
mov esi, eax
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 0x28
push esi
lea esi, [ebx + 0xc]
push esi
mov ecx, ebx
call fcn.0040ced0
push esi
mov ecx, ebx
call fcn.0040c2d0
mov ecx, dword [ebx + 0x2d0]
pop ebp
pop edi
pop esi
mov dword [ebx + 0x2cc], ecx
mov al, 1
pop ebx
add esp, 0x54
ret 4