Function at 0x4050a0
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40576b
mov eax, dword [ebp + 8]
test eax, eax
je 0x4056e0
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea edi, [eax + 1]
mov dword [ebp - 0x50], eax
add eax, 0x34
shr eax, 4
mov dword [ebp - 0x4c], edi
shl eax, 4
call fcn.0040a9f0
mov ecx, dword [ebp + 0xc]
sub esp, eax
lea ebx, [esp + 0x23]
mov dword [esp + 4], ecx
and ebx, 0xfffffff0
mov dword [esp + 8], edi
lea eax, [ebx + 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov dword [ebx], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebx + 4], eax
mov dword [esp + 8], 0x404d80
mov dword [esp + 4], 0x41b104
mov dword [esp], ebx
call fcn.0040c440
mov dword [ebp - 0x48], eax
test eax, eax
je 0x40513a
mov edx, dword [eax]
mov eax, dword [0x41bb6c]
cmp dword [edx + 8], eax
je 0x405731
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [ebp - 0x40], eax
mov eax, dword [0x41b100]
test eax, eax
je 0x405670
mov eax, dword [0x41bb70]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x4056f7
mov ebx, eax
mov esi, dword [ebp + 8]
jmp 0x405180
js 0x4056f0
mov ebx, dword [ebx]
test ebx, ebx
je 0x405710
lea eax, [ebx + 0x10]
mov dword [esp], esi
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x405170
mov eax, dword [ebx + 4]
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], eax
movzx eax, byte [eax]
cmp al, 0x2f
je 0x405291
cmp al, 0x5c
je 0x405291
and eax, 0xffffffdf
sub eax, 0x41
cmp al, 0x19
jbe 0x40571f
mov eax, dword [ebp - 0x30]
mov esi, 0x106
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea edi, [eax + 1]
jmp 0x4051e8
call sub.msvcrt.dll__errno
cmp dword [eax], 0x22
jne 0x4055d0
mov eax, esi
shr eax, 1
lea esi, [esi + eax + 0x20]
lea eax, [esi + edi + 0x1b]
shr eax, 4
shl eax, 4
call fcn.0040a9f0
sub esp, eax
lea ebx, [esp + 0x23]
and ebx, 0xfffffff0
mov dword [ebp - 0x30], ebx
call sub.msvcrt.dll__errno
mov dword [eax], 0
mov dword [esp + 4], esi
mov dword [esp], ebx
call sub.msvcrt.dll__getcwd
test eax, eax
je 0x4051d2
mov eax, dword [ebp - 0x34]
mov eax, dword [eax + 4]
mov ecx, dword [ebx]
add ebx, 4
lea edx, [ecx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x405224
test edx, 0x8080
jne 0x405249
shr edx, 0x10
add ebx, 2
mov ecx, edx
add cl, dl
mov ecx, 0x2f
mov edx, 0x415018
sbb ebx, 3
jmp 0x405263
movzx ecx, byte [edx]
add ebx, 1
add edx, 1
mov byte [ebx - 1], cl
test cl, cl
jne 0x405260
add eax, 1
movzx edx, byte [eax - 1]
mov byte [ebx - 1], dl
test dl, dl
je 0x405291
nop
add eax, 1
movzx edx, byte [eax - 1]
add ebx, 1
mov byte [ebx - 1], dl
test dl, dl
jne 0x405280
cmp dword [ebp + 0x1c], 3
je 0x405761
jg 0x4054c3
cmp dword [ebp + 0x1c], 1
mov edx, str.LC_COLLATE
je 0x4052c3
mov edx, str.LC_CTYPE
jg 0x4052c3
mov edi, dword [ebp + 0x1c]
mov edx, 0x415057
test edi, edi
jne 0x4054ef
mov dword [esp], str.LANGUAGE
mov dword [ebp - 0x2c], edx
call sub.msvcrt.dll_getenv
mov edx, dword [ebp - 0x2c]
test eax, eax
mov ebx, eax
je 0x405810
cmp byte [eax], 0
mov dword [esp + 4], edx
jne 0x405500
mov eax, dword [ebp + 0x1c]
mov dword [esp], eax
call fcn.00405930
mov dword [ebp - 0x38], 0x415074
mov edx, dword [ebp - 0x2c]
mov ebx, eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x2c], edx
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edx, dword [ebp - 0x2c]
mov edi, eax
mov dword [ebp - 0x44], eax
mov dword [esp], edx
call sub.msvcrt.dll_strlen
lea eax, [edi + eax + 0x20]
shr eax, 4
shl eax, 4
call fcn.0040a9f0
mov ecx, 0x4c
mov edx, dword [ebp - 0x2c]
sub esp, eax
lea eax, [esp + 0x23]
and eax, 0xfffffff0
mov dword [ebp - 0x3c], eax
mov esi, eax
jmp 0x405355
movzx ecx, byte [edx]
mov esi, eax
lea eax, [esi + 1]
add edx, 1
mov byte [eax - 1], cl
test cl, cl
jne 0x405350
mov ecx, 0x2f
mov edx, 0x415018
jmp 0x405378
movzx ecx, byte [edx]
mov esi, eax
add eax, 1
add edx, 1
mov byte [eax - 1], cl
test cl, cl
jne 0x405370
mov edi, dword [ebp - 0x44]
mov eax, dword [ebp + 8]
mov dword [esp], esi
mov dword [esp + 8], edi
add esi, edi
mov dword [esp + 4], eax
call sub.msvcrt.dll_memcpy
xor eax, eax
mov edx, 0x2e
jmp 0x4053aa
movzx edx, byte [eax + 0x415070]
mov byte [esi + eax], dl
add eax, 1
test dl, dl
jne 0x4053a3
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
add eax, 0x1c
shr eax, 4
shl eax, 4
call fcn.0040a9f0
sub esp, eax
lea eax, [esp + 0x23]
and eax, 0xfffffff0
mov dword [ebp - 0x2c], eax
lea esi, [esi]
lea esi, [esi]
movzx eax, byte [ebx]
cmp al, 0x3a
je 0x405540
test al, al
jne 0x405550
mov eax, dword [ebp - 0x2c]
mov esi, 0x43
mov word [eax], si
mov esi, dword [ebp - 0x2c]
mov edi, dword [ebp - 0x38]
mov ecx, 2
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
je 0x4055d0
mov esi, dword [ebp - 0x2c]
mov edi, str.POSIX
mov ecx, 6
repe cmpsb byte [esi], byte es:[edi]
seta al
sbb al, 0
test al, al
je 0x4055d0
mov eax, dword [ebp - 0x3c]
mov esi, dword [ebp - 0x2c]
mov edi, dword [ebp - 0x34]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], esi
mov dword [esp + 0xc], edi
mov dword [esp], eax
call fcn.00406330
mov esi, eax
test eax, eax
je 0x4053e0
lea eax, [ebp - 0x1c]
mov dword [esp + 4], edi
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], esi
mov dword [esp + 8], eax
call fcn.00404e20
test eax, eax
je 0x405610
mov edi, eax
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x405772
mov eax, dword [ebp - 0x48]
mov edx, dword [0x41bb6c]
mov eax, dword [eax]
mov dword [eax + 8], edx
mov edx, dword [ebp - 0x1c]
mov dword [eax + 0xc], esi
mov dword [eax + 0x10], edi
mov dword [eax + 0x14], edx
call sub.msvcrt.dll__errno
mov ecx, dword [ebp - 0x40]
mov dword [eax], ecx
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x4055ff
mov eax, dword [esi + 8]
mov edx, dword [ebp - 0x1c]
jmp 0x405748
cmp dword [ebp + 0x1c], 5
mov edx, str.LC_TIME
je 0x4052c3
mov edx, str.LC_NUMERIC
jl 0x4052c3
cmp dword [ebp + 0x1c], 0x6c1
mov edx, str.LC_MESSAGES
je 0x4052c3
mov edx, str.LC_XXX
jmp 0x4052c3
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x2c], edx
mov edi, 0x415074
mov dword [esp], eax
call fcn.00405930
mov ecx, 2
mov dword [ebp - 0x38], edi
mov edx, dword [ebp - 0x2c]
mov esi, eax
repe cmpsb byte [esi], byte es:[edi]
seta cl
sbb cl, 0
test cl, cl
jne 0x405303
mov ebx, eax
jmp 0x405303
add ebx, 1
jmp 0x4053e0
mov edx, dword [ebp - 0x2c]
add ebx, 1
add edx, 1
mov byte [edx - 1], al
movzx eax, byte [ebx]
test al, al
je 0x405567
cmp al, 0x3a
jne 0x405553
cmp dword [0x41b100], 1
mov byte [edx], 0
jne 0x4053fe
mov edi, dword [ebp - 0x2c]
mov dword [esp + 4], 0x2f
mov dword [esp], edi
call sub.msvcrt.dll_strchr
test eax, eax
jne 0x4053e0
mov dword [esp + 4], 0x5c
mov dword [esp], edi
call sub.msvcrt.dll_strchr
test eax, eax
jne 0x4053e0
movzx eax, byte [edi]
mov byte [ebp - 0x54], al
and eax, 0xffffffdf
sub eax, 0x41
cmp al, 0x19
ja 0x4053fe
cmp byte [edi + 1], 0x3a
jne 0x4053fe
jmp 0x4053e0
cmp dword [0x41b100], 1
jne 0x405680
call sub.msvcrt.dll__errno
mov ecx, dword [ebp - 0x40]
mov edx, dword [ebp + 0x14]
mov dword [eax], ecx
test edx, edx
je 0x4056d0
cmp dword [ebp + 0x18], 1
je 0x4056d0
mov edi, dword [ebp + 0x10]
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esi + 0x10]
test eax, eax
je 0x4053e0
xor edi, edi
mov dword [ebp - 0x54], ebx
mov ebx, dword [ebp - 0x34]
mov ecx, edi
mov edi, esi
mov esi, ecx
jmp 0x40563f
add esi, 1
mov eax, dword [edi + esi*4 + 0x10]
test eax, eax
je 0x405703
lea ecx, [ebp - 0x1c]
mov dword [esp + 4], ebx
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp + 0xc]
mov dword [esp], eax
mov dword [esp + 8], ecx
call fcn.00404e20
test eax, eax
je 0x405630
mov edx, esi
mov esi, edi
mov edi, eax
mov esi, dword [esi + edx*4 + 0x10]
jmp 0x40547e
mov dword [0x41b100], 0xffffffff
jmp 0x405151
mov dword [esp], str.GETTEXT_LOG_UNTRANSLATED
call sub.msvcrt.dll_getenv
test eax, eax
je 0x4055dd
cmp byte [eax], 0
je 0x4055dd
mov ecx, dword [ebp + 0x14]
mov dword [esp], eax
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp + 0xc]
mov dword [esp + 8], ecx
mov ecx, dword [ebp + 8]
mov dword [esp + 4], ecx
call fcn.00406180
jmp 0x4055dd
mov edi, dword [ebp + 0xc]
lea esp, [ebp - 0xc]
pop ebx
pop esi
mov eax, edi
pop edi
pop ebp
ret
mov eax, dword [str.messages]
mov dword [ebp + 8], eax
jmp 0x4050bf
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0x415098
jmp 0x405291
mov ebx, dword [ebp - 0x54]
jmp 0x4053e0
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], 0x415098
jmp 0x405291
mov eax, dword [ebp - 0x30]
cmp byte [eax + 1], 0x3a
jne 0x4051bd
jmp 0x405291
mov eax, dword [ebp + 0x14]
mov edi, dword [edx + 0x10]
test eax, eax
je 0x4055ff
mov eax, dword [edx + 0xc]
mov edx, dword [edx + 0x14]
mov eax, dword [eax + 8]
mov dword [esp], edx
mov edx, dword [ebp + 0x18]
mov ecx, edi
call fcn.00404dd0
lea esp, [ebp - 0xc]
mov edi, eax
pop ebx
pop esi
mov eax, edi
pop edi
pop ebp
ret
mov edx, str.LC_MONETARY
jmp 0x4052c3
xor edi, edi
jmp 0x4055ff
mov ecx, dword [ebp - 0x50]
mov eax, dword [ebp - 0x44]
lea eax, [ecx + eax + 0x1a]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov ebx, eax
test eax, eax
je 0x4054a3
mov ecx, dword [ebp - 0x4c]
mov edx, dword [ebp + 0xc]
lea eax, [eax + 0x18]
mov dword [esp], eax
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
call sub.msvcrt.dll_memcpy
mov edx, dword [ebp - 0x44]
mov ecx, dword [ebp + 8]
add eax, dword [ebp - 0x4c]
add edx, 1
mov dword [ebx], eax
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 0x1c]
mov dword [ebx + 0xc], esi
mov dword [ebx + 0x10], edi
mov dword [ebx + 4], eax
mov eax, dword [0x41bb6c]
mov dword [ebx + 8], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebx + 0x14], eax
mov dword [esp + 8], 0x404d80
mov dword [esp + 4], 0x41b104
mov dword [esp], ebx
call fcn.0040c4a0
test eax, eax
je 0x405803
cmp dword [eax], ebx
je 0x4054a3
mov dword [esp], ebx
call sub.msvcrt.dll_free
jmp 0x4054a3
mov dword [esp + 4], edx
mov dword [ebp - 0x2c], edx
jmp 0x4052ec