Function at 0x497cd0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
push ebx
push esi
mov esi, ecx
xor ebx, ebx
push 0x649128
mov dword [ebp - 0xc], esi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [esi + 0x14]
cmp ecx, 0xffffffff
jne 0x497d06
mov ebx, dword [0x649120]
mov dword [ebp - 4], ebx
test ebx, ebx
jne 0x498394
mov ebx, dword [esi + 0x9c]
mov edx, dword [0x64f6fc]
push edi
mov edi, dword [esi + 0x98]
cmp ebx, edx
ja 0x497d32
mov eax, dword [0x64f6f8]
jb 0x497d28
cmp edi, eax
jae 0x497d32
cmp ecx, 0xffffffff
je 0x497d32
mov ecx, dword [ebp + 0x10]
jmp 0x497d9d
test byte [esi + 0x3c], 1
mov ecx, esi
jne 0x497d4e
mov eax, dword [esi + 0x34]
inc eax
push eax
push dword [esi + 0x38]
call fcn.00496cc0
mov ebx, eax
mov dword [ebp - 4], ebx
jmp 0x497d6b
call fcn.00497a70
mov eax, dword [esi + 0x34]
mov ecx, esi
push 0
push 0
inc eax
push eax
push dword [esi + 0x38]
call fcn.00494980
mov ebx, eax
mov dword [ebp - 4], eax
test ebx, ebx
jne 0x498393
mov ecx, dword [ebp + 0x10]
add ecx, dword [0x649148]
mov edi, dword [esi + 0x98]
mov ebx, dword [esi + 0x9c]
mov edx, dword [0x64f6fc]
mov eax, dword [0x64f6f8]
mov dword [0x649148], 0
mov esi, dword [ebp + 0xc]
sub eax, edi
mov dword [ebp - 8], esi
sbb edx, ebx
test edx, edx
jb 0x497db6
ja 0x497db1
cmp eax, esi
jbe 0x497db6
mov dword [ebp + 0xc], esi
jmp 0x497db9
mov dword [ebp + 0xc], eax
mov esi, dword [ebp - 0xc]
mov dword [ebp + 0x10], eax
cmp dword [esi + 4], 0
je 0x497e0b
mov dword [ebp - 0x14], 0
cmp dword [ebp - 0x14], edx
jb 0x497de3
ja 0x497dd7
cmp ecx, eax
jbe 0x497de3
sub ecx, dword [ebp + 0x10]
mov dword [0x649148], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x497e0b
mov eax, dword [esi + 4]
push 0
mov edx, dword [eax]
xor eax, eax
add ecx, edi
adc eax, ebx
push eax
push ecx
push dword [esi + 0x14]
mov ecx, dword [esi + 4]
call dword [edx + 0x64]
mov dword [esi + 0x98], edi
mov dword [esi + 0x9c], ebx
push 0
mov ecx, 0x64ddb0
call fcn.004e87b0
test eax, eax
je 0x497e74
mov ecx, dword [0x64ddb0]
mov eax, ecx
mov edx, dword [0x64ddb4]
or eax, edx
jne 0x497e64
push eax
mov ecx, 0x64ddb0
call fcn.004e6830
test eax, eax
jne 0x497e52
push dword [0x64f638]
mov ecx, 0x64ddb0
push dword [0x64f634]
call fcn.004e6280
mov ecx, dword [0x64ddb0]
mov eax, ecx
mov edx, dword [0x64ddb4]
or eax, edx
je 0x497e74
test edx, edx
ja 0x497e74
jb 0x497e6f
cmp ecx, dword [ebp + 0xc]
jae 0x497e74
mov dword [ebp + 0xc], ecx
jmp 0x497e77
mov ecx, dword [ebp + 0xc]
sub dword [ebp - 8], ecx
nop word [eax + eax]
cmp dword [esi + 0x58], ecx
mov edi, ecx
mov dword [ebp - 0xc], 1
cmovbe edi, dword [esi + 0x58]
mov dword [ebp - 0x14], 1
mov dword [ebp - 0x10], 0
nop
lea eax, [ebp - 0x64]
mov ecx, esi
push eax
push edi
push dword [ebp + 8]
call fcn.00497660
test eax, eax
je 0x497fa5
mov ecx, dword [ebp - 0x58]
xor ebx, ebx
mov edi, dword [ebp - 0x4c]
test ecx, ecx
je 0x497ee4
lea eax, [ebp - 0x18]
mov ecx, esi
push eax
push dword [esi + 0x90]
push dword [ebp - 0x50]
call fcn.00496ee0
mov ebx, eax
test ebx, ebx
jne 0x497f94
mov ecx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x54]
add eax, ecx
cmp eax, edi
jae 0x497f67
mov eax, dword [esi + 0x90]
cmp edi, eax
ja 0x497efb
test ecx, ecx
jne 0x497f67
push dword [esi + 4]
mov ecx, edi
sub ecx, eax
xor eax, eax
sub ecx, dword [ebp - 0x58]
sbb eax, eax
add ecx, dword [ebp - 0x64]
mov dword [esi + 0x98], ecx
adc eax, dword [ebp - 0x60]
mov dword [esi + 0x9c], eax
lea eax, [ebp - 0x24]
push eax
push dword [esi + 0x14]
call fcn.00519ad0
mov eax, dword [esi + 0x9c]
add esp, 0xc
cmp eax, dword [ebp - 0x20]
ja 0x497f67
jb 0x497f42
mov eax, dword [esi + 0x98]
cmp eax, dword [ebp - 0x24]
jae 0x497f67
mov ecx, dword [esi + 0x90]
lea eax, [ebp - 0x1c]
push eax
mov eax, edi
sub eax, ecx
add eax, dword [ebp - 0x50]
push ecx
push eax
mov ecx, esi
call fcn.00496ee0
mov ebx, eax
test ebx, ebx
je 0x497f67
mov dword [ebp - 4], eax
jmp 0x497f97
mov ecx, dword [ebp - 0x64]
sub ecx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x60]
push dword [ebp - 0x54]
sbb eax, 0
mov dword [esi + 0x98], ecx
push dword [ebp - 0x5c]
mov dword [esi + 0x9c], eax
mov eax, dword [ebp - 0x50]
add eax, dword [ebp - 0x58]
push eax
call fcn.005c9900
add esp, 0xc
mov dword [ebp - 4], ebx
test ebx, ebx
jne 0x498390
mov eax, dword [ebp - 0x50]
mov dword [ebp + 8], eax
mov ebx, dword [ebp - 4]
nop dword [eax + eax]
push dword [esi + 4]
mov dword [ebp + 0x10], 0
push 0
push dword [esi + 0x9c]
push dword [esi + 0x98]
push dword [esi + 0x14]
call fcn.00519a70
mov ecx, dword [esi + 4]
add esp, 0x14
test ecx, ecx
je 0x498081
mov eax, dword [ecx]
lea edx, [ebp + 0x10]
push edx
push edi
push dword [ebp + 8]
push dword [esi + 0x14]
call dword [eax + 0x48]
test eax, eax
je 0x497ffb
cmp eax, 0x20
jne 0x498186
mov edx, dword [ebp + 0x10]
test ebx, ebx
jne 0x4980c2
cmp dword [esi + 4], ebx
jne 0x498147
test edx, edx
jne 0x498147
test edi, edi
je 0x498147
cmp dword [ebp - 0xc], edx
je 0x498147
push edx
mov ecx, 0x64ddb0
call fcn.004e87b0
test eax, eax
jne 0x498144
push dword [esi + 4]
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x2c]
push eax
push dword [esi + 0x1c]
call fcn.00518af0
add esp, 0xc
test eax, eax
jne 0x498144
mov ecx, dword [ebp - 0x2c]
mov eax, ecx
mov edx, dword [ebp - 0x28]
or eax, edx
je 0x498144
test edx, edx
ja 0x498144
jb 0x49807a
cmp ecx, edi
jae 0x498144
mov edi, ecx
jmp 0x497fb0
push 0
lea eax, [ebp + 0x10]
push eax
push edi
push dword [ebp + 8]
push dword [esi + 0x14]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x497ffb
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
jne 0x4980b2
mov edx, dword [ebp + 0x10]
cmp edx, edi
jne 0x497ffe
mov dword [ebp - 4], 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x40], eax
push dword [esi + 0x40]
lea ecx, [ebp - 0x44]
mov dword [ebp - 0x44], 0
push edi
push dword [esi + 0x9c]
mov dword [ebp - 0x3c], 0
push dword [esi + 0x98]
mov dword [ebp - 0x40], 0
push dword [ebp + 8]
mov dword [ebp - 0x38], 5
push dword [esi + 0x2c]
push 0x37
call fcn.0050e8f0
push eax
push 0x14e
lea ecx, [ebp - 0x44]
call fcn.0050e8f0
push eax
push 1
call fcn.004da370
add esp, 0x24
lea ecx, [ebp - 0x44]
call fcn.0050e8a0
mov eax, dword [ebp - 0x44]
test eax, eax
je 0x498144
push eax
call fcn.005d1ed0
add esp, 4
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x40], 0
mov edx, dword [ebp + 0x10]
add dword [esi + 0x98], edx
adc dword [esi + 0x9c], 0
mov ecx, dword [0x64ddb0]
mov eax, ecx
mov ebx, dword [0x64ddb4]
and eax, ebx
cmp eax, 0xffffffff
je 0x49819d
test ebx, ebx
jb 0x498192
ja 0x498173
cmp ecx, edx
jbe 0x498192
sub ecx, edx
mov dword [0x64ddb0], ecx
sbb ebx, 0
mov dword [0x64ddb4], ebx
jmp 0x49819d
mov dword [ebp - 4], 4
jmp 0x4980bf
xorps xmm0, xmm0
movlpd qword [0x64ddb0], xmm0
cmp dword [ebp - 0x50], 0
je 0x4981f1
mov eax, dword [ebp - 0x5c]
xor ecx, ecx
mov edi, dword [ebp - 0x54]
mov dword [ebp + 8], eax
mov eax, edx
sub eax, dword [ebp - 0x58]
cmp dword [ebp - 0x58], edx
push 0x8000
cmovbe ecx, eax
cmp ecx, edi
push 0
push dword [ebp - 0x50]
cmova ecx, edi
mov dword [ebp + 0x10], ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov edx, dword [ebp + 0x10]
xor ecx, ecx
mov eax, edx
mov dword [ebp - 0x50], 0
add eax, dword [ebp - 0x64]
mov dword [esi + 0x98], eax
adc ecx, dword [ebp - 0x60]
mov dword [esi + 0x9c], ecx
mov ebx, dword [ebp - 4]
test ebx, ebx
jne 0x498393
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
add eax, edx
sub ecx, edx
mov dword [ebp + 8], eax
mov dword [ebp + 0xc], ecx
cmp edx, edi
je 0x4982c3
push edi
push edx
push str.Target_Full___Wrote__u_of__u_bytes
push 9
call fcn.004da370
sub edi, dword [ebp + 0x10]
add esp, 0x10
mov ecx, 0x64ddb0
push ebx
call fcn.004e87b0
test eax, eax
je 0x498270
mov ebx, dword [ebp - 0x10]
mov eax, ebx
inc ebx
mov dword [ebp - 0x10], ebx
cmp eax, 0x64
jae 0x498270
push 0
mov ecx, 0x64ddb0
call fcn.004e6830
test eax, eax
jne 0x498270
push dword [0x64f638]
mov ecx, 0x64ddb0
push dword [0x64f634]
call fcn.004e6280
jmp 0x497ea0
cmp dword [esi + 4], 0
jne 0x4982e8
cmp dword [ebp + 0x10], 0
je 0x4982e8
cmp dword [ebp - 0x14], 0
je 0x4982e8
push 0
lea eax, [ebp - 0x34]
mov dword [ebp - 0x14], 0
push eax
push dword [esi + 0x1c]
call fcn.00518af0
add esp, 0xc
test eax, eax
jne 0x4982e8
mov ecx, dword [ebp - 0x34]
mov eax, ecx
mov edx, dword [ebp - 0x30]
or eax, edx
je 0x4982e8
test edx, edx
ja 0x497ea0
jb 0x4982bc
cmp ecx, edi
jae 0x497ea0
mov edi, ecx
jmp 0x497ea0
test ecx, ecx
jne 0x497e80
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x498393
push 0
push ecx
push eax
mov ecx, esi
call fcn.00497cd0
mov ebx, eax
jmp 0x498393
mov edi, dword [esi + 0x6c]
test edi, edi
je 0x4982fd
mov ecx, edi
call fcn.00497a70
mov ecx, edi
call fcn.00494790
mov edi, dword [0x649148]
mov ecx, dword [ebp + 0xc]
add edi, ecx
add dword [ebp - 8], ecx
test byte [esi + 0x3c], 2
mov dword [0x649148], 0
jne 0x498389
push 0
mov ecx, 0x64ddb0
call fcn.004e87b0
test eax, eax
jne 0x498389
test byte [esi + 0x3c], 1
mov ecx, esi
jne 0x498342
mov eax, dword [esi + 0x34]
inc eax
push eax
push dword [esi + 0x38]
call fcn.00496cc0
jmp 0x49835a
call fcn.00497a70
mov eax, dword [esi + 0x34]
mov ecx, esi
push 0
push 1
inc eax
push eax
push dword [esi + 0x38]
call fcn.00494980
mov ebx, eax
mov ecx, esi
test ebx, ebx
jne 0x498372
push edi
push dword [ebp - 8]
push dword [ebp + 8]
call fcn.00497cd0
mov ebx, eax
jmp 0x498393
mov eax, dword [esi]
mov eax, dword [eax + 0x20]
call eax
test al, al
je 0x498393
mov dword [0x649120], 0x20
jmp 0x498393
mov ebx, 0x20
jmp 0x498393
mov ebx, dword [ebp - 4]
pop edi
push 0x649128
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 0xc