Function at 0x476450
Capabilities:
Query environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x302c]
mov eax, 0x302c
call fcn.00507730
push 0xffffffffffffffff
push 0x53b458
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x5755c4]
xor eax, ebp
mov dword [ebp + 0x3028], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebp + 0x3038]
mov eax, dword [ebp + 0x3034]
mov dword [ebp - 0x4c], ecx
xor ecx, ecx
mov word [ebp + 0x2028], cx
test eax, eax
je 0x4764da
cmp byte [ebp + 0x303c], cl
je 0x4764c8
push ecx
push 1
push 0x800
lea ecx, [ebp + 0x2028]
push ecx
push eax
call fcn.004854d0
jmp 0x4764da
push 0x800
push eax
lea eax, [ebp + 0x2028]
push eax
call fcn.0049dc20
lea ecx, [ebp]
call fcn.00473520
mov dword [ebp - 4], 0
cmp word [ebp + 0x2028], 0
je 0x476540
mov bl, byte [ebp + 0x3040]
lea eax, [ebp + 0x2028]
lea ecx, [ebp]
test bl, bl
je 0x47650e
push eax
call fcn.00474390
jmp 0x476516
push 0
push eax
call fcn.00473c40
test al, al
jne 0x476547
test bl, bl
je 0x47652a
push 6
mov ecx, 0x5b77e4
call fcn.0046e4b0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp]
call fcn.00473560
xor al, al
jmp 0x476932
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.004051c0
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x24]
push 0x1000
push ecx
lea ecx, [ebp]
call fcn.00473f20
test eax, eax
je 0x4765ba
nop
push eax
lea ecx, [ebp - 0x24]
add esi, eax
call fcn.004051c0
mov eax, dword [ebp - 0x24]
lea ecx, [ebp]
add eax, esi
push 0x1000
push eax
call fcn.00473f20
test eax, eax
jne 0x476580
cmp esi, dword [ebp - 0x1c]
jbe 0x4765ba
mov eax, esi
lea ecx, [ebp - 0x24]
sub eax, dword [ebp - 0x20]
push eax
call fcn.004051c0
mov edi, dword [ebp - 0x20]
jmp 0x4765bf
mov edi, esi
mov dword [ebp - 0x20], edi
mov ecx, dword [ebp - 0x24]
cmp esi, 2
jb 0x4765db
cmp byte [ecx], 0xff
jne 0x4765db
cmp byte [ecx + 1], 0xfe
jne 0x4765db
mov dword [ebp - 0x28], 1
jmp 0x4765e0
xor eax, eax
mov dword [ebp - 0x28], eax
cmp esi, 2
jb 0x4765f7
cmp byte [ecx], 0xfe
jne 0x4765f7
cmp byte [ecx + 1], 0xff
mov dword [ebp - 0x40], 1
je 0x4765fe
mov dword [ebp - 0x40], 0
cmp esi, 3
jb 0x476618
cmp byte [ecx], 0xef
jne 0x476618
cmp byte [ecx + 1], 0xbb
jne 0x476618
cmp byte [ecx + 2], 0xbf
mov byte [ebp - 0xd], 1
je 0x47661c
mov byte [ebp - 0xd], 0
mov ebx, dword [ebp + 0x3044]
test ebx, ebx
jne 0x47662f
push esi
push ecx
call fcn.004763a0
mov ebx, eax
mov dword [ebp - 0x3c], 0
xor ecx, ecx
xor esi, esi
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x30], ecx
mov byte [ebp - 0x2c], cl
mov byte [ebp - 4], 2
test ebx, ebx
je 0x476658
cmp ebx, 2
je 0x476658
cmp ebx, 1
jne 0x4766a0
push 1
lea ecx, [ebp - 0x24]
call fcn.004051c0
mov edi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x24]
mov byte [edi + eax - 1], 0
cmp ebx, 2
jne 0x47667a
push eax
push eax
call dword [sym.imp.USER32.dll_OemToCharA]
test edi, edi
je 0x47668c
push edi
lea ecx, [ebp - 0x3c]
call fcn.00410e10
mov esi, dword [ebp - 0x38]
jmp 0x476691
mov esi, edi
mov dword [ebp - 0x38], esi
push esi
push dword [ebp - 0x3c]
push dword [ebp - 0x24]
call fcn.004a0cd0
mov ecx, dword [ebp - 0x34]
cmp ebx, 3
jne 0x476754
mov ebx, dword [ebp - 0x28]
mov dword [ebp - 0x44], 2
test ebx, ebx
jne 0x4766c4
cmp dword [ebp - 0x40], ebx
jne 0x4766c4
xor eax, eax
mov dword [ebp - 0x44], eax
lea ebx, [eax + 1]
mov eax, edi
shr eax, 1
inc eax
cmp eax, ecx
jbe 0x4766da
sub eax, esi
lea ecx, [ebp - 0x3c]
push eax
call fcn.00410e10
jmp 0x4766dd
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x44]
and edi, 0xfffffffe
mov dword [ebp - 0x48], edi
cmp eax, edi
jae 0x476745
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, 0x100
xor edi, edi
jmp 0x476710
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, 0x100
mov ebx, dword [ebp - 0x28]
sub edx, 1
jne 0x476710
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 0x4767a3
cmp ebx, 4
jne 0x4767a0
push 1
lea ecx, [ebp - 0x24]
call fcn.004051c0
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x24]
mov byte [eax + ebx - 1], 0
cmp eax, dword [ebp - 0x34]
jbe 0x476783
sub eax, esi
lea ecx, [ebp - 0x3c]
push eax
call fcn.00410e10
mov eax, dword [ebp - 0x38]
jmp 0x476786
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.004a0df0
jmp 0x4767a6
mov esi, dword [ebp - 0x3c]
mov ebx, dword [ebp - 0x24]
cmp word [esi], 0
mov edi, esi
je 0x4768e2
mov bh, byte [ebp + 0x3048]
mov bl, byte [ebp + 0x3050]
mov edi, edi
xor ecx, ecx
mov esi, edi
cmp word [edi], 0xd
je 0x4767fc
mov dl, byte [ebp + 0x304c]
movzx eax, word [esi]
cmp eax, 0xa
je 0x4767fc
test ax, ax
je 0x4767fc
test dl, dl
je 0x4767f3
cmp eax, 0x2f
jne 0x4767f3
cmp word [esi + 2], ax
jne 0x4767f3
xor eax, eax
mov ecx, esi
mov word [esi], ax
add esi, 2
cmp word [esi], 0xd
jne 0x4767d0
movzx eax, word [esi]
mov dword [ebp - 0x48], eax
xor eax, eax
mov word [esi], ax
test ecx, ecx
jne 0x47680d
mov ecx, esi
lea eax, [ecx - 2]
cmp eax, edi
jb 0x47682d
movzx ecx, word [eax]
cmp ecx, 0x20
je 0x476821
cmp ecx, 9
jne 0x47682d
xor ecx, ecx
mov word [eax], cx
sub eax, 2
cmp eax, edi
jae 0x476814
test bh, bh
je 0x476861
cmp word [edi], 0x22
jne 0x476861
mov ecx, edi
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x476840
sub ecx, edx
sar ecx, 1
cmp word [edi + ecx*2 - 2], 0x22
jne 0x476861
xor eax, eax
mov word [edi + ecx*2 - 2], ax
add edi, 2
test bl, bl
je 0x4768a5
cmp word [edi], 0x25
jne 0x4768a5
xor eax, eax
mov word [ebp + 0x1028], ax
lea eax, [ebp + 0x1028]
push 0x800
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x4768a5
cmp eax, 0x800
jae 0x4768a5
cmp word [ebp + 0x1028], 0
je 0x4768b4
lea eax, [ebp + 0x1028]
push eax
jmp 0x4768ac
cmp word [edi], 0
je 0x4768b4
push edi
mov ecx, dword [ebp - 0x4c]
call fcn.0049dd10
cmp word [ebp - 0x48], 0
je 0x4768dc
lea edi, [esi + 2]
mov edi, edi
movzx eax, word [edi]
cmp eax, 0xd
je 0x4768cd
cmp eax, 0xa
jne 0x4768d2
add edi, 2
jmp 0x4768c0
cmp word [edi], 0
jne 0x4767c0
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x3c]
mov byte [ebp - 4], 1
cmp byte [ebp - 0x2c], 0
je 0x4768f8
mov eax, dword [ebp - 0x34]
add eax, eax
push eax
push esi
call fcn.0049b220
push esi
call fcn.00524aa2
add esp, 4
mov byte [ebp - 4], 0
test ebx, ebx
je 0x476921
cmp byte [ebp - 0x14], 0
je 0x476918
push dword [ebp - 0x1c]
push ebx
call fcn.0049b220
push ebx
call fcn.00524aa2
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp]
call fcn.00473560
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 + 0x3028]
xor ecx, ebp
call fcn.00507712
lea esp, [ebp + 0x302c]
pop ebp
ret 0x20