Function at 0x412f40
Capabilities:
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x3028]
mov eax, 0x3028
call fcn.0042f960
push 0xffffffffffffffff
push 0x4436a4
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x451a14]
xor eax, ebp
mov dword [ebp + 0x3024], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebp + 0x3034]
mov eax, dword [ebp + 0x3030]
mov dword [ebp - 0x4c], ecx
xor ecx, ecx
mov word [ebp + 0x2024], cx
test eax, eax
je 0x412fca
cmp byte [ebp + 0x3038], cl
je 0x412fb8
push ecx
push 1
push 0x800
lea ecx, [ebp + 0x2024]
push ecx
push eax
call fcn.00416730
jmp 0x412fca
push 0x800
push eax
lea eax, [ebp + 0x2024]
push eax
call fcn.00422a80
lea ecx, [ebp]
call fcn.00411190
cmp word [ebp + 0x2024], 0
mov dword [ebp - 4], 0
je 0x413029
mov bl, byte [ebp + 0x303c]
lea eax, [ebp + 0x2024]
lea ecx, [ebp]
test bl, bl
je 0x412ffe
push eax
call fcn.00411ce0
jmp 0x413006
push 0
push eax
call fcn.00411680
test al, al
jne 0x413030
test bl, bl
je 0x41301a
push 6
mov ecx, 0x45c338
call fcn.0040ce70
lea ecx, [ebp]
call fcn.004111d0
xor al, al
jmp 0x41340b
mov dword [ebp + 0xc], 1
xor esi, esi
mov byte [ebp - 0x14], 0
push 0x1000
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], esi
call fcn.004016f0
mov ecx, dword [ebp - 0x24]
push 0x1000
push ecx
lea ecx, [ebp]
mov byte [ebp - 4], 1
call fcn.00411960
test eax, eax
je 0x4130a2
push eax
lea ecx, [ebp - 0x24]
add esi, eax
call fcn.004016f0
mov eax, dword [ebp - 0x24]
lea ecx, [ebp]
add eax, esi
push 0x1000
push eax
call fcn.00411960
test eax, eax
jne 0x413068
cmp esi, dword [ebp - 0x1c]
jbe 0x4130a2
mov eax, esi
lea ecx, [ebp - 0x24]
sub eax, dword [ebp - 0x20]
push eax
call fcn.004016f0
mov edi, dword [ebp - 0x20]
jmp 0x4130a7
mov edi, esi
mov dword [ebp - 0x20], edi
mov ecx, dword [ebp - 0x24]
cmp esi, 2
jb 0x4130c3
cmp byte [ecx], 0xff
jne 0x4130c3
cmp byte [ecx + 1], 0xfe
jne 0x4130c3
mov dword [ebp - 0x28], 1
jmp 0x4130c8
xor eax, eax
mov dword [ebp - 0x28], eax
cmp esi, 2
jb 0x4130df
cmp byte [ecx], 0xfe
jne 0x4130df
cmp byte [ecx + 1], 0xff
mov dword [ebp - 0x40], 1
je 0x4130e6
mov dword [ebp - 0x40], 0
cmp esi, 3
jb 0x413100
cmp byte [ecx], 0xef
jne 0x413100
cmp byte [ecx + 1], 0xbb
jne 0x413100
cmp byte [ecx + 2], 0xbf
mov byte [ebp - 0xd], 1
je 0x413104
mov byte [ebp - 0xd], 0
mov ebx, dword [ebp + 0x3040]
test ebx, ebx
jne 0x413117
push esi
push ecx
call fcn.00412e90
mov ebx, eax
xor ecx, ecx
mov dword [ebp - 0x3c], 0
xor esi, esi
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x30], ecx
mov byte [ebp - 0x2c], cl
mov byte [ebp - 4], 2
test ebx, ebx
je 0x413140
cmp ebx, 2
je 0x413140
cmp ebx, 1
jne 0x413188
push 1
lea ecx, [ebp - 0x24]
call fcn.004016f0
mov edi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x24]
mov byte [edi + eax - 1], 0
cmp ebx, 2
jne 0x413162
push eax
push eax
call dword [sym.imp.USER32.dll_OemToCharA]
test edi, edi
je 0x413174
push edi
lea ecx, [ebp - 0x3c]
call fcn.004017c0
mov esi, dword [ebp - 0x38]
jmp 0x413179
mov esi, edi
mov dword [ebp - 0x38], esi
push esi
push dword [ebp - 0x3c]
push dword [ebp - 0x24]
call fcn.00424d10
mov ecx, dword [ebp - 0x34]
cmp ebx, 3
jne 0x413234
mov ebx, dword [ebp - 0x28]
mov dword [ebp - 0x44], 2
test ebx, ebx
jne 0x4131ac
cmp dword [ebp - 0x40], ebx
jne 0x4131ac
xor eax, eax
mov dword [ebp - 0x44], eax
lea ebx, [eax + 1]
mov eax, edi
shr eax, 1
inc eax
cmp eax, ecx
jbe 0x4131c2
sub eax, esi
lea ecx, [ebp - 0x3c]
push eax
call fcn.004017c0
jmp 0x4131c5
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x44]
and edi, 0xfffffffe
mov dword [ebp - 0x48], edi
cmp eax, edi
jae 0x413225
mov esi, dword [ebp - 0x24]
mov edx, edi
sub ebx, dword [ebp - 0x40]
sub edx, eax
dec edx
mov dword [ebp - 0x28], ebx
add esi, eax
shr edx, 1
add esi, dword [ebp - 0x40]
inc edx
mov eax, pe_nt_image_headers32
xor edi, edi
nop
movzx ecx, byte [ebx + esi]
lea esi, [esi + 2]
mov ebx, dword [ebp - 0x3c]
movzx eax, ax
imul ecx, eax
movzx eax, byte [esi - 2]
add cx, ax
mov eax, edi
shr eax, 1
add edi, 2
mov word [ebx + eax*2], cx
mov eax, pe_nt_image_headers32
mov ebx, dword [ebp - 0x28]
sub edx, 1
jne 0x4131f0
mov edi, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
mov esi, dword [ebp - 0x3c]
sub edi, eax
shr edi, 1
xor eax, eax
mov word [esi + edi*2], ax
jmp 0x413283
cmp ebx, 4
jne 0x413280
push 1
lea ecx, [ebp - 0x24]
call fcn.004016f0
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x24]
mov byte [eax + ebx - 1], 0
cmp eax, dword [ebp - 0x34]
jbe 0x413263
sub eax, esi
lea ecx, [ebp - 0x3c]
push eax
call fcn.004017c0
mov eax, dword [ebp - 0x38]
jmp 0x413266
mov dword [ebp - 0x38], eax
mov esi, dword [ebp - 0x3c]
push eax
movzx eax, byte [ebp - 0xd]
neg eax
push esi
sbb eax, eax
and eax, 3
add eax, ebx
push eax
call fcn.00424e00
jmp 0x413286
mov esi, dword [ebp - 0x3c]
mov ebx, dword [ebp - 0x24]
cmp word [esi], 0
mov edi, esi
je 0x4133c2
mov bh, byte [ebp + 0x3044]
mov bl, byte [ebp + 0x304c]
mov edi, edi
xor ecx, ecx
mov esi, edi
cmp word [edi], 0xd
je 0x4132dc
mov dl, byte [ebp + 0x3048]
movzx eax, word [esi]
cmp eax, 0xa
je 0x4132dc
test ax, ax
je 0x4132dc
test dl, dl
je 0x4132d3
cmp eax, 0x2f
jne 0x4132d3
cmp word [esi + 2], ax
jne 0x4132d3
xor eax, eax
mov ecx, esi
mov word [esi], ax
add esi, 2
cmp word [esi], 0xd
jne 0x4132b0
movzx eax, word [esi]
mov dword [ebp - 0x48], eax
xor eax, eax
mov word [esi], ax
test ecx, ecx
jne 0x4132ed
mov ecx, esi
lea eax, [ecx - 2]
cmp eax, edi
jb 0x41330d
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x413301
cmp ecx, 9
jne 0x41330d
xor ecx, ecx
mov word [eax], cx
sub eax, 2
cmp eax, edi
jae 0x4132f4
test bh, bh
je 0x413341
cmp word [edi], 0x22
jne 0x413341
mov ecx, edi
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x413320
sub ecx, edx
sar ecx, 1
cmp word [edi + ecx*2 - 2], 0x22
jne 0x413341
xor eax, eax
mov word [edi + ecx*2 - 2], ax
add edi, 2
test bl, bl
je 0x413385
cmp word [edi], 0x25
jne 0x413385
xor eax, eax
mov word [ebp + 0x1024], ax
lea eax, [ebp + 0x1024]
push 0x800
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x413385
cmp eax, 0x800
jae 0x413385
cmp word [ebp + 0x1024], 0
je 0x413394
lea eax, [ebp + 0x1024]
push eax
jmp 0x41338c
cmp word [edi], 0
je 0x413394
push edi
mov ecx, dword [ebp - 0x4c]
call fcn.00422b40
cmp word [ebp - 0x48], 0
je 0x4133bc
lea edi, [esi + 2]
mov edi, edi
movzx eax, word [edi]
cmp eax, 0xd
je 0x4133ad
cmp eax, 0xa
jne 0x4133b2
add edi, 2
jmp 0x4133a0
cmp word [edi], 0
jne 0x4132a0
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x3c]
cmp byte [ebp - 0x2c], 0
mov byte [ebp - 4], 3
je 0x4133d8
mov eax, dword [ebp - 0x34]
add eax, eax
push eax
push esi
call fcn.00420960
push esi
call fcn.00433947
add esp, 4
mov byte [ebp - 4], 4
test ebx, ebx
je 0x413401
cmp byte [ebp - 0x14], 0
je 0x4133f8
push dword [ebp - 0x1c]
push ebx
call fcn.00420960
push ebx
call fcn.00433947
add esp, 4
lea ecx, [ebp]
call fcn.004111d0
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x3024]
xor ecx, ebp
call fcn.0042f943
lea esp, [ebp + 0x3028]
pop ebp
ret 0x20