Function at 0x40c700
Capabilities:
Write file on windows

Disassembly:
sub esp, 0xb8
push ebx
push ebp
mov ebx, ecx
push esi
push edi
mov ecx, 1
mov edi, dword [ebx + 0x4d0]
mov dword [esp + 0x2c], ecx
mov edx, dword [edi + 0x40]
mov ebp, dword [edi + 0x38]
mov esi, dword [edi + 0x3c]
lea eax, [edi + 0x18]
test dh, 4
mov dword [esp + 0x38], ebp
mov dword [esp + 0x3c], esi
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], esi
mov dword [esp + 0x34], eax
mov dword [esp + 0x10], eax
je 0x40c753
mov eax, dword [ebx + 0xec]
mov dword [esp + 0x1c], ecx
test ah, 0x20
je 0x40c75b
mov dword [esp + 0x1c], 0
cmp dword [ebx + 0x258], 3
je 0x40c7f7
mov eax, dword [ebx + 0x164]
cdq
cmp esi, edx
jg 0x40c78d
jl 0x40c779
cmp ebp, eax
jae 0x40c78d
mov eax, dword [ebx + 0x248]
cdq
push edx
push eax
push esi
push ebp
call fcn.0041b010
or eax, edx
jne 0x40c7f7
test byte [ebx + 0xec], 4
jne 0x40c7f7
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x40c7f7
mov eax, dword [ebx + 0x248]
mov dword [esp + 0x14], 1
cdq
push edx
push eax
push esi
push ebp
call fcn.0041b010
or eax, edx
mov dword [esp + 0x44], 1
jne 0x40c7ca
mov dword [esp + 0x44], 0
mov ebp, dword [edi + 8]
xor eax, eax
cmp ebp, 6
mov dword [esp + 0x54], ebp
sete al
test eax, eax
mov dword [esp + 0x20], eax
je 0x40c801
lea eax, [ebx + 0x398]
lea edx, [ebx + 0x3d0]
mov dword [esp + 0x48], eax
mov dword [esp + 0x40], edx
jmp 0x40c815
mov dword [esp + 0x14], 0
jmp 0x40c7c2
lea ecx, [ebx + 0x394]
lea eax, [ebx + 0x3cc]
mov dword [esp + 0x48], ecx
mov dword [esp + 0x40], eax
cmp ebp, 1
je 0x40c82a
mov eax, dword [edi + 0x10]
cdq
cmp esi, edx
jl 0x40c841
jg 0x40c82a
cmp dword [esp + 0x38], eax
jbe 0x40c841
mov esi, dword [esp + 0x34]
lea ecx, [esp + 0x58]
mov dword [esp + 0x10], ecx
mov ecx, 0x1a
lea edi, [esp + 0x58]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x14]
mov edi, 0x40000000
neg esi
sbb esi, esi
mov dword [esp + 0x34], edi
and esi, 0x20000000
or esi, 0x8000000
cmp ebp, 1
mov dword [esp + 0x30], esi
je 0x40c86c
cmp ebp, 6
jne 0x40c87f
mov edi, 0x400c0000
or esi, 0x2000000
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], esi
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40c891
or esi, 0x2200000
mov dword [esp + 0x30], esi
mov eax, dword [ebx + 0x3f4]
test eax, eax
je 0x40c8b6
mov edx, dword [ebx + 0x3f4]
add edx, 9
mov eax, 0xcccccccd
mov ecx, ebx
mul edx
shr edx, 3
push edx
call fcn.0040de60
mov eax, dword [ebx + 0x140]
push 0
push esi
push 2
push 0
push 2
push edi
push eax
call dword [0x41b3cc]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x18], ebp
jne 0x40c953
mov ecx, dword [ebx + 0x140]
push 0x80
push ecx
call dword [fcn.0041b434]
mov edx, dword [ebx + 0x140]
push 0
push esi
push 2
push 0
push 2
push edi
push edx
call dword [0x41b3cc]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x18], ebp
jne 0x40c953
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push ecx
push edx
mov ecx, ebx
call fcn.0040d540
mov eax, dword [esp + 0x40]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40c949
test dword [ebx + 0xec], 0x40000000
je 0x40ce59
mov eax, 0x4049c0
jmp 0x40ccf7
mov eax, 0x4049b4
jmp 0x40ccf7
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40c9a7
mov edx, dword [esp + 0x10]
mov ecx, dword [ebx + 0x4d0]
mov eax, dword [edx + 0x60]
mov edx, dword [ecx + 0xc]
push eax
push edx
push ebp
call fcn.0041aeb0
add esp, 0xc
test eax, eax
jg 0x40cdb1
mov eax, dword [esp + 0x40]
push 1
mov edi, dword [eax]
inc edi
mov dword [eax], edi
mov eax, dword [ebx + 0x154]
imul eax, dword [0x41b3f0]
add eax, dword [ebx + 0x140]
push eax
push 0x40499c
jmp 0x40cdaa
mov eax, dword [esp + 0x44]
test eax, eax
je 0x40c9d4
mov ecx, dword [ebx + 0x140]
and esi, 0xdfffffff
push 0
push esi
push 3
push 0
push 2
push edi
push ecx
mov dword [esp + 0x4c], esi
call dword [0x41b3cc]
mov dword [esp + 0x4c], eax
mov edx, dword [ebx + 0x4d0]
mov esi, dword [esp + 0x3c]
mov eax, dword [edx + 0x10]
cdq
cmp esi, edx
jl 0x40ca5d
jg 0x40c9ee
cmp dword [esp + 0x38], eax
jbe 0x40ca5d
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40ca2d
mov eax, dword [ebx + 0x248]
mov ecx, dword [esp + 0x38]
cdq
mov esi, eax
mov edi, edx
mov edx, dword [esp + 0x3c]
add eax, ecx
mov ecx, edi
push edi
adc ecx, edx
sub eax, 1
sbb ecx, 0
push esi
push ecx
push eax
call fcn.0041b0d0
push edi
push esi
push edx
push eax
call fcn.0041afd0
mov esi, dword [esp + 0x3c]
jmp 0x40ca33
mov eax, dword [esp + 0x38]
mov edx, esi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, edx
mov dword [esp + 0x1c], edx
lea edx, [esp + 0x1c]
push 0
push edx
push eax
push ebp
sar ecx, 0x1f
call edi
push ebp
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
push 0
push 0
push ebp
call edi
test esi, esi
jl 0x40cc4e
jg 0x40ca73
mov eax, dword [esp + 0x38]
test eax, eax
jbe 0x40cc4e
mov edi, dword [esp + 0x24]
mov ebp, dword [ebx + 0x4d0]
mov ecx, dword [esp + 0x28]
mov esi, dword [ebp + 0x10]
mov eax, esi
cdq
cmp ecx, edx
jl 0x40ca91
jg 0x40cacc
cmp edi, eax
jae 0x40cacc
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40caca
mov eax, dword [ebx + 0x248]
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
cdq
mov edi, eax
add eax, ecx
mov ecx, edx
push edx
adc ecx, esi
sub eax, 1
sbb ecx, 0
push edi
push ecx
push eax
call fcn.0041b0d0
mov esi, eax
imul esi, edi
mov edi, dword [esp + 0x24]
jmp 0x40cacc
mov esi, edi
mov eax, dword [ebp + 0xc]
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x50]
push 0
push edx
push esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
xor ebp, ebp
mov dword [esp + 0x2c], eax
cmp eax, ebp
je 0x40cbe3
mov ecx, dword [esp + 0x50]
cmp esi, ecx
jne 0x40cbe3
mov esi, dword [esp + 0x28]
xor eax, eax
sub edi, ecx
sbb esi, eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], esi
js 0x40cb5e
jg 0x40cb17
cmp edi, ebp
jbe 0x40cb5e
mov edx, dword [ebx + 0x3a0]
add edx, ecx
mov ecx, ebx
mov dword [ebx + 0x3a0], edx
mov edx, dword [ebx + 0x3a4]
adc edx, eax
mov dword [ebx + 0x3a4], edx
call fcn.0040d440
test eax, eax
je 0x40cb99
mov edx, dword [ebx + 0x4d0]
cmp dword [edx + 8], 2
jne 0x40cb99
mov eax, dword [ebx + 0x3f4]
cmp eax, ebp
je 0x40cb7e
push ebp
mov ecx, ebx
call fcn.0040de60
jmp 0x40cb7e
mov edx, dword [ebx + 0x3a0]
add ecx, edi
adc eax, esi
add edx, ecx
mov dword [ebx + 0x3a0], edx
mov ecx, dword [ebx + 0x3a4]
adc ecx, eax
mov dword [ebx + 0x3a4], ecx
cmp esi, ebp
jg 0x40ca77
jl 0x40cc4e
test edi, edi
ja 0x40ca77
jmp 0x40cc4e
mov eax, dword [ebx + 0x3f8]
mov dword [esp + 0x2c], ebp
cmp eax, ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
jne 0x40cc4e
mov eax, dword [ebx + 0x4d0]
mov ecx, dword [eax + 8]
cmp ecx, 3
je 0x40cc4e
mov ax, cx
lea ecx, [esp + 0x14]
add ax, 0x30
push ebp
push ecx
mov word [esp + 0x1c], ax
mov word [esp + 0x1e], bp
push 0x404984
jmp 0x40cc47
mov eax, dword [esp + 0x10]
mov ecx, ebx
mov edx, dword [eax + 4]
mov eax, dword [eax]
push edx
push eax
call fcn.0040d540
mov esi, dword [esp + 0x20]
cmp esi, ebp
je 0x40cc09
test dword [ebx + 0xec], 0x40000000
je 0x40cc4e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
jne 0x40cc1c
cmp esi, ebp
jne 0x40cc1c
xor eax, eax
jmp 0x40cc2a
cmp esi, ebp
mov eax, 1
mov ecx, 0x404970
jne 0x40cc2f
mov ecx, 0x404964
mov edx, dword [ebx + 0x154]
mov edi, dword [ebx + 0x140]
imul edx, dword [0x41b3f0]
add edx, edi
push eax
push edx
push ecx
mov ecx, ebx
call fcn.0040da40
mov eax, dword [esp + 0x44]
test eax, eax
je 0x40cd35
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x4c]
cmp eax, 0xffffffff
jne 0x40cd2d
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x34]
xor esi, esi
mov eax, dword [ebx + 0x3f8]
test eax, eax
jne 0x40ccd1
mov eax, dword [ebx + 0x3e0]
mov ecx, dword [ebx + 0x140]
push 0
push edi
push 3
push 0
push 2
inc eax
push ebp
push ecx
mov dword [ebx + 0x3e0], eax
call dword [0x41b3cc]
cmp eax, 0xffffffff
jne 0x40cd2d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
jne 0x40ccd1
mov eax, esi
imul eax, esi
lea edx, [eax + eax*4]
shl edx, 1
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
inc esi
cmp esi, 0xa
jl 0x40cc7c
mov eax, dword [esp + 0x40]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40cd26
test dword [ebx + 0xec], 0x40000000
je 0x40ce59
mov eax, 0x404958
mov ecx, dword [ebx + 0x154]
mov esi, dword [ebx + 0x140]
imul ecx, dword [0x41b3f0]
add ecx, esi
push 1
push ecx
push eax
mov ecx, ebx
call fcn.0040da40
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xb8
ret 4
mov eax, 0x404944
jmp 0x40ccf7
mov esi, eax
mov dword [esp + 0x18], esi
jmp 0x40cd39
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40cdb1
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
or eax, ecx
je 0x40cdb1
mov eax, dword [esp + 0x10]
push 0
lea edx, [eax + 0x24]
mov eax, dword [eax + 0x20]
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
mov dword [esp + 0x2c], eax
jne 0x40cdb1
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40cd8c
test dword [ebx + 0xec], 0x40000000
je 0x40cdb1
mov eax, 0x40492c
jmp 0x40cd91
mov eax, 0x40491c
mov ecx, dword [ebx + 0x154]
mov esi, dword [ebx + 0x140]
imul ecx, dword [0x41b3f0]
add ecx, esi
push 1
push ecx
push eax
mov ecx, ebx
call fcn.0040da40
cmp dword [esp + 0x54], 1
jne 0x40cdce
mov edx, dword [esp + 0xcc]
mov edi, dword [esp + 0x18]
push edx
push edi
mov ecx, ebx
call fcn.0040ce70
jmp 0x40cdd2
mov edi, dword [esp + 0x18]
mov ebp, dword [esp + 0x2c]
test ebp, ebp
je 0x40cdfb
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x10]
test eax, eax
jne 0x40cdff
lea eax, [esi + 0x18]
lea ecx, [esi + 0x10]
push eax
lea edx, [esi + 8]
push ecx
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
jmp 0x40cdff
mov esi, dword [esp + 0x10]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebp, ebp
je 0x40ce4c
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40ce27
mov eax, dword [esi + 0x28]
test al, 7
je 0x40ce27
push eax
mov eax, dword [ebx + 0x140]
push eax
call dword [fcn.0041b434]
mov eax, dword [esp + 0x48]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov eax, dword [ebx + 0x3f8]
test eax, eax
jne 0x40ce59
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xb8
ret 4
mov ecx, dword [ebx + 0x140]
push ecx
call dword [fcn.0041b3fc]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xb8
ret 4