Function at 0x407644
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x803c
call fcn.00417820
push edi
push esi
push ebx
add esp, 0xfffffffc
push 0x2000
lea ebx, [ebp - 0x4000]
push ebx
push 0x79
call fcn.00401aa8
add esp, 0xfffffff8
push ebx
push 0x40762f
call fcn.0040874c
add esp, 0x20
mov dword [ebp - 0x4010], 0
mov dword [ebp - 0x400c], 0
mov dword [ebp - 0x4008], 0
add esp, 0xfffffff8
push 0x4056cf
push ebx
jmp 0x407718
add esp, 0xfffffff4
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
push ecx
call fcn.00417610
mov dword [ebp - 0x8024], eax
add esp, 0xfffffff8
push ebx
push eax
call sub.msvcrt.dll_strcpy
lea ecx, [ebp - 0x4010]
lea eax, [ebp - 0x8024]
add esp, 0x20
mov edx, dword [ebp - 0x400c]
cmp edx, dword [ebp - 0x4008]
je 0x407700
test edx, edx
je 0x4076f4
mov eax, dword [ebp - 0x8024]
mov dword [edx], eax
add dword [ebp - 0x400c], 4
jmp 0x40770e
add esp, 0xfffffffc
push eax
push edx
push ecx
call fcn.0041cfc4
add esp, 0x10
add esp, 0xfffffff8
push 0x4056cf
push 0
call sub.msvcrt.dll_strtok
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x40773b
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
cmp ecx, 0xfffffffe
jne 0x4076a4
mov dword [ebp - 0x8028], 0
jmp 0x40795d
mov eax, dword [ebp - 0x8028]
shl eax, 2
add eax, dword [ebp - 0x4010]
mov esi, dword [eax]
add esp, 0xfffffff8
lea eax, [esi + 2]
push eax
lea edi, [ebp - 0x6020]
push edi
call sub.msvcrt.dll_strcpy
add esp, 0xfffffff4
push edi
call fcn.00406e34
add esp, 0x20
cmp byte [esi + 1], 0x31
sete byte [ebp - 0x8029]
mov al, byte [esi]
cmp al, 0x44
je 0x40780c
jg 0x407798
cmp al, 0x41
je 0x40780c
jmp 0x407922
cmp al, 0x45
je 0x407854
cmp al, 0x53
jne 0x407922
add esp, 0xfffffffc
push 0
push edi
lea ebx, [ebp - 0x8020]
push ebx
call fcn.0040498c
add esp, 0xfffffffc
push 0x4056d1
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.004079ec
mov byte [ebp - 0x802a], al
add esp, 0x20
add esp, 0xfffffffc
push 0x4056d5
push ebx
mov edx, dword [ebp + 8]
push edx
call fcn.004079ec
add esp, 0x10
cmp byte [ebp - 0x802a], 0
setne byte [ebp - 0x802a]
test al, al
setne al
movzx eax, al
or byte [ebp - 0x802a], al
jmp 0x407922
add esp, 0xfffffff8
push edi
lea ebx, [ebp - 0x8020]
push ebx
call fcn.00404184
add esp, 0xfffffff4
push ebx
call fcn.004044ac
mov byte [ebp - 0x802a], al
add esp, 0x20
add esp, 0xfffffff8
push ebx
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_strcat
add esp, 0xfffffff8
push 0x4056cf
mov edx, dword [ebp + 8]
push edx
call sub.msvcrt.dll_strcat
add esp, 0x20
jmp 0x407922
add esp, 0xfffffffc
push 0x2000
lea ebx, [ebp - 0x8020]
push ebx
push edi
call sub.KERNEL32.dll_GetEnvironmentVariableA
add esp, 4
test eax, eax
je 0x4078fc
cmp byte [ebp - 0x8020], 0x22
jne 0x4078b4
mov edi, ebx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
cmp byte [ebx + ecx - 2], 0x22
jne 0x4078b4
mov edi, ebx
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
mov byte [ebx + ecx - 2], al
add esp, 0xfffffff8
lea eax, [ebp - 0x801f]
push eax
mov edx, dword [ebp + 8]
push edx
jmp 0x4078bc
add esp, 0xfffffff8
push ebx
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_strcat
add esp, 0x10
lea edx, [ebp - 0x8020]
mov edi, edx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
cmp byte [edx + ecx - 2], 0x3b
je 0x4078f3
add esp, 0xfffffff8
push 0x4056cf
mov edx, dword [ebp + 8]
push edx
call sub.msvcrt.dll_strcat
add esp, 0x10
mov byte [ebp - 0x802a], 1
jmp 0x407922
cmp byte [ebp - 0x8029], 0
je 0x40794b
call sub.KERNEL32.dll_GetLastError
cmp eax, 0xcb
jne 0x407922
add esp, 0xfffffff8
push edi
push 0x3f0
call fcn.00403b2c
add esp, 0x10
cmp byte [ebp - 0x8029], 0
je 0x40794b
cmp byte [ebp - 0x802a], 0
jne 0x40794b
add esp, 0xfffffff8
lea eax, [ebp - 0x6020]
push eax
push 0x3ee
call fcn.00403b2c
add esp, 0x10
add esp, 0xfffffff4
push esi
call fcn.0041772c
add esp, 0x10
inc dword [ebp - 0x8028]
mov eax, dword [ebp - 0x4010]
mov edx, dword [ebp - 0x400c]
sub edx, eax
mov eax, edx
sar eax, 2
cmp dword [ebp - 0x8028], eax
jb 0x40774c
mov edi, dword [ebp - 0x4010]
mov eax, dword [ebp - 0x4008]
sub eax, edi
sar eax, 2
je 0x4079dc
shl eax, 2
cmp eax, 0x80
jbe 0x4079a4
add esp, 0xfffffff4
push edi
call sub.msvcrt.dll_free
jmp 0x4079dc
lea ebx, [eax + 7]
shr ebx, 3
lea ebx, [ebx*4 - 4]
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_EnterCriticalSection
add esp, 0xc
mov eax, dword [ebx + 0x422c0c]
mov dword [edi], eax
mov dword [ebx + 0x422c0c], edi
add esp, 0xfffffff4
push 0x430408
call sub.KERNEL32.dll_LeaveCriticalSection
lea esp, [ebp - 0x8048]
pop ebx
pop esi
pop edi
leave
ret