Function at 0x404d00
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x406668
push eax
mov dword fs:[0], esp
sub esp, 0x50
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, 8
mov eax, str.data.idx
mov esi, ebx
call fcn.00402040
cmp dword [ebx + 0x14], 0x10
jb 0x404d3c
mov eax, dword [ebx]
jmp 0x404d3e
mov eax, ebx
push eax
lea eax, [ebp - 0x3c]
push eax
call fcn.00404930
add esp, 8
lea esi, [ebx + 0x1c]
mov edi, eax
mov dword [ebp - 4], 0
call fcn.00405120
mov esi, 0x10
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x28], esi
jb 0x404d7a
mov ecx, dword [ebp - 0x3c]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov edx, dword [sym.imp.MSVCR100.dll__fmode]
mov dword [edx], 0x8000
cmp dword [ebx + 0x14], esi
jb 0x404d8f
mov eax, dword [ebx]
jmp 0x404d91
mov eax, ebx
push 0x4074b4
push eax
call dword [sym.imp.MSVCR100.dll_fopen]
xor ecx, ecx
add esp, 8
mov dword [ebx + 0x38], eax
cmp eax, ecx
je 0x404ee5
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
push eax
push 1
lea eax, [ebx + 0x44]
push 4
push eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ecx
call edi
mov edx, dword [ebx + 0x38]
movzx ecx, byte [ebx + 0x64]
push edx
push 1
lea eax, [ebp - 0x18]
xor ecx, 0x55
push 1
push eax
mov dword [ebp - 0x18], ecx
call edi
add esp, 0x20
cmp byte [ebx + 0x64], 0
mov byte [ebp - 0xd], 0
jbe 0x404ed1
movzx esi, byte [ebp - 0xd]
mov ecx, dword [ebx + 0x68]
xor eax, eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], eax
mov eax, dword [ecx + esi*4]
cmp dword [eax + 0x14], 0x10
lea ecx, [ecx + esi*4]
jb 0x404e1f
mov eax, dword [eax]
lea edx, [eax + 1]
mov dword [ebp - 0x20], edx
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x404e25
sub eax, dword [ebp - 0x20]
movzx edx, ax
mov dword [ebp - 0x14], edx
mov eax, dword [ecx]
cmp dword [eax + 0x14], 0x10
jb 0x404e3f
mov eax, dword [eax]
movsx ecx, dx
push ecx
push eax
lea edx, [ebp - 0x5c]
push edx
call sub.MSVCR100.dll_memcpy
mov eax, dword [ebx + 0x38]
push eax
push 1
lea ecx, [ebp - 0x14]
push 1
push ecx
call edi
mov edx, dword [ebx + 0x38]
movsx eax, word [ebp - 0x14]
push edx
push 1
push eax
lea ecx, [ebp - 0x5c]
push ecx
call edi
add esp, 0x2c
lea edx, [ebp - 0x5c]
push edx
mov eax, ebx
call fcn.00405000
mov ecx, esi
and ecx, 0x3f
movzx edx, word [ecx*8 + 0x407750]
xor eax, edx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebx + 0x38]
push eax
push 1
lea ecx, [ebp - 0x1c]
push 4
push ecx
call edi
mov edx, dword [ebx + 0x68]
mov eax, dword [edx + esi*4]
mov ecx, dword [eax + 0x1c]
mov ebx, dword [ebx + 0x38]
add esp, 0x10
push ecx
call fcn.004053b0
mov edx, dword [ebp + 8]
xor eax, eax
mov dword [0x40fe7c], eax
mov dword [0x40fe80], eax
mov al, byte [ebp - 0xd]
inc al
mov byte [ebp - 0xd], al
mov ebx, edx
cmp al, byte [edx + 0x64]
jb 0x404df0
mov eax, dword [ebx + 0x38]
push eax
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov dword [ebx + 0x38], 0
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4