Function at 0x405510
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40f0b0
mov eax, dword fs:[0]
push eax
sub esp, 0x50
push ebx
push esi
push edi
mov eax, dword [0x414028]
xor eax, esp
push eax
lea eax, [esp + 0x60]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x104c]
test eax, eax
je 0x405848
mov ecx, dword [esi + 0x1050]
sub ecx, eax
mov eax, 0x9ad70599
imul ecx
add edx, ecx
sar edx, 0xa
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x405848
cmp byte [esi + 0x1058], 0
je 0x405848
mov ebx, esi
call fcn.00404db0
lea eax, [esi + 0xc20]
lea edx, [eax + 2]
jmp 0x405590
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405590
sub eax, edx
sar eax, 1
je 0x405848
xor edi, edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], edi
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [esi + 0xc20]
mov dword [esp + 0x6c], edi
call fcn.004052e0
xor ebx, ebx
mov dword [esp + 0x14], edi
lea ecx, [ecx]
mov eax, dword [esi + 0x104c]
cmp eax, edi
je 0x405694
mov ecx, dword [esi + 0x1050]
sub ecx, eax
mov eax, 0x9ad70599
imul ecx
add edx, ecx
sar edx, 0xa
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jae 0x405694
mov eax, dword [esi + 0x104c]
cmp eax, edi
je 0x40562a
mov ecx, dword [esi + 0x1050]
sub ecx, eax
mov eax, 0x9ad70599
imul ecx
add edx, ecx
sar edx, 0xa
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jb 0x40562f
call fcn.00406d7c
mov edx, dword [esi + 0x104c]
add edx, dword [esp + 0x14]
lea edi, [edx + 0x280]
mov eax, edi
lea ecx, [eax + 2]
mov dword [esp + 0x18], ecx
jmp 0x405650
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405650
sub eax, dword [esp + 0x18]
sar eax, 1
cmp byte [edx + 0x69c], cl
setne cl
add eax, 1
push ecx
push eax
push edx
mov edx, dword [edx + 0x698]
push edx
lea edx, [esp + 0x3c]
mov ecx, edi
call fcn.00404b40
add dword [esp + 0x14], 0x69d
add ebx, 1
xor edi, edi
jmp 0x4055d0
mov ebx, dword [esp + 0x30]
cmp ebx, edi
je 0x405848
mov ecx, dword [esp + 0x34]
sub ecx, ebx
mov eax, 0x9ad70599
imul ecx
add edx, ecx
sar edx, 0xa
mov edi, edx
shr edi, 0x1f
add edi, edx
xor eax, eax
cmp edi, eax
jne 0x4056dd
push ebx
call fcn.00406f3a
add esp, 4
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
lea eax, [esp + 0x3c]
mov byte [esp + 0x68], 1
call fcn.00402a40
test edi, edi
ja 0x405700
call fcn.00406d7c
mov edx, dword [esp + 0x30]
mov ecx, edi
imul ecx, ecx, 0x69d
lea eax, [esp + 0x3c]
push eax
lea ebx, [esp + 0x20]
call fcn.00402ac0
test al, al
mov eax, dword [esp + 0x20]
jne 0x405767
xor esi, esi
cmp eax, esi
je 0x405731
push eax
call fcn.00406f3a
add esp, 4
mov eax, dword [esp + 0x30]
cmp eax, esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], esi
je 0x405848
push eax
call fcn.00406f3a
add esp, 4
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
xor edi, edi
cmp eax, edi
je 0x40577e
mov ecx, dword [esp + 0x24]
sub ecx, eax
jne 0x4057b4
push eax
call fcn.00406f3a
add esp, 4
mov eax, dword [esp + 0x30]
cmp eax, edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
je 0x405848
push eax
call fcn.00406f3a
add esp, 4
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push edi
push 0x80
push 4
push edi
push edi
push 0x40000000
lea eax, [esi + 0xc20]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x405836
push edi
push edi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x1c]
call fcn.00406490
test al, al
jne 0x405821
mov ecx, dword [esp + 0x20]
cmp ecx, edi
mov dword [esp + 0x18], edi
jne 0x4057fe
xor eax, eax
jmp 0x405804
mov eax, dword [esp + 0x24]
sub eax, ecx
push edi
lea edx, [esp + 0x1c]
push edx
push eax
xor edi, edi
lea esi, [esp + 0x28]
call fcn.00402fc0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [ebp + 8]
push ebx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [esi + 0x1058], 0
lea esi, [esp + 0x1c]
call fcn.00402f90
lea esi, [esp + 0x2c]
call fcn.00402f90
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4