Function at 0x405120
Capabilities:
Check if file exists
Create directory

Disassembly:
push 0xffffffffffffffff
push 0x41c748
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov eax, dword [0x423044]
xor eax, esp
push eax
lea eax, [esp + 0x24]
mov dword fs:[0], eax
mov eax, dword [0x424614]
mov edx, dword [eax + 0xc]
xor ebx, ebx
mov ecx, 0x424614
mov dword [esp + 0x18], ebx
call edx
lea ebp, [eax + 0x10]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x2c], ebx
mov eax, dword [ebp - 8]
mov ecx, 1
sub ecx, dword [ebp - 4]
sub eax, 0x104
or eax, ecx
jge 0x40518d
mov ecx, 0x104
lea eax, [esp + 0x14]
call fcn.004095e0
mov ebp, dword [esp + 0x14]
push 0x104
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
cmp ebp, ebx
jne 0x4051a2
xor ecx, ecx
jmp 0x4051b8
mov ecx, ebp
lea esi, [ecx + 1]
mov dl, byte [ecx]
add ecx, 1
cmp dl, bl
jne 0x4051a7
sub ecx, esi
js 0x4053c9
cmp ecx, dword [ebp - 8]
jg 0x4053c9
cmp eax, ebx
mov dword [ebp - 0xc], ecx
mov byte [ecx + ebp], bl
je 0x40538a
cmp eax, 0x104
jae 0x40538a
push 0x5c
push ebp
call fcn.0040cb99
add esp, 8
cmp eax, ebx
jne 0x4051ee
or eax, 0xffffffff
jmp 0x4051f0
sub eax, ebp
add eax, 1
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x14]
call fcn.004086b0
mov edi, dword [esp + 0x34]
lea esi, [edi + 0x10]
mov ebx, esi
mov byte [esp + 0x2c], 1
call fcn.004085e0
mov byte [esp + 0x2c], 0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405238
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esi]
mov ecx, dword [ecx - 0xc]
mov eax, dword [ebp - 0xc]
sub eax, ecx
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x14]
call fcn.00408640
lea ebx, [edi + 0x24]
mov byte [esp + 0x2c], 2
call fcn.004085e0
mov byte [esp + 0x2c], 0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405281
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esi]
push str.KWSUpd
lea ebx, [edi + 0x1c]
push ecx
push str._s_s_
mov edi, ebx
mov dword [esp + 0x2c], ebx
call fcn.00409fe0
mov edx, dword [esi]
mov edi, dword [esp + 0x40]
push str.KWSReUpd
push edx
push str._s_s_
add edi, 0x14
call fcn.00409fe0
mov eax, dword [esi]
mov edi, dword [esp + 0x4c]
push str.backup
push eax
push str._s_s_
add edi, 0x20
call fcn.00409fe0
lea ecx, [esp + 0x40]
push str.index.dat
push ecx
mov ecx, ebx
call fcn.00408720
add esp, 0x2c
mov ebx, dword [esp + 0x34]
add ebx, 0x28
mov byte [esp + 0x2c], 3
call fcn.004085e0
mov byte [esp + 0x2c], 0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405318
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x1c]
push str.update.cfg
push ecx
mov ecx, esi
call fcn.00408720
add esp, 8
mov ebx, dword [esp + 0x34]
add ebx, 0x30
mov byte [esp + 0x2c], 4
call fcn.004085e0
mov byte [esp + 0x2c], 0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405362
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [esp + 0x20]
mov eax, dword [esi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x405382
mov eax, dword [esi]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x40538a
mov dword [esp + 0x18], 1
add ebp, 0xfffffff0
mov dword [esp + 0x2c], 0xffffffff
lea ecx, [ebp + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4053af
mov ecx, dword [ebp]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebp
call edx
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 4
push 0x80070057
call fcn.004045b0
int3