Function at 0x40b5e0
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x654
push ebx
mov ebx, ecx
push esi
push edi
mov dword [esp + 0x20], ebx
cmp dword [ebx + 4], 0
je 0x40b90e
cmp dword [ebx + 0x10], 0
je 0x40b611
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor esi, esi
test byte [ebx + 0x18], 0x10
je 0x40b8e3
push 0x1000
call fcn.0041408b
mov esi, eax
add esp, 4
test esi, esi
jne 0x40b641
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov byte [esi], 0
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x40b66d
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe4
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe8
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
lea eax, [esp + 0x38]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
je 0x40b6c2
lea eax, [esp + 0x38]
mov byte [esp + 0x437], 0
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe4
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x400
lea eax, [esp + 0x3c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x40b761
lea ecx, [esp + 0x38]
mov byte [esp + 0x437], 0
lea edx, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b6f0
sub ecx, edx
lea eax, [esp + ecx + 0x37]
lea ecx, [esp + 0x38]
cmp eax, ecx
jb 0x40b724
mov cl, byte [eax]
cmp cl, 0x5c
je 0x40b721
cmp cl, 0x2f
je 0x40b721
cmp cl, 0x3a
je 0x40b721
dec eax
lea ecx, [esp + 0x38]
cmp eax, ecx
jae 0x40b705
jmp 0x40b724
mov byte [eax], 0
lea ecx, [esp + 0x38]
lea edx, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b730
sub ecx, edx
je 0x40b761
lea eax, [esp + 0x38]
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe4
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea eax, [esp + 0x38]
push 0x400
push eax
push str._NT_SYMBOL_PATH
call edi
test eax, eax
je 0x40b7aa
lea eax, [esp + 0x38]
mov byte [esp + 0x437], 0
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe4
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x400
lea eax, [esp + 0x3c]
push eax
push str._NT_ALTERNATE_SYMBOL_PATH
call edi
test eax, eax
je 0x40b7ed
lea eax, [esp + 0x38]
mov byte [esp + 0x437], 0
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe4
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x400
lea eax, [esp + 0x3c]
push eax
push str.SYSTEMROOT
call edi
test eax, eax
je 0x40b86d
lea eax, [esp + 0x38]
mov byte [esp + 0x437], 0
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe4
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
lea eax, [esp + 0x38]
push str._system32
push 0x400
push eax
call fcn.0042a681
add esp, 0xc
lea eax, [esp + 0x38]
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push 0x437fe4
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
test byte [ebx + 0x18], 0x10
je 0x40b8e3
push 0x400
lea eax, [esp + 0x3c]
push eax
push str.SYSTEMDRIVE
call edi
test eax, eax
je 0x40b8d0
push str.SRV
push 0x1000
push esi
mov byte [esp + 0x443], 0
call fcn.0042a681
add esp, 0xc
lea eax, [esp + 0x38]
push eax
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push str.websymbols
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
push str.http:__msdl.microsoft.com_download_symbols_
jmp 0x40b8d5
push str.SRVc:websymbolshttp:__msdl.microsoft.com_download_symbols_
push 0x1000
push esi
call fcn.0042a681
add esp, 0xc
mov ecx, dword [ebx + 4]
push esi
call fcn.0040acc0
mov edi, eax
test esi, esi
je 0x40b8fb
push esi
call fcn.00413f7f
add esp, 4
test edi, edi
jne 0x40b922
mov eax, dword [ebx]
mov ecx, ebx
push edi
push edi
push edi
push str.Error_while_initializing_dbghelp.dll
call dword [eax + 0x10]
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0xc]
xor edi, edi
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 4]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], str.kernel32.dll
mov dword [esp + 0x34], str.tlhelp32.dll
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x438], 0x224
push dword [esp + edi*4 + 0x30]
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
mov dword [esp + 0x1c], esi
test esi, esi
je 0x40b9d2
push str.CreateToolhelp32Snapshot
push esi
call ebx
push str.Module32First
push esi
mov dword [esp + 0x18], eax
call ebx
push str.Module32Next
push esi
mov dword [esp + 0x1c], eax
call ebx
mov ebx, eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], ebx
test eax, eax
je 0x40b9bf
cmp dword [esp + 0x14], 0
je 0x40b9bf
test ebx, ebx
jne 0x40b9dc
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
xor esi, esi
mov dword [esp + 0x1c], esi
inc edi
cmp edi, 2
jb 0x40b972
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x20]
test esi, esi
je 0x40ba8e
push dword [esp + 0x2c]
push 8
call eax
mov edi, eax
cmp edi, 0xffffffff
je 0x40ba8e
lea eax, [esp + 0x438]
mov dword [esp + 0x10], 0
push eax
push edi
call dword [esp + 0x1c]
test eax, eax
je 0x40ba6a
mov esi, dword [esp + 0x18]
xor ebx, ebx
nop word [eax + eax]
push dword [esp + 0x450]
mov eax, dword [esp + 0x450]
mov ecx, dword [esp + 0x2c]
cdq
push edx
push eax
lea eax, [esp + 0x464]
push eax
lea eax, [esp + 0x568]
push eax
push dword [esp + 0x38]
call fcn.0040b200
lea eax, [esp + 0x438]
inc ebx
push eax
push edi
call esi
test eax, eax
jne 0x40ba20
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x20]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [esp + 0x10], 0
jle 0x40ba8e
mov eax, 1
mov dword [ebx + 0x10], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [esp + 0x24]
mov ecx, dword [esp + 0x2c]
call fcn.0040b020
test eax, eax
je 0x40baa6
mov dword [ebx + 0x10], 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret