Function at 0x402700
Capabilities:
Check if file exists
Copy file
Get common file path
Query or enumerate registry value
Set registry value

Disassembly:
sub esp, 0x114
push ebx
mov ebx, dword [esp + 0x11c]
push ebp
push esi
push edi
xor edi, edi
cmp ebx, edi
je 0x4029e6
cmp byte [ebx], 0
je 0x4029e6
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x402736
push ebx
push ebx
call fcn.00402a00
mov ebp, dword [esp + 0x12c]
mov dword [esp + 0x1c], 1
cmp ebp, edi
je 0x40275b
cmp byte [ebp], 0
je 0x40275b
push ebp
push ebx
call dword [sym.imp.SHLWAPI.dll_PathIsSameRootA]
mov dword [esp + 0x1c], eax
mov esi, dword [sym.imp.SHLWAPI.dll_SHGetValueA]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x18]
push edi
push ecx
push str.PendingFileRenameOperations
push str.SYSTEMCurrentControlSetControlSession_Manager
push closesocket
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
call esi
test eax, eax
jne 0x402792
mov eax, dword [esp + 0x10]
cmp eax, 6
jae 0x4027a0
xor eax, eax
mov dword [esp + 0x14], 7
mov dword [esp + 0x10], eax
add eax, 0x622
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edx, eax
add esp, 4
cmp edx, edi
mov dword [esp + 0x18], edx
je 0x4029e6
mov eax, dword [esp + 0x10]
mov edi, edx
lea ecx, [eax + 0x622]
xor eax, eax
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x10]
test eax, eax
jbe 0x40281d
mov edi, dword [esp + 0x18]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x18]
push edi
push ecx
push str.PendingFileRenameOperations
push str.SYSTEMCurrentControlSetControlSession_Manager
push closesocket
call esi
test eax, eax
jne 0x40280d
mov eax, dword [esp + 0x10]
cmp eax, 6
jae 0x402821
xor eax, eax
mov dword [esp + 0x14], 7
mov dword [esp + 0x10], eax
jmp 0x402821
mov edi, dword [esp + 0x18]
test eax, eax
mov esi, edi
je 0x40282b
lea esi, [edi + eax - 1]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40289a
mov al, byte [ebx]
mov edi, dword [sym.imp.MSVCRT.dll__snprintf]
test al, al
je 0x402853
push ebx
push str.___s
push 0x104
push esi
call edi
add esp, 0x10
inc eax
jmp 0x40285b
mov byte [esi], 0
mov eax, 1
add esi, eax
test ebp, ebp
je 0x40288b
cmp byte [ebp], 0
je 0x40288b
mov byte [esi], 0x21
mov al, byte [ebp]
inc esi
test al, al
je 0x40288b
push ebp
push str.___s
push 0x104
push esi
call edi
add esp, 0x10
inc eax
add esi, eax
jmp 0x40299d
mov eax, 1
mov byte [esi], 0
add esi, eax
jmp 0x40299d
push 0x104
lea edx, [esp + 0x24]
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
lea ecx, [esp + 0x20]
lea edx, [esp + 0x20]
push ecx
push 0
push 0x409358
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea eax, [esp + 0x20]
push 0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CopyFileA]
mov edi, dword [sym.imp.MSVCRT.dll__snprintf]
lea ecx, [esp + 0x20]
test ecx, ecx
je 0x402909
mov al, byte [esp + 0x20]
test al, al
je 0x402909
lea edx, [esp + 0x20]
push edx
push str.___s
push 0x104
push esi
call edi
add esp, 0x10
inc eax
jmp 0x402911
mov byte [esi], 0
mov eax, 1
add esi, eax
mov byte [esi], 0x21
inc esi
test ebp, ebp
je 0x402935
cmp byte [ebp], 0
je 0x402935
push ebp
push str.___s
push 0x104
push esi
call edi
add esp, 0x10
inc eax
jmp 0x40293d
mov byte [esi], 0
mov eax, 1
add esi, eax
lea eax, [esp + 0x20]
test eax, eax
je 0x402967
mov al, byte [esp + 0x20]
test al, al
je 0x402967
lea ecx, [esp + 0x20]
push ecx
push str.___s
push 0x104
push esi
call edi
add esp, 0x10
inc eax
jmp 0x40296f
mov byte [esi], 0
mov eax, 1
add esi, eax
mov byte [esi], 0
mov al, byte [ebx]
inc esi
test al, al
je 0x40298f
push ebx
push str.___s
push 0x104
push esi
call edi
add esp, 0x10
inc eax
jmp 0x402997
mov byte [esi], 0
mov eax, 1
add esi, eax
mov byte [esi], 0
inc esi
mov edi, dword [esp + 0x18]
mov byte [esi], 0
mov edx, dword [esp + 0x14]
sub esi, edi
inc esi
push esi
push edi
push edx
push str.PendingFileRenameOperations
push str.SYSTEMCurrentControlSetControlSession_Manager
push closesocket
mov dword [esp + 0x28], esi
call dword [sym.imp.SHLWAPI.dll_SHSetValueA]
mov esi, eax
push edi
neg esi
sbb esi, esi
inc esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x114
ret 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x114
ret 8