Function at 0x476a28
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d9528
mov eax, dword fs:[0]
push eax
sub esp, 0x228
mov eax, dword [0x51452c]
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]
mov dword [ebp - 0x234], ebx
mov dword [ebp - 0x22c], ebx
call fcn.0042f360
mov ecx, eax
test ecx, ecx
je 0x4764ea
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x228], eax
push 0x4df194
lea ecx, [ebp - 0x228]
mov dword [ebp - 4], 0
call fcn.0040f350
test al, al
jne 0x476177
push 0
push 0x4df194
lea ecx, [ebp - 0x228]
call fcn.0040dae0
push dword [ebp + 0xc]
mov dword [ebp - 4], 1
call fcn.00478d20
mov edx, dword [0x518708]
add esp, 4
mov edi, eax
mov eax, edx
mov ecx, dword [edx + 4]
cmp byte [ecx + 0xd], 0
jne 0x4761bd
nop dword [eax]
cmp dword [ecx + 0x10], edi
jge 0x4761aa
mov ecx, dword [ecx + 8]
jmp 0x4761ae
mov eax, ecx
mov ecx, dword [ecx]
cmp byte [ecx + 0xd], 0
je 0x4761a0
cmp eax, edx
je 0x4761bd
cmp edi, dword [eax + 0x10]
jge 0x4761bf
mov eax, edx
cmp edx, eax
je 0x4761d2
add eax, 0x14
lea ecx, [ebp - 0x228]
push eax
call fcn.0040efb0
mov esi, dword [ebp - 0x228]
cmp dword [esi - 0xc], 0
jne 0x47623f
call fcn.0042f360
mov ecx, eax
test ecx, ecx
je 0x4764f4
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebx], eax
push 0x4df194
mov ecx, ebx
mov byte [ebp - 4], 2
call fcn.0040f350
test al, al
jne 0x476219
push 0
push 0x4df194
mov ecx, ebx
call fcn.0040dae0
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x476238
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, ebx
jmp 0x4764ce
lea eax, [ebp - 0x230]
push eax
lea ecx, [ebp - 0x221]
call fcn.0046e990
lea eax, [edi - 3]
mov byte [ebp - 4], 3
or ebx, 0xffffffff
cmp eax, 0x3d
ja case.0x47626b.4
movzx eax, byte [eax + 0x476518]
jmp dword [eax*4 + 0x476508]
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x221]
call fcn.0046fa90
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 4
call fcn.0040efb0
mov edx, dword [ebp - 0x22c]
mov eax, ebx
mov byte [ebp - 4], 3
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4762b5
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x221]
call fcn.00474200
push eax
lea ecx, [ebp - 0x230]
mov byte [ebp - 4], 5
call fcn.0040efb0
mov edx, dword [ebp - 0x22c]
mov eax, ebx
mov byte [ebp - 4], 3
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4762f8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x228]
jmp case.0x47626b.4
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x18], 0x64006c
mov dword [ebp - 0x14], 0x73
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x476314
sub ecx, edx
lea eax, [ebp - 0x18]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x228]
call fcn.0040dae0
push 0xd
push str.Wallpaper.set
lea ecx, [ebp - 0x230]
call fcn.0040dae0
mov esi, dword [ebp - 0x228]
jmp case.0x47626b.4
push 0xa
push str.HaloWP.set
lea ecx, [ebp - 0x230]
call fcn.0040dae0
cmp edi, 0x3f
je 0x47637d
cmp edi, 0x43
je 0x47637d
cmp edi, 0x42
je 0x47637d
cmp edi, 0x44
je 0x47637d
cmp edi, 0x45
mov edi, 0x1a
jne 0x476382
mov edi, 0x1c
push 0x208
lea eax, [ebp - 0x220]
push 0
push eax
call fcn.0047ce50
add esp, 0xc
lea eax, [ebp - 0x220]
push 0
push edi
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x220]
push esi
push eax
call edi
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4763da
lea eax, [ebp - 0x220]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push dword [ebp - 0x230]
lea eax, [ebp - 0x220]
push eax
call edi
call fcn.0042f360
mov ecx, eax
test ecx, ecx
je 0x4764fe
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x22c], eax
lea eax, [ebp - 0x220]
mov byte [ebp - 4], 6
push eax
lea ecx, [ebp - 0x22c]
call fcn.0040f350
test al, al
jne 0x476452
lea ecx, [ebp - 0x220]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x476430
sub ecx, edx
lea eax, [ebp - 0x220]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x22c]
call fcn.0040dae0
mov edi, dword [ebp - 0x22c]
add edi, 0xfffffff0
mov byte [ebp - 4], 7
push edi
call fcn.0040c910
mov ecx, dword [ebp - 0x234]
add eax, 0x10
add esp, 4
mov byte [ebp - 4], 3
mov dword [ecx], eax
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x47648b
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x230]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4764ac
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x4764c8
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x234]
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.0046659c
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.0040c8c0
push 0x80004005
call fcn.0040c8c0
push 0x80004005
call fcn.0040c8c0
jb 0x47656c
inc edi
add byte [ebp + 0x63], cl
inc edi
add byte [eax], al
arpl word [edi], ax
pop edi
arpl word [edi], ax
add byte [ebx], al
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [eax]
add eax, dword [ebx]
add dword [edx], eax
int3
add byte [eax], al
add byte [eax], al
push eax
sub esp, 0x220
mov eax, dword [0x51452c]
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 edi, dword [ebp + 8]
mov dword [ebp - 0x22c], edi
call fcn.0042f360
mov ecx, eax
test ecx, ecx
je 0x476bf0
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x224], eax
push 0x4df194
lea ecx, [ebp - 0x224]
mov dword [ebp - 4], 0
call fcn.0040f350
test al, al
jne 0x4765e1
push 0
push 0x4df194
lea ecx, [ebp - 0x224]
call fcn.0040dae0
push dword [ebp + 0xc]
mov dword [ebp - 4], 1
call fcn.00478d20
mov edx, dword [0x518708]
add esp, 4
mov esi, eax
mov eax, edx
mov ecx, dword [edx + 4]
cmp byte [ecx + 0xd], 0
jne 0x476623
cmp dword [ecx + 0x10], esi
jge 0x476610
mov ecx, dword [ecx + 8]
jmp 0x476614
mov eax, ecx
mov ecx, dword [ecx]
cmp byte [ecx + 0xd], 0
je 0x476606
cmp eax, edx
je 0x476623
cmp esi, dword [eax + 0x10]
jge 0x476625
mov eax, edx
cmp edx, eax
je 0x476638
add eax, 0x14
lea ecx, [ebp - 0x224]
push eax
call fcn.0040efb0
mov eax, dword [ebp - 0x224]
cmp dword [eax - 0xc], 0
jne 0x4766ad
call fcn.0042f360
mov ecx, eax
test ecx, ecx
je 0x476bfa
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [edi], eax
push 0x4df194
mov ecx, edi
mov byte [ebp - 4], 2
call fcn.0040f350
test al, al
jne 0x47667f
push 0
push 0x4df194
mov ecx, edi
call fcn.0040dae0
mov esi, dword [ebp - 0x224]
or eax, 0xffffffff
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x476bd2
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
jmp 0x476bd2
lea eax, [ebp - 0x228]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046f340
add esi, 0xfffffffd
mov byte [ebp - 4], 3
cmp esi, 0x42
ja case.0x4766d6.4
movzx eax, byte [esi + 0x476c3c]
jmp dword [eax*4 + 0x476c10]
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046a920
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 4
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00472550
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 5
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00475c10
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 6
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00468b30
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 7
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.004686e0
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 8
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00472390
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 9
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00472c00
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0xa
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.004753c0
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 0xb
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00468090
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0xc
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046a160
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 0xd
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00471150
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0xe
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046feb0
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 0xf
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00468150
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0x10
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046c920
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 0x11
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046b240
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0x12
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046bc70
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 0x13
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046bf50
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0x14
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046be70
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 0x15
call fcn.0040efb0
lea ecx, [ebp - 0x220]
jmp 0x476a81
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.00473a60
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 0x16
call fcn.0040efb0
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.0040c660
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x219]
call fcn.0046b160
push eax
lea ecx, [ebp - 0x228]
mov byte [ebp - 4], 0x17
call fcn.0040efb0
lea ecx, [ebp - 0x22c]
mov byte [ebp - 4], 3
call fcn.0040c660
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.0047ce50
add esp, 0xc
lea eax, [ebp - 0x218]
push 0
push 0x1a
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push dword [ebp - 0x224]
mov esi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call esi
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x476ae8
lea eax, [ebp - 0x218]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push dword [ebp - 0x228]
lea eax, [ebp - 0x218]
push eax
call esi
call fcn.0042f360
mov ecx, eax
test ecx, ecx
je 0x476c04
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 0x18
push eax
lea ecx, [ebp - 0x220]
call fcn.0040f350
test al, al
jne 0x476b59
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x476b37
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x220]
call fcn.0040dae0
mov ebx, dword [ebp - 0x220]
add ebx, 0xfffffff0
mov byte [ebp - 4], 0x19
push ebx
call fcn.0040c910
add eax, 0x10
mov byte [ebp - 4], 3
or esi, 0xffffffff
mov dword [edi], eax
add esp, 4
mov eax, esi
lock xadd dword [ebx + 0xc], eax
dec eax
test eax, eax
jg 0x476b8f
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x228]
mov eax, esi
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x476bb0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x224]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x476bd2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, edi
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.0046659c
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.0040c8c0
push 0x80004005
call fcn.0040c8c0
push 0x80004005
call fcn.0040c8c0
nop
frstor dword [esi + 0x47]
add byte [ebx], bh
inc edi
add byte [ecx - 0x4cffb899], bl
push 0x67f70047
inc edi
add byte [ebp + 0x68], dl
inc edi
add byte [edi + 0x69], ch
inc edi
add byte [ecx], dl
imul eax, dword [edi], case.0x4766d6.68
sub byte [edx + 0x47], ch
add byte [edx + 18282], cl
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
or cl, byte [edx]
add byte [ecx], al
add al, byte [ebx]
add al, 5
push es
pop es
or byte [ecx], cl
int3