Function at 0x1004eeb
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x634
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0x628], edi
cmp dword [esi + 0x30], ebx
je 0x1004f1e
push 0xd
pop eax
jmp 0x10051c1
cmp dword [esi + 0x2c], ebx
je 0x10051bf
cmp dword [esi + 0x28], ebx
jne 0x10051bf
lea eax, [ebp - 0x61c]
push eax
push edi
call fcn.01004e41
cmp eax, ebx
jne 0x10051c1
lea eax, [ebp - 0x620]
push eax
push dword [edi + 0x2c]
lea eax, [ebp - 0x61c]
push ebx
push 0x2000080
push 2
push 4
push 0x40000000
push eax
call fcn.0100611d
cmp eax, ebx
jne 0x10051c1
mov eax, dword [esi + 0x14]
push 0x28
pop ebx
mov dword [eax + 0x10], ebx
lea eax, [ebp - 0x62c]
push eax
push dword [esi + 0x18]
call fcn.010045b3
mov ecx, dword [esi + 0x14]
mov dword [ecx + 0x14], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [ecx + 0x14]
mov edx, eax
and dl, 7
movzx edx, dl
neg edx
sbb edx, edx
and eax, 0xfffffff8
and edx, 8
lea edi, [edx + eax + 0x28]
lea eax, [ebp - 0x634]
push eax
mov dword [ecx + 0x18], edi
push dword [esi + 0x1c]
call fcn.010045b3
mov ecx, dword [esi + 0x14]
mov dword [ecx + 0x1c], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [ecx + 0x1c]
mov edx, eax
and dl, 7
movzx edx, dl
neg edx
sbb edx, edx
and eax, 0xfffffff8
add eax, edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
and edx, 8
add edx, eax
mov dword [ecx + 0x20], edx
mov eax, dword [esi + 0x14]
mov ecx, dword [eax + 0x24]
shl ecx, 3
and ecx, 0xfffffff8
add ecx, edx
mov dword [eax + 0xc], ecx
push 0
lea eax, [ebp - 0x624]
push eax
push ebx
push dword [esi + 0x14]
push dword [ebp - 0x620]
call edi
test eax, eax
je 0x10051d2
mov eax, dword [esi + 0x14]
mov eax, dword [eax + 0x10]
sub eax, dword [ebp - 0x624]
push eax
push dword [ebp - 0x620]
call fcn.01004b1b
test eax, eax
je 0x10051d2
mov eax, dword [esi + 0x14]
mov ebx, dword [eax + 0x10]
push 0
lea ecx, [ebp - 0x624]
push ecx
push dword [eax + 0x14]
push dword [ebp - 0x62c]
push dword [ebp - 0x620]
call edi
test eax, eax
je 0x10051d2
mov eax, dword [esi + 0x14]
add ebx, dword [ebp - 0x624]
mov eax, dword [eax + 0x18]
sub eax, ebx
push eax
push dword [ebp - 0x620]
call fcn.01004b1b
test eax, eax
je 0x10051d2
mov eax, dword [esi + 0x14]
mov ebx, dword [eax + 0x18]
push 0
lea ecx, [ebp - 0x624]
push ecx
push dword [eax + 0x1c]
push dword [ebp - 0x634]
push dword [ebp - 0x620]
call edi
test eax, eax
je 0x10051d2
mov eax, dword [esi + 0x14]
add ebx, dword [ebp - 0x624]
mov eax, dword [eax + 0x20]
sub eax, ebx
push eax
push dword [ebp - 0x620]
call fcn.01004b1b
test eax, eax
je 0x10051d2
mov eax, dword [esi + 0x14]
mov ebx, dword [eax + 0x20]
mov eax, dword [eax + 0x24]
push 0
lea ecx, [ebp - 0x624]
push ecx
shl eax, 3
push eax
push dword [esi + 0x20]
push dword [ebp - 0x620]
call edi
test eax, eax
je 0x10051d2
mov eax, dword [esi + 0x14]
add ebx, dword [ebp - 0x624]
mov eax, dword [eax + 0xc]
sub eax, ebx
push eax
push dword [ebp - 0x620]
call fcn.01004b1b
test eax, eax
je 0x10051d2
push dword [ebp - 0x620]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov edi, dword [ebp - 0x628]
lea eax, [ebp - 0x630]
push eax
push dword [edi + 0x2c]
lea eax, [ebp - 0x414]
push 0
push 0x2000080
push 3
push 5
push 0x80000000
push eax
call fcn.0100611d
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x1005183
lea eax, [ebp - 0x20c]
push eax
push edi
call fcn.01004d04
push dword [edi + 0x2c]
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push eax
call fcn.01006274
push dword [ebp - 0x630]
call ebx
push dword [edi + 0x2c]
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x61c]
push eax
call fcn.01006274
push dword [ebp - 0x620]
call ebx
lea eax, [ebp - 0x20c]
push eax
push edi
call fcn.01004d04
lea eax, [ebp - 0x61c]
push eax
push edi
call fcn.01004d04
and dword [esi + 0x2c], 0
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.01002c39
leave
ret 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [ebp - 0x628]
push dword [eax + 0x2c]
lea eax, [ebp - 0x61c]
push eax
call fcn.010061f8
push dword [ebp - 0x620]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
jmp 0x10051c1