Function at 0x40bb70
Capabilities:
Check if file exists
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42ce77
mov eax, dword fs:[0]
push eax
sub esp, 0x35c
mov eax, dword [0x43a00c]
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
lea eax, [ebp - 0x360]
mov dword [ebp - 0x360], 0
push eax
lea eax, [ebp - 0x364]
mov dword [ebp - 0x35c], 0
push eax
xor esi, esi
push 1
push esi
push esi
mov dword [ebp - 0x364], esi
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsA]
test eax, eax
je 0x40bc0b
mov edx, dword [ebp - 0x360]
xor eax, eax
mov edi, dword [ebp - 0x364]
test edx, edx
je 0x40bc04
lea ecx, [edi + 8]
nop dword [eax + eax]
cmp dword [ecx], esi
je 0x40bbfe
inc eax
add ecx, 0xc
cmp eax, edx
jb 0x40bbf0
jmp 0x40bc04
lea eax, [eax + eax*2]
mov esi, dword [edi + eax*4]
push edi
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
lea eax, [ebp - 0x35c]
push eax
push esi
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
je 0x40bc29
push dword [ebp - 0x35c]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
push 0x43bec0
push 1
push dword [ebp - 0x35c]
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
js 0x40be64
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push 0x104
lea eax, [ebp - 0x328]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x328]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
push 0x104
lea eax, [ebp - 0x118]
push 0
push eax
call fcn.004136c0
add esp, 0xc
lea eax, [ebp - 0x328]
push str...logsca_install
push eax
push str._s_s
lea eax, [ebp - 0x118]
push 0x104
push eax
call fcn.0040cf00
add esp, 0x14
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x40bcd3
push eax
lea eax, [ebp - 0x118]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
test eax, eax
jne 0x40be64
lea eax, [ebp - 0x118]
push eax
push str._s_sac_install_ca.log
lea eax, [ebp - 0x220]
push 0x104
push eax
call fcn.004092c0
lea ecx, [ebp - 0x220]
mov dword [ebp - 0x330], 0
add esp, 0x10
mov dword [ebp - 0x32c], 0xf
mov byte [ebp - 0x340], 0
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40bd17
sub ecx, edx
lea eax, [ebp - 0x220]
push ecx
push eax
lea ecx, [ebp - 0x340]
call fcn.004022a0
mov dword [ebp - 4], 0
lea edx, [ebp - 0x368]
lea ecx, [ebp - 0x340]
mov dword [ebp - 0x360], 1
call fcn.00401a60
test eax, eax
jne 0x40bd73
cmp dword [ebp - 0x364], eax
jl 0x40bd73
jg 0x40bd6f
cmp dword [ebp - 0x368], 0xa00000
jbe 0x40bd73
mov bl, 1
jmp 0x40bd75
xor bl, bl
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x32c]
cmp edx, 0x10
jb 0x40bdb6
mov ecx, dword [ebp - 0x340]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40bdac
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be87
push edx
push ecx
call fcn.0040f6ee
add esp, 8
test bl, bl
je 0x40bdc9
lea eax, [ebp - 0x220]
push eax
call fcn.00419f02
add esp, 4
lea eax, [ebp - 0x220]
push 0x436dd0
push eax
call fcn.004192d0
add esp, 8
mov dword [0x43bfc4], eax
mov dword [0x43ba80], eax
call fcn.00402500
test eax, eax
je 0x40be83
cmp dword [0x43ba80], 0
je 0x40be64
lea ecx, [ebp - 0x358]
call fcn.004011a0
cmp dword [eax + 0x14], 0x10
jb 0x40be10
mov eax, dword [eax]
push 0x289
push str.D:qianliu_agentworkspace0mq_gitlab7538NetProxyInstCaByodProxyInstCa.cpp
push eax
push str._ERROR___s__s:_d_tDllImportInit_failed_n
push dword [0x43ba80]
call fcn.00402120
mov edx, dword [ebp - 0x344]
add esp, 0x14
cmp edx, 0x10
jb 0x40be64
mov ecx, dword [ebp - 0x358]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40be5a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be8c
push edx
push ecx
call fcn.0040f6ee
add esp, 8
or eax, 0xffffffff
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.0040f469
mov esp, ebp
pop ebp
ret
xor eax, eax
jmp 0x40be67
call fcn.00415003
call fcn.00415003
int3