Function at 0x407140
Capabilities:
Check if file exists
Get common file path
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa40
mov eax, dword [0x4710b0]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [edi + 0xff8]
sub ecx, dword [edi + 0xff4]
mov eax, 0x7e07e07f
imul ecx
sar edx, 9
mov eax, edx
shr eax, 0x1f
add eax, edx
push ebx
push esi
je 0x4074a9
mov ecx, dword [edi + 0x508]
xor esi, esi
push esi
call fcn.004124f9
mov ecx, dword [edi + 0x508]
push esi
call fcn.004124ce
mov ecx, dword [edi + 0xff8]
sub ecx, dword [edi + 0xff4]
mov eax, 0x7e07e07f
imul ecx
sar edx, 9
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
push ecx
mov ecx, dword [edi + 0x508]
call fcn.004124e0
lea edx, [ebp - 0x620]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov ecx, dword [edi + 0xff8]
sub ecx, dword [edi + 0xff4]
mov eax, 0x7e07e07f
imul ecx
sar edx, 9
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0xa40], esi
je 0x4074a9
mov dword [ebp - 0xa30], esi
mov ebx, dword [edi + 0xff4]
add ebx, dword [ebp - 0xa30]
push 0x400
lea ecx, [ebp - 0xa20]
push 0
push ecx
call fcn.004426d0
add esp, 0xc
push 0
call fcn.0043dc80
add esp, 4
push edx
push eax
push ebx
lea eax, [edi + 0xddc]
push eax
push str._s__s.bin_t_d
lea edx, [ebp - 0xa20]
call fcn.00409730
lea eax, [ebp - 0xa20]
add esp, 0x14
xor edx, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407250
sub eax, esi
sar eax, 1
je 0x407296
cmp word [ebp + edx*2 - 0xa20], 0x5c
jne 0x407279
mov eax, 0x2f
mov word [ebp + edx*2 - 0xa20], ax
lea eax, [ebp - 0xa20]
inc edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407283
sub eax, esi
sar eax, 1
cmp edx, eax
jb 0x407261
push ebx
lea ecx, [ebp - 0xa20]
push ecx
lea ecx, [ebp - 0xa3c]
mov edx, edi
call fcn.00404a00
mov esi, eax
mov dword [ebp - 0xa38], esi
push ebx
lea edx, [ebp - 0x210]
test esi, esi
je 0x4074c7
push str.ck_W
call fcn.004096f0
mov ecx, dword [edi + 0x50c]
mov edx, dword [ecx]
mov edx, dword [edx + 0x2c]
add esp, 8
lea eax, [ebp - 0x210]
push eax
call edx
jmp 0x4072f5
cmp dword [ebp - 0xa3c], 0x14
jb 0x407310
push 0x10
lea ecx, [esi + 4]
push str.Srwh8IqEvNB0GraY
call fcn.004025d0
add esp, 8
jmp 0x407320
mov eax, dword [esi]
push eax
mov byte [ebp - 0xa21], 0
mov dword [ebp - 0xa28], eax
call fcn.0040c4fb
add esp, 4
mov dword [ebp - 0xa34], eax
test eax, eax
jne 0x40734e
mov byte [ebp - 0xa21], 1
jmp 0x407438
mov ecx, dword [ebp - 0xa3c]
add ecx, 0xfffffffc
push ecx
lea edx, [esi + 4]
push edx
lea ecx, [ebp - 0xa28]
push ecx
push eax
call fcn.0043b250
add esp, 0x10
test eax, eax
je 0x40737c
mov byte [ebp - 0xa21], 1
jmp 0x407438
push ebx
lea edx, [ebp - 0x620]
push edx
push str._s_s
lea edx, [ebp - 0x418]
call fcn.004096f0
lea eax, [ebp - 0x418]
add esp, 0xc
push eax
call fcn.00403400
add esp, 4
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x4073b8
test al, 0x10
jne 0x4073bd
call fcn.00403360
mov esi, dword [ebp - 0xa28]
push 0x468f10
lea ecx, [ebp - 0x418]
push ecx
lea edx, [ebp - 0xa2c]
push edx
call fcn.0043ee1f
add esp, 0xc
test eax, eax
jne 0x4074bb
mov eax, dword [ebp - 0xa2c]
mov ecx, dword [ebp - 0xa34]
push eax
push esi
push 1
push ecx
call fcn.0043efbd
mov edx, dword [ebp - 0xa2c]
push edx
call fcn.0043f1c1
mov eax, dword [ebp - 0xa2c]
add esp, 0x14
push eax
call fcn.0043f28a
add esp, 4
push str.._update.local
lea ecx, [ebx + 0x208]
push ecx
push 0x469300
push ebx
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov esi, dword [ebp - 0xa38]
push esi
call fcn.0043dc24
mov eax, dword [ebp - 0xa34]
add esp, 4
test eax, eax
je 0x407454
push eax
call fcn.0043dc24
add esp, 4
cmp byte [ebp - 0xa21], 0
jne 0x4074f5
mov esi, dword [ebp - 0xa40]
mov ecx, dword [edi + 0x508]
inc esi
push esi
call fcn.004124f9
mov ecx, dword [edi + 0xff8]
sub ecx, dword [edi + 0xff4]
add dword [ebp - 0xa30], 0x410
mov eax, 0x7e07e07f
imul ecx
sar edx, 9
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0xa40], esi
cmp esi, eax
jb 0x4071fc
mov al, 1
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043db8a
mov esp, ebp
pop ebp
ret
mov byte [ebp - 0xa21], 1
jmp 0x407432
push 0x469360
call fcn.004096f0
mov ecx, dword [edi + 0x50c]
mov edx, dword [ecx]
mov edx, dword [edx + 0x2c]
add esp, 8
lea eax, [ebp - 0x210]
push eax
call edx
mov ecx, dword [edi + 0x504]
push 0x64
call fcn.004124f9
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
xor al, al
pop ebx
call fcn.0043db8a
mov esp, ebp
pop ebp
ret