Function at 0x40c3d0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x14154
call fcn.004148b0
push ebx
push esi
push edi
mov ebx, ecx
lea eax, [ebx + 0xc]
push 0x4190c4
push eax
call dword [sym.imp.MSVCR71.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
mov dword [esp + 0x14], esi
jne 0x40c40c
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
xor eax, eax
mov byte [esp + 0x58], 0
mov ecx, 0x40
lea edi, [esp + 0x59]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [0x417080]
push str.Rav.tst
lea eax, [esp + 0x5c]
push eax
call edi
mov cl, byte [ebx + 0x138]
test cl, cl
lea eax, [ebx + 0x138]
je 0x40c44b
push eax
lea ecx, [esp + 0x5c]
push ecx
call edi
lea eax, [esp + 0x58]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c452
sub eax, edx
mov edx, dword [ebx + 0x2c0]
push 0
lea eax, [edx + eax + 0x1e]
push eax
push esi
call dword [sym.imp.MSVCR71.dll_fseek]
push 0x38
push 0x4190b4
xor eax, eax
push eax
push 8
push 0xfffffffffffffff1
mov ecx, 0xe
lea edi, [esp + 0x40]
rep stosd dword es:[edi], eax
push 8
lea ecx, [esp + 0x44]
push 0xffffffffffffffff
push ecx
mov dword [esp + 0x48], 0
mov dword [esp + 0x70], 0x40c3c0
mov dword [esp + 0x6c], 0x40c3a0
call fcn.0040dc00
add esp, 0x2c
xor eax, eax
jmp 0x40c4c0
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
lea ecx, [ecx]
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jae 0x40c5cf
sub ecx, eax
cmp ecx, 0xa000
mov dword [esp + 0x18], 0xa000
ja 0x40c4e1
mov dword [esp + 0x18], ecx
mov edx, dword [ebp + 0xc]
mov ecx, dword [esp + 0x18]
lea esi, [eax + edx]
mov edx, ecx
shr ecx, 2
lea edi, [esp + 0xa160]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, edx
test ecx, ecx
je 0x40c5cb
add eax, 0xa000
push ecx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x14], eax
lea eax, [esp + 0xa164]
push eax
push ecx
call fcn.0040f2a0
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x24]
add esp, 0xc
test eax, eax
lea edx, [esp + 0xa160]
lea ecx, [esp + 0x160]
mov esi, 0xa000
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], esi
jbe 0x40c59f
mov eax, dword [esp + 0x30]
test eax, eax
jne 0x40c588
mov edx, dword [esp + 0x14]
push edx
push 1
lea eax, [esp + 0x168]
push esi
push eax
call dword [sym.imp.MSVCR71.dll_fwrite]
lea ecx, [esp + 0x170]
add esp, 0x10
mov dword [esp + 0x30], esi
mov dword [esp + 0x2c], ecx
lea edx, [esp + 0x20]
push 0
push edx
call fcn.0040e050
mov eax, dword [esp + 0x2c]
add esp, 8
test eax, eax
ja 0x40c558
mov ecx, dword [esp + 0x30]
mov eax, esi
sub eax, ecx
je 0x40c4b5
mov ecx, dword [esp + 0x14]
push ecx
push 1
push eax
lea edx, [esp + 0x16c]
push edx
call dword [sym.imp.MSVCR71.dll_fwrite]
add esp, 0x10
jmp 0x40c4b5
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x160]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], 0xa000
mov eax, dword [esp + 0x30]
test eax, eax
jne 0x40c616
push esi
push 1
lea ecx, [esp + 0x168]
push 0xa000
push ecx
call dword [sym.imp.MSVCR71.dll_fwrite]
lea edx, [esp + 0x170]
add esp, 0x10
mov dword [esp + 0x30], 0xa000
mov dword [esp + 0x2c], edx
lea eax, [esp + 0x20]
push 4
push eax
call fcn.0040e050
add esp, 8
test eax, eax
je 0x40c5e2
mov ecx, dword [esp + 0x30]
mov edi, dword [sym.imp.MSVCR71.dll_fwrite]
mov eax, 0xa000
sub eax, ecx
je 0x40c64d
push esi
push 1
push eax
lea ecx, [esp + 0x16c]
push ecx
call edi
add esp, 0x10
push esi
call dword [sym.imp.MSVCR71.dll_ftell]
mov dword [esp + 0x14], eax
lea eax, [ebx + 0x264]
mov ecx, eax
add esp, 4
xor edx, edx
mov dword [ecx], edx
mov dword [ecx + 4], edx
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], edx
mov dword [ecx + 0x10], edx
mov dword [ecx + 0x14], edx
mov dword [ecx + 0x18], edx
mov word [ecx + 0x1c], dx
mov ecx, dword [esp + 0x34]
mov dword [eax], 0x4034b50
mov eax, dword [esp + 0x28]
mov word [ebx + 0x26a], dx
mov edx, dword [esp + 0x1c]
mov dword [ebx + 0x27a], eax
lea eax, [esp + 0x58]
mov dword [ebx + 0x276], ecx
mov dword [ebx + 0x272], edx
lea ecx, [eax + 1]
nop
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40c6b0
mov edx, dword [ebx + 0x2c0]
push 0
push edx
sub eax, ecx
push esi
mov word [ebx + 0x27e], ax
mov word [ebx + 0x26c], 8
mov word [ebx + 0x268], 0x14
call dword [sym.imp.MSVCR71.dll_fseek]
push esi
push 1
lea eax, [ebx + 0x264]
push 0x1e
push eax
call edi
lea eax, [esp + 0x74]
add esp, 0x1c
lea ecx, [eax + 1]
lea ebx, [ebx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40c700
push esi
sub eax, ecx
push 1
push eax
lea eax, [ebx + 0x138]
push eax
call edi
mov eax, dword [esp + 0x20]
push 0
push eax
push esi
call dword [sym.imp.MSVCR71.dll_fseek]
mov ecx, dword [ebx + 0x2bc]
mov edx, dword [ebx + 0x2d4]
push esi
push 1
push ecx
push edx
call edi
mov eax, dword [ebx + 0x2d4]
push eax
call sub.MSVCR71.dll_free
lea edx, [ebx + 0x282]
add esp, 0x30
xor eax, eax
mov dword [ebx + 0x2d4], 0
mov ecx, 0xb
mov edi, edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov cx, word [ebx + 0x26c]
mov eax, 0x14
mov word [ebx + 0x286], ax
mov word [ebx + 0x288], ax
mov eax, dword [ebx + 0x272]
mov dword [ebx + 0x292], eax
mov eax, dword [ebx + 0x27a]
mov word [ebx + 0x28c], cx
mov ecx, dword [ebx + 0x276]
mov dword [ebx + 0x29a], eax
lea eax, [esp + 0x58]
mov dword [edx], 0x2014b50
mov dword [ebx + 0x296], ecx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c7b5
mov ecx, dword [ebx + 0x2c0]
push esi
push 1
sub eax, edi
mov edi, dword [sym.imp.MSVCR71.dll_fwrite]
push 0x2e
push edx
mov word [ebx + 0x29e], ax
mov dword [ebx + 0x2ac], ecx
call edi
lea eax, [esp + 0x68]
add esp, 0x10
lea ecx, [eax + 1]
lea esp, [esp]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40c7f0
push esi
sub eax, ecx
push 1
push eax
lea edx, [esp + 0x64]
push edx
call edi
mov eax, dword [esp + 0x20]
add esp, 0x10
inc word [ebx + 0x2b8]
inc word [ebx + 0x2ba]
mov dword [ebx + 0x2c0], eax
mov eax, dword [ebx + 0x2bc]
add eax, 0x2e
mov dword [ebx + 0x2bc], eax
mov ecx, eax
lea eax, [esp + 0x58]
lea edx, [eax + 1]
mov dword [esp + 0x10], edx
jmp 0x40c840
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40c840
mov edx, dword [esp + 0x10]
push esi
sub eax, edx
add ecx, eax
push 1
lea eax, [ebx + 0x2b0]
push 0x16
push eax
mov dword [ebx + 0x2bc], ecx
mov word [ebx + 0x2c4], 0
call edi
lea ecx, [esp + 0x30]
push ecx
call fcn.0040e3b0
push esi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 0x18
lea eax, [ebx + 0xc]
push eax
mov ecx, ebx
call fcn.0040c2d0
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 0xc