Function at 0x412520
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x454
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x41afe0
mov edi, dword [ebp + 8]
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
lea ecx, [ebp - 0x18]
mov esi, dword fs:[0]
mov dword [ebp - 0x18], esi
mov dword fs:[0], ecx
lea ecx, [ebp - 0x460]
push eax
call fcn.00419bc0
add esp, 4
cmp dword [ebp - 0x460], 0
je 0x4125ca
cmp byte [ebp - 0x45c], 3
jne 0x4126e6
mov ecx, dword [ebp - 0x458]
mov eax, dword [ecx]
mov dword [ebp - 0x20], ecx
mov ecx, dword [ecx + 4]
mov dword [ebp - 0x10], 0
push eax
call dword [ecx]
add esp, 4
mov esi, dword [ebp - 0x20]
mov eax, dword [esi + 4]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x4125b5
push dword [eax + 8]
push ecx
push dword [esi]
call fcn.00442a00
add esp, 0xc
push 4
push 0xc
push esi
call fcn.00442a00
add esp, 0xc
mov edi, dword [ebp + 8]
jmp 0x4126e6
mov ecx, dword [ebp - 0x458]
test ecx, ecx
je 0x4126e6
mov edx, dword [ebp - 0x45c]
mov eax, dword [ebp - 0x454]
mov edi, 0x200
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 2
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x30], 2
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x60], edx
mov dword [ebp - 0x5c], ecx
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x58], eax
cmp edi, 0x201
jae 0x412650
jmp 0x41263e
jbe 0x412700
cmp edi, 0x201
jae 0x412650
lea ebx, [ebp - 0x460]
mov dword [ebp - 0x2c], 0x200
mov esi, edi
jmp 0x41268b
mov esi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x24]
sub edi, esi
sub eax, esi
cmp eax, edi
jae 0x41267c
mov dword [ebp - 0x10], 3
lea ecx, [ebp - 0x40]
mov edx, esi
push edi
call fcn.00451c90
add esp, 4
mov esi, dword [ebp - 0x40]
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x30], eax
mov ebx, dword [ebp - 0x30]
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x20], esi
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
push ebx
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, eax
test eax, eax
jne 0x4126b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4127f1
cmp edi, esi
jne 0x412630
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x412815
add esi, esi
mov eax, 0xffffffff
cmovb esi, eax
mov edi, esi
cmp edi, 0x201
jb 0x41263e
jmp 0x412650
mov byte [edi + 0xc], 2
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
mov eax, edi
add esp, 0x454
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x10], 3
cmp edi, eax
ja 0x412832
lea eax, [ebp - 0x54]
push edi
push ebx
push eax
call fcn.00413940
add esp, 0xc
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x4c]
movzx edx, word [ebp - 0x47]
mov esi, dword [ebp - 0x50]
movzx ebx, byte [ebp - 0x48]
mov dword [ebp - 0x24], eax
movzx eax, byte [ebp - 0x45]
mov dword [ebp - 0x2c], ecx
mov word [ebp - 0x28], dx
mov byte [ebp - 0x26], al
mov ecx, dword [ebp - 0x20]
mov edi, dword [ebp + 8]
test ecx, ecx
je 0x41275c
add ecx, ecx
push 2
push ecx
push dword [ebp - 0x30]
call fcn.00442a00
add esp, 0xc
cmp bl, 2
jne 0x4127b1
cmp byte [ebp - 0x24], 3
mov byte [edi + 0xc], 2
jne 0x4127d1
mov edx, dword [esi]
mov ecx, dword [esi + 4]
mov dword [ebp - 0x10], 2
push edx
mov dword [ebp - 0x20], esi
call dword [ecx]
add esp, 4
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + 4]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x41279f
push dword [eax + 8]
push ecx
push dword [edx]
mov esi, edx
call fcn.00442a00
mov edx, esi
add esp, 0xc
push 4
push 0xc
push edx
call fcn.00442a00
add esp, 0xc
mov edi, dword [ebp + 8]
jmp 0x4127d1
movzx ecx, word [ebp - 0x28]
mov eax, dword [ebp - 0x24]
mov word [edi + 0xd], cx
movzx ecx, byte [ebp - 0x26]
mov byte [edi + 0xf], cl
mov ecx, dword [ebp - 0x2c]
mov dword [edi + 4], esi
mov dword [edi], eax
mov dword [edi + 8], ecx
mov byte [edi + 0xc], bl
mov eax, dword [ebp - 0x44]
test eax, eax
je 0x4126ea
add eax, eax
push 2
push eax
push dword [ebp - 0x34]
call fcn.00442a00
add esp, 0xc
jmp 0x4126ea
mov bl, 2
mov dword [ebp - 0x24], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, dword [ebp - 0x20]
mov edi, dword [ebp + 8]
test ecx, ecx
jne 0x41274c
jmp 0x41275c
mov dword [ebp - 0x10], 3
push 0x460c6c
push 0x28
push 0x45f85f
call fcn.00451670
add esp, 0xc
jmp 0x412841
push 0x460c7c
push eax
push edi
call fcn.00451a10
add esp, 0xc
ud2