Function at 0x404a46
Capabilities:
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x303c]
mov eax, 0x303c
call fcn.0040a9a0
push 0xffffffffffffffff
push 0x41fb06
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x42b7a4]
xor eax, ebp
mov dword [ebp + 0x3038], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebp + 0x3048]
xor ebx, ebx
mov eax, dword [ebp + 0x3044]
mov dword [ebp - 0x48], ecx
xor ecx, ecx
mov word [ebp + 0x2038], cx
mov ecx, 0x800
test eax, eax
je 0x404acf
cmp byte [ebp + 0x304c], bl
je 0x404ac1
push ebx
push 1
push ecx
lea ecx, [ebp + 0x2038]
push ecx
push eax
call fcn.00405784
jmp 0x404acf
push ecx
push eax
lea eax, [ebp + 0x2038]
push eax
call fcn.00407851
lea ecx, [ebp]
call fcn.00403928
mov dword [ebp - 4], ebx
cmp word [ebp + 0x2038], 0
je 0x404b26
cmp byte [ebp + 0x3050], 0
lea eax, [ebp + 0x2038]
lea ecx, [ebp]
je 0x404afe
push eax
call fcn.00404309
jmp 0x404b05
push ebx
push eax
call fcn.00403dc0
test al, al
jne 0x404b2d
cmp byte [ebp + 0x3050], al
je 0x404ec0
push 6
mov ecx, 0x42e1c0
call fcn.00403794
jmp 0x404ec0
mov dword [ebp + 0x10], 1
mov esi, 0x1000
mov dword [ebp - 0x1c], ebx
push esi
lea ecx, [ebp - 0x44]
mov edi, ebx
call fcn.00403906
mov byte [ebp - 4], 1
lea ecx, [ebp]
push esi
push dword [ebp - 0x44]
call fcn.004040b0
test eax, eax
je 0x404b75
push eax
lea ecx, [ebp - 0x44]
add edi, eax
call fcn.00403a42
mov eax, dword [ebp - 0x44]
lea ecx, [ebp]
add eax, edi
push esi
push eax
call fcn.004040b0
test eax, eax
jne 0x404b54
mov dword [ebp - 0x1c], edi
push edi
lea ecx, [ebp - 0x44]
call fcn.00404985
mov esi, dword [ebp - 0x44]
cmp edi, 2
jb 0x404cc8
cmp byte [esi], 0xff
jne 0x404cc8
cmp byte [esi + 1], 0xfe
jne 0x404cc8
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x18], ebx
cmp edi, 3
jb 0x404bc1
cmp byte [esi], 0xef
jne 0x404bc1
cmp byte [esi + 1], 0xbb
jne 0x404bc1
cmp byte [esi + 2], 0xbf
mov byte [ebp - 0x11], 1
je 0x404bc4
mov byte [ebp - 0x11], bl
mov edi, dword [ebp + 0x3054]
test edi, edi
jne 0x404bd9
push dword [ebp - 0x1c]
push esi
call fcn.004049b9
mov edi, eax
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
mov byte [ebp - 0x20], bl
mov byte [ebp - 4], 2
test edi, edi
je 0x404bfa
cmp edi, 2
je 0x404bfa
cmp edi, 1
jne 0x404c33
push 1
lea ecx, [ebp - 0x44]
call fcn.00403a42
mov eax, dword [ebp - 0x40]
mov esi, dword [ebp - 0x44]
mov byte [eax + esi - 1], bl
cmp edi, 2
jne 0x404c1e
push esi
push esi
call dword [sym.imp.USER32.dll_OemToCharA]
mov eax, dword [ebp - 0x40]
push eax
lea ecx, [ebp - 0x30]
call fcn.0040499f
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
push esi
call fcn.00407ae3
mov eax, dword [ebp - 0x40]
cmp edi, 3
jne 0x404cfc
mov edi, dword [ebp - 0x10]
push 2
pop ecx
mov dword [ebp - 0x1c], ecx
test edi, edi
jne 0x404c55
cmp dword [ebp - 0x18], edi
jne 0x404c55
mov dword [ebp - 0x1c], ebx
inc edi
shr eax, 1
lea ecx, [ebp - 0x30]
inc eax
push eax
call fcn.0040499f
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x1c]
and eax, 0xfffffffe
mov edx, eax
sub edx, ecx
mov dword [ebp - 0x4c], edx
cmp ecx, eax
jae 0x404cbb
sub edi, dword [ebp - 0x18]
lea eax, [edx - 1]
mov dword [ebp - 0x10], ebx
lea ebx, [esi + ecx]
add ebx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x30]
shr eax, 1
inc eax
mov dword [ebp - 0x1c], eax
mov edx, eax
movzx ecx, byte [edi + ebx]
mov eax, 0x100
imul ecx, eax
movzx eax, byte [ebx]
lea ebx, [ebx + 2]
add cx, ax
mov eax, dword [ebp - 0x10]
add dword [ebp - 0x10], 2
shr eax, 1
mov word [esi + eax*2], cx
sub edx, 1
jne 0x404c8f
mov edx, dword [ebp - 0x4c]
xor ebx, ebx
mov eax, dword [ebp - 0x30]
shr edx, 1
xor ecx, ecx
mov word [eax + edx*2], cx
jmp 0x404d37
mov dword [ebp - 0x10], ebx
cmp edi, 2
jb 0x404ba4
cmp byte [esi], 0xfe
mov dword [ebp - 0x10], ebx
jne 0x404ba4
cmp byte [esi + 1], 0xff
mov dword [ebp - 0x10], ebx
jne 0x404ba4
mov dword [ebp - 0x18], 1
mov dword [ebp - 0x10], ebx
jmp 0x404ba7
cmp edi, 4
jne 0x404d37
push 1
lea ecx, [ebp - 0x44]
call fcn.00403a42
mov eax, dword [ebp - 0x40]
lea ecx, [ebp - 0x30]
mov esi, dword [ebp - 0x44]
push eax
mov byte [eax + esi - 1], bl
call fcn.0040499f
movzx eax, byte [ebp - 0x11]
push dword [ebp - 0x2c]
neg eax
push dword [ebp - 0x30]
sbb eax, eax
and eax, 3
add eax, esi
push eax
call fcn.00407bbd
mov edx, dword [ebp - 0x30]
mov esi, edx
mov dword [ebp - 0x18], esi
cmp word [edx], bx
je 0x404e94
movzx ecx, word [esi]
movzx eax, cx
mov edi, esi
mov ecx, eax
mov edx, ebx
push 0xd
mov dword [ebp - 0x10], ecx
pop ecx
cmp ax, cx
je 0x404db2
push 0x2f
mov ecx, eax
pop esi
movzx eax, cx
push 0xa
mov dword [ebp - 0x10], eax
pop eax
cmp cx, ax
je 0x404dad
movzx eax, cx
mov dword [ebp - 0x10], eax
test cx, cx
je 0x404dad
cmp byte [ebp + 0x305c], 0
je 0x404d98
cmp cx, si
jne 0x404d98
cmp word [edi + 2], si
jne 0x404d98
xor eax, eax
mov edx, edi
mov word [edi], ax
add edi, 2
push 0xd
movzx eax, word [edi]
mov ebx, eax
mov ecx, eax
mov dword [ebp - 0x10], ebx
pop ebx
cmp ax, bx
jne 0x404d64
mov esi, dword [ebp - 0x18]
xor ebx, ebx
xor eax, eax
mov word [edi], ax
test edx, edx
jne 0x404dbd
mov edx, edi
lea eax, [edx - 2]
jmp 0x404dd7
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x404dcf
cmp ecx, 9
jne 0x404ddb
xor ecx, ecx
mov word [eax], cx
sub eax, 2
cmp eax, esi
jae 0x404dc2
cmp byte [ebp + 0x3058], 0
je 0x404e07
push 0x22
pop eax
cmp word [esi], ax
jne 0x404e07
push esi
call fcn.0040e348
pop ecx
push 0x22
pop ecx
cmp word [esi + eax*2 - 2], cx
jne 0x404e07
xor ecx, ecx
mov word [esi + eax*2 - 2], cx
add esi, 2
cmp byte [ebp + 0x3060], 0
je 0x404e50
cmp word [esi], 0x25
jne 0x404e50
xor eax, eax
mov word [ebp + 0x1038], ax
lea eax, [ebp + 0x1038]
push 0x800
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x404e50
cmp eax, 0x800
jae 0x404e50
cmp word [ebp + 0x1038], 0
je 0x404e5e
lea eax, [ebp + 0x1038]
push eax
jmp 0x404e56
cmp word [esi], bx
je 0x404e5e
push esi
mov ecx, dword [ebp - 0x48]
call fcn.004078bb
cmp word [ebp - 0x10], 0
je 0x404e91
push 0xd
pop edx
push 0xa
lea esi, [edi + 2]
pop ebx
movzx eax, word [esi]
mov ecx, eax
cmp ax, dx
je 0x404e7d
cmp ax, bx
jne 0x404e82
add esi, 2
jmp 0x404e6e
mov dword [ebp - 0x18], esi
push 0
pop ebx
test ax, ax
jne 0x404d4b
mov edx, dword [ebp - 0x30]
mov byte [ebp - 4], 1
cmp byte [ebp - 0x20], 0
je 0x404eaa
mov eax, dword [ebp - 0x28]
add eax, eax
push eax
push edx
call fcn.00407434
push dword [ebp - 0x30]
call fcn.0040e343
pop ecx
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x44]
call fcn.0040396c
mov bl, 1
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp]
call fcn.004039c1
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x3038]
xor ecx, ebp
call fcn.0040a986
add ebp, 0x303c
leave
ret 0x20