Function at 0x402870
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4dc050
mov eax, dword fs:[0]
push eax
sub esp, 0x6c
mov eax, dword [0x53d9f8]
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, ecx
cmp byte [ebp + 8], 0
mov dword [ebp - 4], 0
mov dword [ebx], 0
mov byte [ebx + 4], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0xc], 0
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x14], 0
je 0x402c47
cmp dword [ebp + 0x24], 0
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
je 0x402915
push 0xf
push 0x4ee540
lea ecx, [ebp + 0x14]
call fcn.00403230
cmp dword [ebp + 0x28], 8
lea eax, [ebp + 0x14]
cmovae eax, dword [ebp + 0x14]
push eax
call esi
test eax, eax
je 0x402915
cmp dword [ebp + 0x28], 8
lea eax, [ebp + 0x14]
cmovae eax, dword [ebp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebx], eax
mov eax, dword [ebx]
test eax, eax
jne 0x402bf7
cmp byte [ebp + 0x10], al
je 0x402c47
lea eax, [ebp - 0x28]
push eax
call fcn.00403110
add esp, 4
cmp dword [ebp - 0x18], 0
mov byte [ebp - 4], 1
je 0x402985
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
call esi
test eax, eax
je 0x402985
push 8
push str.office6
lea ecx, [ebp - 0x28]
call fcn.00403230
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
jmp 0x4029d8
mov edx, dword [ebp - 0x14]
xor eax, eax
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
mov byte [ebp - 4], al
cmp edx, 8
jb 0x4029d8
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4029ce
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4029ce
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004bee2d
add esp, 8
xor eax, eax
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
mov dword [ebp - 0x18], eax
push 0x4ee540
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 2
push eax
lea eax, [ebp - 0x58]
push eax
call fcn.00402760
add esp, 0xc
cmp dword [ebp - 0x30], 0
mov byte [ebp - 4], 3
je 0x402ba9
cmp dword [ebp - 0x2c], 8
lea eax, [ebp - 0x40]
cmovae eax, dword [ebp - 0x40]
push eax
call esi
test eax, eax
je 0x402ba9
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
cmovae eax, dword [ebp - 0x58]
push eax
call esi
test eax, eax
je 0x402ba9
cmp dword [ebp - 0x2c], 8
lea edi, [ebp - 0x40]
mov ecx, dword [ebp - 0x30]
cmovae edi, dword [ebp - 0x40]
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x74], ecx
cmp ecx, 8
jae 0x402a82
mov eax, dword [edi]
mov dword [ebp - 0x28], eax
mov eax, dword [edi + 4]
mov dword [ebp - 0x24], eax
mov eax, dword [edi + 8]
mov dword [ebp - 0x20], eax
mov eax, dword [edi + 0xc]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], 7
jmp 0x402ac0
mov esi, ecx
mov eax, 0x7ffffffe
or esi, 7
lea ecx, [ebp - 0x28]
cmp esi, eax
cmova esi, eax
lea eax, [esi + 1]
push eax
call fcn.004031d0
mov ecx, eax
mov eax, dword [ebp - 0x74]
mov dword [ebp - 0x28], ecx
lea eax, [eax*2 + 2]
push eax
push edi
push ecx
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x74]
add esp, 0xc
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], esi
mov edi, dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__wgetenv_s]
lea eax, [ebp - 0x74]
push str.PATH
push 0
push 0
push eax
mov byte [ebp - 4], 4
mov dword [ebp - 0x74], 0
call edi
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov esi, dword [ebp - 0x74]
add eax, 2
add esi, eax
mov edx, 2
mov eax, esi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004bee3b
mov dword [ebp - 0x78], eax
push esi
push 0
push eax
mov byte [ebp - 4], 5
call sub.VCRUNTIME140.dll_memset
push str.PATH
push esi
mov esi, dword [ebp - 0x78]
lea eax, [ebp - 0x74]
push esi
push eax
call edi
add esp, 0x30
test eax, eax
jne 0x402b80
push 1
push 0x4ee53c
lea ecx, [ebp - 0x28]
call fcn.00403230
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
push esi
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
jne 0x402b80
push esi
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x70]
push eax
call fcn.00402760
cmp dword [ebp - 0x5c], 8
lea eax, [ebp - 0x70]
cmovae eax, dword [ebp - 0x70]
push eax
push str.PATH
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__wputenv_s]
add esp, 0x14
lea ecx, [ebp - 0x70]
call fcn.00402d80
test esi, esi
je 0x402b8d
push esi
call fcn.004bee44
add esp, 4
lea ecx, [ebp - 0x28]
call fcn.00402d80
cmp dword [ebp - 0x44], 8
lea eax, [ebp - 0x58]
cmovae eax, dword [ebp - 0x58]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebx], eax
lea ecx, [ebp - 0x58]
call fcn.00402d80
mov edx, dword [ebp - 0x2c]
mov byte [ebp - 4], 0
cmp edx, 8
jb 0x402bf1
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x402be7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x402be7
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004bee2d
add esp, 8
mov eax, dword [ebx]
test eax, eax
je 0x402c47
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.IsHooked
push eax
call esi
push str.Hook
push dword [ebx]
mov dword [ebx + 8], eax
call esi
push str.UnHook
push dword [ebx]
mov dword [ebx + 0xc], eax
call esi
push str.TrueQueryRegValue
push dword [ebx]
mov dword [ebx + 0x10], eax
call esi
cmp byte [ebp + 0xc], 0
mov dword [ebx + 0x14], eax
je 0x402c47
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x402c3e
call eax
mov byte [ebx + 4], al
mov eax, dword [ebx + 8]
test eax, eax
je 0x402c47
call eax
mov edx, dword [ebp + 0x28]
cmp edx, 8
jb 0x402c83
mov ecx, dword [ebp + 0x14]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x402c79
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x402c79
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004bee2d
add esp, 8
mov eax, ebx
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.004bee49
mov esp, ebp
pop ebp
ret 0x24