Function at 0x4103c0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x8c
mov dword [esp + 0xc], 1
push ebx
push esi
push edi
mov ebx, ecx
push ebp
mov ebp, dword [ebx + 0x4a0]
mov edx, dword [ebp + 0x3c]
lea eax, [ebp + 0x38]
add ebp, 0x18
mov ecx, dword [eax]
cmp dword [ebx + 0x27c], 3
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
mov eax, dword [esp + 0x20]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
je 0x410447
mov eax, dword [ebx + 0xc]
cdq
cmp edx, dword [esp + 0x24]
jl 0x410434
jg 0x410414
cmp eax, dword [esp + 0x20]
jbe 0x410434
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x24]
mov eax, dword [ebx + 0x26c]
cdq
push edx
push eax
push esi
push ecx
call fcn.00412310
test edx, edx
jne 0x410447
test eax, eax
jne 0x410447
test byte [ebx + 0xf4], 4
jne 0x410447
mov dword [esp + 0x30], 1
jmp 0x41044f
mov dword [esp + 0x30], 0
cmp dword [esp + 0x30], 0
je 0x410480
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x24]
mov eax, dword [ebx + 0x26c]
cdq
push edx
push eax
push esi
push ecx
call fcn.00412310
test edx, edx
jne 0x410476
test eax, eax
je 0x410480
mov dword [esp + 0x38], 1
jmp 0x410488
mov dword [esp + 0x38], 0
mov esi, 0
push 0
cmp dword [esp + 0x34], 1
adc esi, 0xffffffff
mov eax, dword [ebx + 0x140]
and esi, 0x20000000
push esi
push 2
push 0
push 2
push 0x40000000
push eax
call dword [0x416594]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
jne 0x4104f0
push pe_nt_image_headers32
mov eax, dword [ebx + 0x140]
push eax
call dword [0x4165f4]
push 0
mov eax, dword [ebx + 0x140]
push esi
push 2
push 0
push 2
push 0x40000000
push eax
call dword [0x416594]
mov dword [esp + 0x18], eax
cmp dword [esp + 0x18], 0xffffffff
jne 0x41053b
inc dword [ebx + 0x3e4]
mov ecx, dword [ebp]
mov eax, dword [ebp + 4]
push eax
push ecx
mov ecx, ebx
call fcn.00410ea0
push 1
mov eax, dword [ebx + 0x154]
imul eax, dword [0x4165b4]
add eax, dword [ebx + 0x140]
mov ecx, ebx
push eax
push str.CreateFile
call fcn.004113c0
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x8c
ret
cmp dword [esp + 0x38], 0
je 0x410562
push 0
mov eax, dword [ebx + 0x140]
push 0
push 3
push 0
push 2
push 0x40000000
push eax
call dword [0x416594]
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 0x4a0]
mov eax, dword [eax + 0x10]
cdq
cmp edx, dword [esp + 0x24]
jg 0x41062a
jl 0x410582
cmp eax, dword [esp + 0x20]
jae 0x41062a
cmp dword [esp + 0x30], 0
je 0x4105d4
mov eax, dword [ebx + 0x26c]
mov ecx, dword [esp + 0x24]
cdq
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x14], edx
add eax, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
adc ecx, edx
push esi
add eax, 0xffffffff
mov edx, dword [esp + 0x14]
adc ecx, 0xffffffff
push edx
push ecx
push eax
call fcn.004123d0
mov ecx, dword [esp + 0x10]
push esi
push ecx
push edx
push eax
call fcn.004122d0
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
jmp 0x4105e4
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ecx
mov cl, 0x20
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
call fcn.00412480
mov ecx, dword [esp + 0x10]
push 0
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x40], eax
lea eax, [esp + 0x40]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov ecx, dword [esp + 0x18]
push 0
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [esp + 0x24], 0
jl 0x41074c
jg 0x410642
cmp dword [esp + 0x20], 0
jbe 0x41074c
mov eax, dword [ebx + 0x4a0]
mov eax, dword [eax + 0x10]
cdq
cmp edx, dword [esp + 0x2c]
jg 0x41065a
jl 0x41069c
cmp eax, dword [esp + 0x28]
jbe 0x41069c
cmp dword [esp + 0x30], 0
je 0x410698
mov esi, dword [ebx + 0x26c]
mov eax, esi
cdq
mov ecx, edx
mov dword [esp + 0x10], eax
add eax, dword [esp + 0x28]
mov dword [esp + 0x14], edx
adc ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x10]
add eax, 0xffffffff
mov edi, dword [esp + 0x14]
adc ecx, 0xffffffff
push edi
push edx
push ecx
push eax
call fcn.004123d0
imul eax, esi
jmp 0x41069c
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x40]
push 0
push ecx
push eax
mov eax, dword [ebx + 0x4a0]
mov ecx, dword [esp + 0x24]
mov edx, dword [eax + 0xc]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x410843
mov eax, dword [esp + 0x40]
mov dword [esp + 0x10], eax
sub dword [esp + 0x28], eax
mov dword [esp + 0x14], 0
mov ecx, dword [esp + 0x14]
sbb dword [esp + 0x2c], ecx
js 0x410807
jg 0x4106f4
cmp dword [esp + 0x28], 0
jbe 0x410807
lea eax, [ebx + 0x3b8]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
add dword [eax], ecx
adc dword [eax + 4], edx
lea ecx, [esp + 0x44]
cmp ebp, ecx
je 0x410723
mov ebp, ecx
mov esi, dword [ebx + 0x4a0]
mov edi, ecx
add esi, 0x18
mov ecx, 0x14
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
call fcn.00410d90
test eax, eax
je 0x41073e
mov eax, dword [ebx + 0x4a0]
cmp dword [eax + 8], 1
je 0x410822
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
cmp dword [esp + 0x38], 0
je 0x41088f
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x34], 0xffffffff
jne 0x410887
xor esi, esi
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebx + 0x408], 0
jne 0x4107c7
push 0
mov eax, dword [ebx + 0x140]
push 0
inc dword [ebx + 0x3f8]
push 3
push 0
push 2
push 0x40000000
push eax
call dword [0x416594]
mov dword [esp + 0x34], eax
cmp eax, 0xffffffff
jne 0x4107c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
jne 0x4107c7
mov eax, esi
imul eax, esi
inc esi
lea eax, [eax + eax*4]
add eax, eax
push eax
call edi
cmp esi, 0xa
jl 0x410775
cmp dword [esp + 0x34], 0xffffffff
jne 0x410887
push 1
mov eax, dword [ebx + 0x154]
mov ecx, ebx
inc dword [ebx + 0x3e4]
imul eax, dword [0x4165b4]
add eax, dword [ebx + 0x140]
push eax
push str.CreateFile2
call fcn.004113c0
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x8c
ret
lea eax, [ebx + 0x3b8]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
add ecx, dword [esp + 0x28]
adc edx, dword [esp + 0x2c]
add dword [eax], ecx
adc dword [eax + 4], edx
cmp dword [esp + 0x2c], 0
jg 0x410642
jl 0x41074c
cmp dword [esp + 0x28], 0
ja 0x410642
jmp 0x41074c
mov eax, dword [ebp]
mov ecx, dword [ebp + 4]
push ecx
push eax
mov ecx, ebx
call fcn.00410ea0
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x70
cmp eax, 1
sbb eax, eax
inc eax
mov ecx, ebx
push eax
mov eax, dword [ebx + 0x154]
imul eax, dword [0x4165b4]
add eax, dword [ebx + 0x140]
push eax
push str.WriteFile
call fcn.004113c0
jmp 0x41074c
mov eax, dword [esp + 0x34]
mov dword [esp + 0x18], eax
cmp dword [esp + 0x1c], 0
je 0x41090c
cmp dword [esp + 0x2c], 0
jne 0x4108a4
cmp dword [esp + 0x28], 0
je 0x4108ee
push 0
lea eax, [ebp + 0x24]
push eax
mov ecx, dword [ebp + 0x20]
mov edx, dword [esp + 0x20]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x4108ee
push 1
mov eax, dword [ebx + 0x154]
imul eax, dword [0x4165b4]
add eax, dword [ebx + 0x140]
mov ecx, ebx
push eax
push str.SetEndOfFile
call fcn.004113c0
cmp dword [esp + 0x1c], 0
je 0x41090c
lea eax, [ebp + 0x18]
lea ecx, [ebp + 0x10]
push eax
lea edx, [ebp + 8]
mov eax, dword [esp + 0x1c]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x1c], 0
je 0x41093b
mov eax, dword [ebp + 0x28]
test al, 7
je 0x410933
push eax
mov eax, dword [ebx + 0x140]
push eax
call dword [0x4165f4]
inc dword [ebx + 0x3b4]
jmp 0x41094e
mov eax, dword [ebx + 0x140]
inc dword [ebx + 0x3e4]
push eax
call dword [0x4165bc]
cmp dword [esp + 0x1c], 0
je 0x41096e
cmp dword [ebx + 0x408], 0
jne 0x41096e
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x8c
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x8c
ret