Function at 0x470470
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov esi, eax
sub esp, 0x6c
test edx, edx
mov dword [ebp - 0x4c], edx
sete dl
test ecx, ecx
mov dword [ebp - 0x58], ecx
sete al
or dl, al
jne 0x470761
test esi, esi
je 0x470761
mov dword [esp], esi
call fcn.004701a0
cmp eax, esi
mov dword [ebp - 0x50], eax
je 0x470770
mov eax, dword [ebp + 8]
mov dword [esp], esi
test eax, eax
jne 0x4705e0
call fcn.00472730
mov ebx, eax
test ebx, ebx
je 0x470761
lea edx, [ebp - 0x44]
mov eax, ebx
call fcn.004702b0
mov dword [esp], ebx
mov esi, eax
mov dword [ebp - 0x54], eax
call sub.msvcrt.dll_free
test esi, esi
je 0x470761
mov eax, dword [ebp - 0x4c]
lea edx, [ebp - 0x40]
call fcn.004702b0
test eax, eax
mov ebx, eax
je 0x4705f0
mov eax, dword [ebp - 0x44]
lea esi, [eax - 1]
cmp esi, dword [ebp - 0x40]
mov dword [ebp - 0x44], esi
jne 0x47054c
test esi, esi
jle 0x4705f0
mov dword [ebp - 0x4c], esi
xor edi, edi
mov esi, ebx
mov ebx, dword [ebp - 0x54]
jmp 0x470529
add edi, 1
cmp edi, dword [ebp - 0x4c]
je 0x47053f
mov eax, dword [esi + edi*4]
mov dword [esp + 4], eax
mov eax, dword [ebx + edi*4]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x470521
mov ebx, esi
mov esi, dword [ebp - 0x4c]
cmp esi, edi
je 0x4705f0
mov eax, dword [ebp - 0x58]
lea edx, [ebp - 0x3c]
call fcn.004702b0
test eax, eax
mov esi, eax
je 0x4705f0
mov eax, dword [ebp - 0x40]
mov ecx, eax
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x3c]
cmp eax, ecx
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x4c], eax
jle 0x470579
mov dword [ebp - 0x4c], ecx
mov edi, dword [ebp - 0x4c]
test edi, edi
jle 0x4708f8
xor edi, edi
jmp 0x470598
add edi, 1
cmp edi, dword [ebp - 0x4c]
je 0x470600
mov eax, dword [esi + edi*4]
mov dword [esp + 4], eax
mov eax, dword [ebx + edi*4]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x470590
test edi, edi
mov dword [ebp - 0x50], 0
jne 0x4705fb
mov eax, dword [ebp - 0x54]
call fcn.00470230
mov eax, ebx
call fcn.00470230
mov eax, esi
call fcn.00470230
mov eax, dword [ebp - 0x50]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.004701b0
mov ebx, eax
jmp 0x4704c3
mov dword [ebp - 0x50], 0
xor esi, esi
jmp 0x4705b9
mov dword [ebp - 0x4c], edi
nop
mov eax, dword [ebp - 0x44]
test eax, eax
jle 0x4708c1
mov ecx, dword [ebp - 0x54]
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x60], ebx
lea eax, [ecx + eax*4]
mov edi, ecx
xor ecx, ecx
mov ebx, edi
mov esi, ecx
mov edi, eax
mov eax, dword [ebx]
add ebx, 4
mov dword [esp], eax
call sub.msvcrt.dll_strlen
add esi, eax
cmp ebx, edi
jne 0x470621
mov edx, esi
mov ebx, dword [ebp - 0x60]
mov esi, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x58]
sub eax, ecx
lea eax, [eax + eax*2]
add eax, edx
mov edx, dword [ebp - 0x5c]
cmp edx, ecx
jle 0x47067d
lea edi, [esi + ecx*4]
lea ecx, [esi + edx*4]
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x58], ebx
mov esi, eax
mov ebx, edi
mov edi, ecx
mov eax, dword [ebx]
add ebx, 4
mov dword [esp], eax
call sub.msvcrt.dll_strlen
add esi, eax
cmp ebx, edi
jne 0x470662
mov eax, esi
mov ebx, dword [ebp - 0x58]
mov esi, dword [ebp - 0x50]
add eax, 1
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov dword [ebp - 0x50], eax
je 0x4705b9
mov byte [eax], 0
mov eax, dword [ebp - 0x44]
xor edi, edi
test eax, eax
mov dword [ebp - 0x58], eax
jle 0x4706cd
mov dword [ebp - 0x5c], esi
mov dword [ebp - 0x60], ebx
mov esi, dword [ebp - 0x54]
mov ebx, dword [ebp - 0x50]
nop
mov eax, dword [esi + edi*4]
mov dword [esp], ebx
add edi, 1
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcat
cmp edi, dword [ebp - 0x58]
jne 0x4706b0
mov esi, dword [ebp - 0x5c]
mov ebx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x50]
mov ecx, dword [eax]
add eax, 4
lea edx, [ecx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x4706d0
test edx, 0x8080
je 0x4708b6
add dl, dl
mov edx, dword [ebp - 0x40]
sbb eax, 3
cmp dword [ebp - 0x4c], edx
jge 0x47090c
sub edx, dword [ebp - 0x4c]
lea edx, [edx + edx*2]
add edx, eax
lea esi, [esi]
mov ecx, 0x2e2e
mov byte [eax + 2], 0
add eax, 3
mov word [eax - 3], cx
cmp eax, edx
mov byte [eax - 1], 0x2f
jne 0x470710
mov edi, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x4c]
mov byte [edx], 0
cmp eax, edi
jge 0x4705b9
mov dword [ebp - 0x4c], ebx
mov ebx, edi
mov edi, eax
mov eax, dword [esi + edi*4]
add edi, 1
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x50]
mov dword [esp], eax
call sub.msvcrt.dll_strcat
cmp edi, ebx
jne 0x470740
mov ebx, dword [ebp - 0x4c]
jmp 0x4705b9
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 0x49c800
call sub.msvcrt.dll_getenv
test eax, eax
je 0x4704ae
mov dword [esp], eax
mov dword [ebp - 0x54], eax
call sub.msvcrt.dll_strlen
lea ebx, [eax + 1]
mov ecx, dword [ebp - 0x54]
cmp ebx, 1
jbe 0x470913
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x54], ecx
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea eax, [ebx + eax + 0x23]
and eax, 0xfffffff0
call fcn.004720e0
mov ecx, dword [ebp - 0x54]
sub esp, eax
lea edi, [esp + 0x1b]
mov ebx, ecx
movzx eax, byte [ebx]
and edi, 0xfffffff0
mov dword [ebp - 0x54], edi
test al, al
je 0x4707e0
cmp al, 0x3b
lea edx, [ebx + 1]
je 0x4707e0
mov ebx, edx
movzx eax, byte [ebx]
test al, al
jne 0x4707d0
cmp ebx, ecx
je 0x4708e0
mov esi, ebx
mov dword [esp + 4], ecx
mov dword [esp], edi
sub esi, ecx
mov dword [esp + 8], esi
call sub.msvcrt.dll_memcpy
movzx eax, byte [ebx - 1]
cmp al, 0x5c
je 0x4708d0
cmp al, 0x2f
je 0x4708d0
mov byte [edi + esi], 0x2f
mov byte [edi + esi + 1], 0
mov eax, dword [ebp - 0x50]
mov dword [esp], edi
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcat
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.msvcrt.dll__access
test eax, eax
je 0x470884
mov edx, edi
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x47083e
test eax, 0x8080
jne 0x470861
shr eax, 0x10
add edx, 2
add al, al
sbb edx, 3
mov dword [edx], 0x6578652e
mov byte [edx + 4], 0
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.msvcrt.dll__access
test eax, eax
jne 0x4708a5
lea eax, [ebp - 0x3c]
mov dword [esp], edi
mov dword [esp + 4], eax
call sub.msvcrt.dll__stat
test eax, eax
js 0x4708a5
movzx eax, word [ebp - 0x36]
and ax, 0xf000
cmp ax, 0x8000
je 0x470904
cmp byte [ebx], 0
je 0x4708f0
lea edx, [ebx + 1]
mov ecx, edx
mov ebx, edx
jmp 0x4707d9
shr edx, 0x10
add eax, 2
jmp 0x4706f3
xor edx, edx
jmp 0x47063c
mov byte [edi + esi], 0
jmp 0x470819
mov byte [edi], 0x2e
mov byte [edi + 1], 0x2f
mov byte [edi + 2], 0
jmp 0x470819
mov esi, dword [ebp - 0x50]
jmp 0x4704ae
mov dword [ebp - 0x50], 0
jmp 0x4705b9
mov esi, dword [ebp - 0x54]
jmp 0x4704ae
mov edx, eax
jmp 0x470728
mov ebx, 2
jmp 0x47079e