Function at 0x407640
Capabilities:
Access peb ldr_data
Get common file path
Query environment variable

Disassembly:
push 0xffffffffffffffff
push 0x4e082e
mov eax, dword fs:[0]
push eax
sub esp, 0x21c
mov eax, dword [0x50f130]
xor eax, esp
mov dword [esp + 0x218], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x50f130]
xor eax, esp
push eax
lea eax, [esp + 0x230]
mov dword fs:[0], eax
mov esi, ecx
xor ebx, ebx
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x238], ebx
mov eax, dword [esp + 0x240]
add eax, 0xfffffff0
call fcn.004012d0
add eax, 0x10
mov dword [esp + 0x20], eax
mov byte [esp + 0x238], 1
mov eax, dword [0x5143ac]
mov edx, dword [eax + 0xc]
mov ecx, 0x5143ac
call edx
add eax, 0x10
mov dword [esp + 0x14], eax
push 0x206
lea eax, [esp + 0x2a]
push ebx
mov byte [esp + 0x240], 2
push eax
mov word [esp + 0x30], bx
call fcn.004be320
add esp, 0xc
lea edi, [esp + 0x240]
call fcn.00408010
mov ebp, dword [esp + 0x240]
mov eax, dword [ebp - 0xc]
cmp eax, ebx
jl 0x407743
push str._APPDATA_ALL_USER_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x407743
sub eax, ebp
sar eax, 1
js 0x407743
push str._APPDATA_ALL_USER_
mov ebx, 0x12
lea eax, [esp + 0x18]
call fcn.00401450
push 0x104
lea ecx, [esp + 0x28]
push ecx
push str._ALLUSERSPROFILE_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
xor ebx, ebx
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._APPDATA_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x40778c
sub eax, ebp
sar eax, 1
js 0x40778c
mov edx, str._APPDATA_
lea edi, [esp + 0x14]
call fcn.004049e0
push 0x104
lea edx, [esp + 0x28]
push edx
push str._APPDATA_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._TEMP_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x4077d5
sub eax, ebp
sar eax, 1
js 0x4077d5
mov edx, str._TEMP_
lea edi, [esp + 0x14]
call fcn.004049e0
push 0x104
lea eax, [esp + 0x28]
push eax
push str._TEMP_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._SYSTEM_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x407819
sub eax, ebp
sar eax, 1
js 0x407819
mov edx, str._SYSTEM_
lea edi, [esp + 0x14]
call fcn.004049e0
push 0x104
lea ecx, [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._WINDOWS_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x40785d
sub eax, ebp
sar eax, 1
js 0x40785d
mov edx, str._WINDOWS_
lea edi, [esp + 0x14]
call fcn.004049e0
push 0x104
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._QQ_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x4078a5
sub eax, ebp
sar eax, 1
js 0x4078a5
mov edx, str._QQ_
lea edi, [esp + 0x14]
call fcn.004049e0
lea ebx, [esp + 0x24]
call fcn.00407a90
mov eax, ebx
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
xor ebx, ebx
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._CUR_MODULE_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x407917
sub eax, ebp
sar eax, 1
js 0x407917
mov edx, str._CUR_MODULE_
lea edi, [esp + 0x14]
call fcn.004049e0
mov edi, dword [0x5143cc]
lea esi, [esp + 0x18]
call fcn.004215f0
mov ecx, dword [esp + 0x18]
push 0xffffffffffffffff
push ecx
lea edx, [esp + 0x2c]
push 0x104
push edx
call fcn.004b9c7c
add esp, 0x10
lea eax, [esp + 0x24]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov ecx, esi
call fcn.00416ce0
mov esi, dword [esp + 0x1c]
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._CUR_EXE_MODULE_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x407960
sub eax, ebp
sar eax, 1
js 0x407960
mov edx, str._CUR_EXE_MODULE_
lea edi, [esp + 0x14]
call fcn.004049e0
push 0x104
lea ecx, [esp + 0x28]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
jmp 0x40799b
cmp dword [ebp - 0xc], ebx
jl 0x40799b
push str._CUR_DIR_
push ebp
call fcn.004b9c1e
add esp, 8
cmp eax, ebx
je 0x40799b
sub eax, ebp
sar eax, 1
js 0x40799b
mov edx, str._CUR_DIR_
lea edi, [esp + 0x14]
call fcn.004049e0
lea eax, [esp + 0x24]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov edi, dword [esp + 0x14]
cmp dword [edi - 0xc], ebx
je 0x4079db
lea eax, [esp + 0x24]
lea edx, [eax + 2]
jmp 0x4079b0
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4079b0
sub eax, edx
sar eax, 1
je 0x4079db
lea ecx, [esp + 0x24]
push ecx
push edi
lea edx, [esp + 0x248]
push edx
call fcn.00407df0
mov ebp, dword [esp + 0x240]
add ebp, 0xfffffff0
mov eax, ebp
call fcn.004012d0
add eax, 0x10
mov dword [esi], eax
lea eax, [edi - 0x10]
mov byte [esp + 0x238], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407a0e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x238], bl
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407a35
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x238], 0xffffffff
lea ecx, [ebp + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407a5a
mov ecx, dword [ebp]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebp
call edx
mov eax, esi
mov ecx, dword [esp + 0x230]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x218]
xor ecx, esp
call fcn.004b84de
add esp, 0x228
ret 4