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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c6308
mov eax, dword fs:[0]
push eax
sub esp, 0x24c
mov eax, dword [0x4f6108]
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
mov ebx, dword [ebp + 8]
lea ecx, [ebp - 0x258]
mov eax, dword [ebp + 0xc]
push 0
push ebx
mov dword [ebp - 0x23c], eax
call fcn.0046e380
push ecx
mov ecx, esp
mov dword [ebp - 4], 0
push 0x4c957c
call fcn.00404260
lea ecx, [ebp - 0x258]
call fcn.0046ef00
or edi, 0xffffffff
test eax, eax
je 0x476cad
push ecx
mov ecx, esp
push 0x4c957c
call fcn.00404260
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x258]
call fcn.0046ef90
push eax
mov ecx, 0x4fa0a8
mov byte [ebp - 4], 1
call fcn.00401fe0
mov edx, dword [ebp - 0x22c]
mov eax, edi
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x476cad
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.00493690
add esp, 0xc
lea eax, [ebp - 0x218]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push eax
lea ecx, [ebp - 0x224]
call fcn.00404260
mov eax, dword [ebp - 0x224]
mov byte [ebp - 4], 2
cmp dword [eax - 4], 1
jle 0x476d14
push dword [eax - 0xc]
lea ecx, [ebp - 0x224]
call fcn.00403f90
mov eax, dword [ebp - 0x224]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
mov eax, dword [ebp - 0x224]
push dword [eax - 8]
push eax
call fcn.0049ce2c
mov edx, eax
add esp, 8
test edx, edx
js 0x476ed3
mov ecx, dword [ebp - 0x224]
cmp edx, dword [ecx - 8]
jg 0x476ed3
mov dword [ecx - 0xc], edx
xor ecx, ecx
mov eax, dword [ebp - 0x224]
mov dword [ebp - 0x22c], ecx
mov word [eax + edx*2], cx
mov dword [ebp - 0x238], ecx
mov dword [ebp - 0x234], ecx
mov dword [ebp - 0x230], ecx
push 0x4dca10
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.00404260
lea eax, [ebp - 0x238]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x224]
push eax
call fcn.00458110
mov edx, dword [ebp - 0x220]
add esp, 0xc
mov byte [ebp - 4], 3
add edx, 0xfffffff0
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x476dc3
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [0x4fa0a8]
mov ecx, dword [ebp - 0x238]
cmp dword [eax - 0xc], 0
jne 0x476df8
mov eax, dword [ebp - 0x234]
sub eax, ecx
sar eax, 2
cmp eax, 3
jb 0x476df8
lea eax, [ecx + 8]
mov ecx, 0x4fa0a8
push eax
call fcn.00401fe0
mov ecx, dword [ebp - 0x238]
mov eax, dword [ebp - 0x234]
sub eax, ecx
sar eax, 2
cmp eax, 4
jb 0x476eb6
mov eax, dword [ecx + 0xc]
sub eax, 0x10
push eax
call fcn.004043f0
add esp, 4
cmp dword [eax + 4], 0
lea esi, [eax + 0x10]
jl 0x476e9f
push str.SMDB
push esi
call fcn.004937ea
add esp, 8
test eax, eax
je 0x476e3f
sub eax, esi
sar eax, 1
cmp eax, 0xffffffff
jne 0x476e60
cmp dword [esi - 0xc], 0
jl 0x476e9f
push 0x4e1dac
push esi
call fcn.004937ea
add esp, 8
test eax, eax
je 0x476e6a
sub eax, esi
sar eax, 1
cmp eax, 0xffffffff
je 0x476e6a
mov dword [ebp - 0x22c], 1
cmp dword [esi - 0xc], 0
jl 0x476e9f
push 0x4c9588
push esi
call fcn.004937ea
add esp, 8
test eax, eax
je 0x476e8b
sub eax, esi
sar eax, 1
cmp eax, 0xffffffff
jne 0x476e9f
cmp dword [esi - 0xc], 0
jl 0x476e9f
push 0x4c958c
push esi
call fcn.004937ea
add esp, 8
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x476eb6
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
push ebx
lea ecx, [ebp - 0x21c]
call fcn.00404260
mov eax, dword [ebp - 0x21c]
mov byte [ebp - 4], 5
mov esi, dword [eax - 0xc]
test esi, esi
jns 0x476edd
push 0x80070057
call fcn.00404500
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
sub ecx, esi
or ecx, edx
jge 0x476f00
push esi
lea ecx, [ebp - 0x21c]
call fcn.00404050
mov eax, dword [ebp - 0x21c]
lea ecx, [esi + 1]
push ecx
push eax
call fcn.0049d16c
mov eax, dword [ebp - 0x21c]
add esp, 8
cmp esi, dword [eax - 8]
jg 0x476ed3
mov dword [eax - 0xc], esi
xor ecx, ecx
mov eax, dword [ebp - 0x21c]
mov word [eax + esi*2], cx
mov eax, dword [ebp - 0x21c]
cmp dword [eax - 0xc], ecx
jge 0x476f37
or edx, 0xffffffff
jmp 0x476f5a
push 0x4c9590
push eax
call fcn.004937ea
mov edx, eax
add esp, 8
mov eax, dword [ebp - 0x21c]
test edx, edx
jne 0x476f56
or edx, 0xffffffff
jmp 0x476f5a
sub edx, eax
sar edx, 1
xor ecx, ecx
cmp edx, 0xffffffff
setne cl
mov dword [0x4fa0a0], ecx
cmp dword [eax - 0xc], 0
jge 0x476f73
or edx, 0xffffffff
jmp 0x476f96
push str._ndl
push eax
call fcn.004937ea
mov edx, eax
add esp, 8
mov eax, dword [ebp - 0x21c]
test edx, edx
jne 0x476f92
or edx, 0xffffffff
jmp 0x476f96
sub edx, eax
sar edx, 1
xor ecx, ecx
cmp edx, 0xffffffff
setne cl
mov dword [0x4fa0a4], ecx
cmp dword [eax - 0xc], 0
jl 0x477250
push 0x4c95a4
push eax
call fcn.004937ea
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x21c]
test ecx, ecx
je 0x476fd1
sub ecx, eax
sar ecx, 1
cmp ecx, 0xffffffff
jne 0x477006
cmp dword [eax - 0xc], 0
jl 0x477250
push 0x4c95ac
push eax
call fcn.004937ea
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x21c]
test ecx, ecx
je 0x477227
sub ecx, eax
sar ecx, 1
cmp ecx, 0xffffffff
je 0x477227
push ecx
mov ecx, esp
push 0x4c95ac
call fcn.00404260
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x258]
call fcn.0046ef90
mov eax, dword [ebp - 0x220]
mov byte [ebp - 4], 6
cmp dword [eax - 0xc], 0
jne 0x477085
push ecx
mov ecx, esp
push 0x4c95a4
call fcn.00404260
lea eax, [ebp - 0x228]
push eax
lea ecx, [ebp - 0x258]
call fcn.0046ef90
push eax
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 7
call fcn.00401fe0
mov edx, dword [ebp - 0x228]
mov eax, edi
mov byte [ebp - 4], 6
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x477085
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x220]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x477192
xor ebx, ebx
nop dword [eax + eax]
mov eax, dword [ebp - 0x220]
test ebx, ebx
js 0x477186
cmp ebx, dword [eax - 0xc]
jg 0x4770d9
lea eax, [eax + ebx*2]
push 0x4dc5c0
push eax
call fcn.004937ea
mov edi, eax
add esp, 8
mov eax, dword [ebp - 0x220]
test edi, edi
je 0x4770d9
sub edi, eax
sar edi, 1
cmp edi, 0xffffffff
jne 0x477110
test ebx, ebx
js 0x477186
cmp ebx, dword [eax - 0xc]
jg 0x477186
lea eax, [eax + ebx*2]
push 0x4e1f48
push eax
call fcn.004937ea
mov edi, eax
add esp, 8
test edi, edi
je 0x477180
mov eax, dword [ebp - 0x220]
sub edi, eax
sar edi, 1
cmp edi, 0xffffffff
je 0x477186
push edi
lea eax, [ebp - 0x228]
push eax
lea ecx, [ebp - 0x220]
call fcn.00417280
mov esi, dword [ebp - 0x228]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x47713c
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov eax, dword [ebp - 0x220]
inc edi
add esi, 0xfffffff0
mov ebx, edi
cmp edi, dword [eax - 0xc]
jge 0x47716b
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4770a0
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x4770a0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x477180
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x220]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
or edi, 0xffffffff
push ecx
mov esi, esp
mov dword [ebp - 0x228], esp
mov dword [ebp - 0x240], esi
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
push eax
call fcn.004043f0
add eax, 0x10
add esp, 4
mov dword [esi], eax
mov eax, dword [0x4f9fec]
mov byte [ebp - 4], 8
test eax, eax
jne 0x4771f4
push 0x188
call fcn.0047a764
add esp, 4
mov dword [ebp - 0x240], eax
mov byte [ebp - 4], 9
test eax, eax
je 0x4771e9
mov ecx, eax
call fcn.0042d420
jmp 0x4771eb
xor eax, eax
mov byte [ebp - 4], 8
mov dword [0x4f9fec], eax
lea ecx, [eax + 4]
mov byte [ebp - 4], 6
call fcn.00432df0
mov edx, dword [ebp - 0x220]
mov eax, edi
mov byte [ebp - 4], 5
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x477221
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x21c]
cmp dword [eax - 0xc], 0
jl 0x477250
push 0x4c95b4
push eax
call fcn.004937ea
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x21c]
test ecx, ecx
je 0x477250
sub ecx, eax
sar ecx, 1
cmp ecx, 0xffffffff
jne 0x4772b2
cmp dword [ebp - 0x22c], 0
jne 0x4772b2
xor eax, eax
mov dword [0x4fa09c], eax
cmp dword [0x4fa0a0], eax
jne 0x477277
call fcn.004538c0
mov dword [0x4fa0a0], eax
mov eax, dword [0x4fa09c]
push dword [0x4fa0a0]
push eax
push str.silent_dupdate_d
push 0x4c92d8
push 0x4c92f4
call fcn.004578c0
add esp, 0x14
call fcn.00475460
call fcn.00471c80
mov ecx, dword [ebp - 0x23c]
call fcn.00477450
mov dword [ebp - 0x22c], eax
jmp 0x477321
mov dword [0x4fa09c], 1
cmp dword [eax - 0xc], 0
jge 0x4772c7
or eax, 0xffffffff
jmp 0x4772e6
push 0x4c95bc
push eax
call fcn.004937ea
add esp, 8
test eax, eax
jne 0x4772de
or eax, 0xffffffff
jmp 0x4772e6
sub eax, dword [ebp - 0x21c]
sar eax, 1
push dword [0x4fa0a0]
xor ebx, ebx
cmp eax, 0xffffffff
push dword [0x4fa09c]
setne bl
push str.silent_dupdate_d
push 0x4c92d8
push 0x4c92f4
call fcn.00457990
push ebx
call fcn.00475690
add esp, 0x18
mov dword [ebp - 0x22c], 0
mov edx, dword [ebp - 0x21c]
mov eax, edi
mov byte [ebp - 4], 3
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x477342
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x238]
mov byte [ebp - 4], 2
test esi, esi
je 0x4773bc
mov ebx, dword [ebp - 0x234]
cmp esi, ebx
je 0x477386
nop word [eax + eax]
mov edx, dword [esi]
mov eax, edi
sub edx, 0x10
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x477379
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 4
cmp esi, ebx
jne 0x477360
mov esi, dword [ebp - 0x238]
mov eax, dword [ebp - 0x230]
lea ecx, [ebp - 0x238]
sub eax, esi
sar eax, 2
push eax
push esi
call fcn.00429e70
mov dword [ebp - 0x238], 0
mov dword [ebp - 0x234], 0
mov dword [ebp - 0x230], 0
mov edx, dword [ebp - 0x224]
mov eax, edi
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4773dd
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x254]
mov dword [ebp - 4], 0xffffffff
test eax, eax
je 0x477408
push dword [ebp - 0x250]
push eax
call fcn.0046f2c0
push dword [ebp - 0x254]
call fcn.0049675d
add esp, 0xc
mov edx, dword [ebp - 0x258]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x477423
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x22c]
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.0047ac53
mov esp, ebp
pop ebp
ret