Function at 0x416080
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x56f860
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
mov eax, dword [0x5d2fec]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0
mov dword [ebp - 4], 2
call fcn.00557010
add esp, 4
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x24]
mov dword [ebp - 0x34], edx
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x24], 0
push str._Y_m_d
push eax
call fcn.004173f0
push 0x5b2524
lea eax, [ebp - 0x2c]
mov byte [ebp - 4], 3
push eax
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x2c], 0
call fcn.004173f0
mov byte [ebp - 4], 4
call fcn.00417ce3
mov ecx, eax
test ecx, ecx
jne 0x41610f
push 0x80004005
call fcn.00407010
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x1c], esi
mov byte [ebp - 4], 5
call fcn.00417ce3
mov ecx, eax
test ecx, ecx
jne 0x416133
push 0x80004005
call fcn.00407010
mov eax, dword [ecx]
call dword [eax + 0xc]
lea edi, [eax + 0x10]
mov dword [ebp - 0x18], edi
mov byte [ebp - 4], 6
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x105
or eax, ecx
jge 0x416166
push 0x105
lea ecx, [ebp - 0x1c]
call fcn.00406e60
mov esi, dword [ebp - 0x1c]
cmp dword [esi - 8], 0x105
jge 0x416179
push 0x80070057
call fcn.00407010
push 0x105
xor eax, eax
mov dword [esi - 0xc], 0x105
push esi
push eax
mov word [esi + 0x20a], ax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x5c
push esi
call fcn.005512e5
add esp, 8
test eax, eax
jne 0x4161aa
or eax, 0xffffffff
jmp 0x4161ae
sub eax, esi
sar eax, 1
inc eax
lea ecx, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.00405b70
mov byte [ebp - 4], 7
lea ecx, [edi - 0x10]
mov edx, dword [eax]
or ebx, 0xffffffff
mov dword [ebp - 0x40], ecx
lea eax, [edx - 0x10]
mov dword [ebp - 0x3c], eax
cmp eax, ecx
je 0x416222
cmp dword [ecx + 0xc], 0
lea edi, [ecx + 0xc]
jl 0x416213
mov eax, dword [eax]
cmp eax, dword [ecx]
jne 0x416213
push dword [ebp - 0x3c]
call fcn.00406c80
add esp, 4
mov dword [ebp - 0x3c], eax
mov ecx, ebx
lock xadd dword [edi], ecx
dec ecx
test ecx, ecx
jg 0x41620b
mov edi, dword [ebp - 0x40]
push edi
mov ecx, dword [edi]
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x3c]
lea edi, [eax + 0x10]
mov dword [ebp - 0x18], edi
jmp 0x416222
push dword [edx - 0xc]
lea ecx, [ebp - 0x18]
push edx
call fcn.00406bd0
mov edi, dword [ebp - 0x18]
mov byte [ebp - 4], 6
mov eax, ebx
mov edx, dword [ebp - 0x44]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x416240
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea eax, [ebp - 0x24]
mov dword [ebp - 0x14], 0
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.00405ab0
push 0x5b259c
push eax
lea eax, [ebp - 0x14]
mov byte [ebp - 4], 8
push eax
call fcn.00406a20
add esp, 0x18
mov byte [ebp - 4], 0xa
mov eax, ebx
mov edx, dword [ebp - 0x44]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41628c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0x5b25c0
lea eax, [ebp + 8]
mov dword [ebp - 0x20], 0
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.00406a20
lea ecx, [ebp + 0xc]
mov byte [ebp - 4], 0xb
push ecx
push eax
lea eax, [ebp - 0x48]
push eax
call fcn.00405ab0
push 0x5afd58
push eax
lea eax, [ebp - 0x3c]
mov byte [ebp - 4], 0xc
push eax
call fcn.00406a20
lea ecx, [ebp + 0x10]
mov byte [ebp - 4], 0xd
push ecx
push eax
lea eax, [ebp - 0x40]
push eax
call fcn.00405ab0
push 0x5afd40
push eax
lea eax, [ebp - 0x20]
mov byte [ebp - 4], 0xe
push eax
call fcn.00406a20
mov byte [ebp - 4], 0xd
add esp, 0x3c
mov edx, dword [ebp - 0x40]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x416310
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0xc
mov eax, ebx
mov edx, dword [ebp - 0x3c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41632e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0xb
mov eax, ebx
mov edx, dword [ebp - 0x48]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41634c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0xa
mov eax, ebx
mov edx, dword [ebp - 0x28]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41636a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x14]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileW]
jne 0x4163c3
push 0
push 0x80
push 1
push 0
push 0
push 0x40000000
push dword [ebp - 0x14]
call eax
mov dword [ebp - 0x48], eax
cmp eax, 0xffffffff
je 0x4163be
push 0
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x28], 0xfeff
push ecx
push 2
lea ecx, [ebp - 0x28]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x80
push 3
push 0
push 0
push 0x40000000
push dword [ebp - 0x14]
call eax
mov dword [ebp - 0x3c], eax
cmp eax, 0xffffffff
je 0x416411
push 2
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 0x20]
lea edx, [ebp - 0x30]
push 0
push edx
mov eax, dword [ecx - 0xc]
add eax, eax
push eax
push ecx
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x20]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41642b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 6
mov eax, ebx
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x416449
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 5
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x416464
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 4
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x41647f
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 3
mov eax, ebx
mov edx, dword [ebp - 0x2c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41649d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
mov eax, ebx
mov edx, dword [ebp - 0x24]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4164bb
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 1
mov eax, ebx
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4164d9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov eax, ebx
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4164f7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp + 0x10]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x416516
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0054e73a
mov esp, ebp
pop ebp
ret