Function at 0x403e50
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x374
mov eax, dword [0x497040]
xor eax, esp
mov dword [esp + 0x370], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0xc]
push esi
push edi
cmp dword [ebx + 8], 0xffffffff
mov dword [esp + 0x10], eax
je 0x403edc
mov edi, dword [ebp + 0x10]
test edi, edi
je 0x404342
lea ecx, [edi + 0xc]
mov eax, 0x10624dd3
mul ecx
mov eax, 1
shr edx, 6
cmp edx, eax
cmovb edx, eax
lea eax, [edi + 0xc]
add eax, edx
push eax
mov dword [esp + 0x20], eax
call fcn.0042f4e2
push 1
mov esi, eax
lea edx, [esp + 0x24]
push edi
push dword [esp + 0x1c]
mov ecx, esi
mov dword [esp + 0x34], esi
call fcn.004200a0
add esp, 0x10
test eax, eax
je 0x403ef5
push esi
call fcn.0042f4eb
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x370]
xor ecx, esp
call fcn.0042f4a5
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esi]
mov eax, 0x51eb851f
push dword [esp + 0x20]
mul ecx
push 0x104
shr edx, 4
imul eax, edx, 0x32
sub ecx, eax
lea eax, [esp + 0x170]
push eax
mov dword [esp + 0x24], ecx
call fcn.0043dfab
lea eax, [esp + 0x174]
push 0x104
push eax
call fcn.0045818b
add esp, 0x14
lea ecx, [esp + 0x168]
call fcn.00414560
lea eax, [esp + 0x168]
mov ecx, ebx
push eax
call fcn.00403250
cmp eax, 0xffffffff
je 0x4040aa
cmp dword [ebx + 8], 0xffffffff
je 0x4040aa
cmp byte [esp + 0x168], 0x5c
jne 0x403f8c
lea eax, [esp + 0x168]
push eax
lea eax, [esp + 0x274]
push 0x104
push eax
call fcn.0043dfab
add esp, 0xc
jmp 0x403fc2
lea eax, [ebx + 0x11c]
push eax
lea eax, [esp + 0x274]
push 0x104
push eax
call fcn.0043dfab
lea eax, [esp + 0x174]
push eax
lea eax, [esp + 0x280]
push 0x104
push eax
call fcn.0043e068
add esp, 0x18
lea eax, [esp + 0x270]
mov ecx, ebx
push eax
call fcn.00403250
mov esi, eax
cmp esi, 0xffffffff
je 0x4040aa
mov ecx, dword [ebx + 0x2a0]
imul edi, esi, 0x13c
mov dword [ecx + edi + 0x100], 0
mov eax, dword [ebx + 0x2a0]
mov dword [eax + edi + 0x104], 0
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x40403e
mov eax, dword [ebx + 0x114]
lea edx, [esp + 0x14]
push 0
add eax, edi
mov dword [esp + 0x18], 0
push edx
push eax
push ecx
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x40403e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x40406a
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
mov eax, dword [ebx + 0x2a0]
push 0x13c
add eax, edi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebx + 8]
cmp eax, 0xffffffff
je 0x40409a
push 0
lea ecx, [esp + 0x18]
xorps xmm0, xmm0
push ecx
push 0
push eax
movlpd qword [esp + 0x20], xmm0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x40409a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov ecx, ebx
call fcn.004039d0
push esi
mov ecx, ebx
call fcn.00403670
mov edi, dword [esp + 0x1c]
mov ecx, ebx
push edi
call fcn.00403c10
mov dword [esp + 0x10], eax
lea esi, [ebx + 0x2a0]
cmp eax, 0xffffffff
jne 0x4041c9
push 0x13c
lea eax, [esp + 0x2c]
push 0
push eax
call fcn.00431510
lea eax, [esp + 0x174]
push eax
lea eax, [esp + 0x38]
push 0x100
push eax
call fcn.0043dfab
mov eax, dword [ebp + 0x10]
add esp, 0x18
mov dword [esp + 0x12c], eax
mov eax, dword [ebx + 0x114]
mov dword [esp + 0x134], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x138], eax
mov eax, dword [esi + 4]
mov dword [esp + 0x128], edi
mov dword [esp + 0x130], edi
cmp eax, dword [esi + 8]
je 0x40414b
mov ecx, 0x4f
lea esi, [esp + 0x28]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
add dword [ebx + 0x2a4], 0x13c
lea esi, [ebx + 0x2a0]
jmp 0x404158
lea ecx, [esp + 0x28]
push ecx
push eax
mov ecx, esi
call fcn.0040d930
mov ecx, dword [esi]
mov eax, dword [esi + 4]
sub eax, ecx
sar eax, 2
imul edi, eax, 0x613716af
push 0
push 0
dec edi
imul eax, edi, 0x13c
push dword [eax + ecx + 0x10c]
push dword [ebx + 8]
call fcn.00402070
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x4041a9
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
mov eax, dword [esp + 0x24]
push eax
push dword [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 1
push 0
push 0
push dword [ebx + 8]
mov byte [ebx + 0x118], 1
call fcn.00402070
mov dword [ebx + 0x114], eax
jmp 0x4042bb
mov esi, dword [esi]
lea edi, [esp + 0x28]
imul eax, eax, 0x13c
mov ecx, 0x4f
add esi, eax
mov dword [esp + 0x20], eax
lea eax, [esp + 0x168]
push eax
lea eax, [esp + 0x2c]
push 0x100
rep movsd dword es:[edi], dword [esi]
push eax
call fcn.0043dfab
mov eax, dword [esp + 0x28]
lea esi, [esp + 0x34]
mov edi, dword [ebx + 0x2a0]
add esp, 0xc
mov edx, dword [esp + 0x20]
mov ecx, 0x4f
mov dword [esp + 0x128], eax
add edi, edx
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x12c], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x138], eax
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebx + 0x2a0]
lea esi, [ebx + 0x2a0]
push 0
push 0
push dword [eax + edx + 0x10c]
push dword [ebx + 8]
call fcn.00402070
mov eax, dword [ebx + 8]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 0xffffffff
je 0x40427a
push 0
lea ecx, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push ecx
push dword [esp + 0x24]
push dword [esp + 0x30]
push eax
call edi
mov eax, dword [ebx + 0x114]
add eax, dword [esp + 0x20]
push 0
push 0
push eax
push dword [ebx + 8]
call fcn.00402070
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x4042b7
push 0
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
mov eax, dword [esi]
add eax, dword [esp + 0x28]
push 0x13c
push eax
push ecx
call edi
mov edi, dword [esp + 0x10]
mov eax, dword [esi + 4]
sub eax, dword [esi]
sar eax, 2
imul eax, eax, 0x613716af
mov dword [ebx + 0x110], eax
mov eax, dword [ebx + 8]
cmp eax, 0xffffffff
je 0x4042ff
push 0
lea ecx, [esp + 0x18]
xorps xmm0, xmm0
push ecx
push 0
push eax
movlpd qword [esp + 0x20], xmm0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x4042ff
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebx + 8]
cmp ecx, 0xffffffff
je 0x404326
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push 0x110
lea eax, [ebx + 0xc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [esp + 0x24]
call fcn.0042f4eb
add esp, 4
mov ecx, ebx
push edi
call fcn.00403670
push edi
mov ecx, ebx
call fcn.00402310
mov ecx, dword [esp + 0x37c]
mov al, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0042f4a5
mov esp, ebp
pop ebp
ret 0xc