Function at 0x405040
Capabilities:
Query environment variable

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x7c
and dword [esp + 0x90], 0x3000
mov esi, dword [esp + 0x9c]
mov ebx, dword [esp + 0xa0]
mov dword [esp], str.PRINTF_EXPONENT_DIGITS
call sub.msvcrt.dll_getenv
test eax, eax
je 0x405155
movsx eax, byte [eax]
sub eax, 0x30
cmp eax, 2
ja 0x405155
mov edx, 2
mov eax, dword [esp + 0x94]
mov dword [esp + 0x34], 0xffffffff
mov dword [esp + 0x38], 0xffffffff
mov dword [esp + 0x3c], 0xfffffffd
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x90]
mov word [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x4c], edx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x98]
mov dword [esp + 0x48], eax
movzx eax, byte [esi]
movsx eax, al
test eax, eax
je 0x405149
nop
add esi, 1
cmp eax, 0x25
jne 0x405170
mov edx, dword [esp + 0x90]
xor ecx, ecx
mov dword [esp + 0x38], 0xffffffff
lea ebp, [esp + 0x34]
mov dword [esp + 0x34], 0xffffffff
mov dword [esp + 0x30], edx
movzx eax, byte [esi]
xor edx, edx
test al, al
je 0x40513c
movsx edi, al
sub eax, 0x20
add esi, 1
cmp al, 0x5a
jbe 0x405180
cmp edx, 3
jbe 0x405380
movzx eax, byte [esi]
mov edi, ebx
mov edx, 4
mov ebx, edi
test al, al
jne 0x405116
mov ebp, ebx
nop
mov ebx, ebp
movsx eax, al
test eax, eax
jne 0x4050e0
mov eax, dword [esp + 0x44]
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.004084a8
mov edx, 3
test al, 1
je 0x405088
jmp 0x405083
lea edx, [esp + 0x2c]
mov ebp, ebx
call fcn.004039b0
movzx eax, byte [esi]
jmp 0x405140
movzx eax, al
jmp dword [eax*4 + 0x40ad6c]
cmp byte [esi], 0x6c
mov ecx, 2
jne case.0x405183.44
add esi, 1
mov ecx, 3
or dword [esp + 0x30], 4
mov edi, ebx
mov edx, 4
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
or dword [esp + 0x30], 0x20
test byte [esp + 0x30], 4
je 0x405360
mov edx, dword [ebx]
lea ebp, [ebx + 0xc]
mov ecx, dword [ebx + 4]
lea eax, [esp + 0x2c]
mov ebx, dword [ebx + 8]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov ebx, ebp
call fcn.004048a0
movzx eax, byte [esi]
jmp 0x405142
or dword [esp + 0x30], 0x20
test byte [esp + 0x30], 4
je 0x405340
mov edx, dword [ebx]
lea ebp, [ebx + 0xc]
mov ecx, dword [ebx + 4]
lea eax, [esp + 0x2c]
mov ebx, dword [ebx + 8]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov ebx, ebp
call fcn.00404700
movzx eax, byte [esi]
jmp 0x405142
or dword [esp + 0x30], 0x20
test byte [esp + 0x30], 4
je 0x405320
mov edx, dword [ebx]
lea ebp, [ebx + 0xc]
mov ecx, dword [ebx + 4]
lea eax, [esp + 0x2c]
mov ebx, dword [ebx + 8]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov ebx, ebp
call fcn.00404580
movzx eax, byte [esi]
jmp 0x405142
or dword [esp + 0x30], 0x20
mov ecx, dword [esp + 0x30]
test cl, 4
je 0x405730
fld xword [ebx]
lea ebp, [ebx + 0xc]
fld st(0)
fstp xword [esp + 0x60]
fxam
wait
fnstsw ax
and eax, 0x4500
cmp eax, 0x100
je 0x4058d9
movzx edx, word [esp + 0x68]
mov ebx, edx
and ebx, 0x8000
jne 0x4057f5
fxam
wait
fnstsw ax
fstp st(0)
and eax, 0x4500
cmp eax, 0x500
je 0x405973
and dx, 0x7fff
test dx, dx
mov word [esp + 0x68], dx
je 0x405844
lea eax, [edx - 0x3fff]
mov word [esp + 0x68], ax
lea eax, [esp + 0x2c]
mov ebx, ebp
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x60]
mov dword [esp], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x6c]
mov dword [esp + 0xc], eax
call fcn.00404af0
movzx eax, byte [esi]
jmp 0x405142
fld qword [ebx]
lea eax, [esp + 0x2c]
lea ebp, [ebx + 8]
fstp xword [esp]
mov ebx, ebp
call fcn.00404580
movzx eax, byte [esi]
jmp 0x405142
fld qword [ebx]
lea eax, [esp + 0x2c]
lea ebp, [ebx + 8]
fstp xword [esp]
mov ebx, ebp
call fcn.00404700
movzx eax, byte [esi]
jmp 0x405142
fld qword [ebx]
lea eax, [esp + 0x2c]
lea ebp, [ebx + 8]
fstp xword [esp]
mov ebx, ebp
call fcn.004048a0
movzx eax, byte [esi]
jmp 0x405142
cmp edi, 0x39
jg 0x40512c
cmp edi, 0x2f
lea esi, [esi]
jle 0x40512c
test edx, edx
jne 0x40598d
mov dl, 1
test ebp, ebp
je 0x405720
mov eax, dword [ebp]
test eax, eax
js 0x405a30
lea eax, [eax + eax*4]
lea eax, [edi + eax*2 - 0x30]
mov edi, ebx
mov dword [ebp], eax
mov ebx, edi
movzx eax, byte [esi]
jmp 0x405138
cmp byte [esi + 1], 0x34
jne 0x405619
add esi, 2
mov edi, ebx
mov edx, 4
movzx eax, byte [esi]
mov ecx, 3
mov ebx, edi
jmp 0x405138
test edx, edx
jne 0x405720
or dword [esp + 0x30], 0x800
mov edi, ebx
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
test edx, edx
jne 0x405720
or dword [esp + 0x30], 0x40
mov edi, ebx
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
or dword [esp + 0x30], 0x80
cmp ecx, 3
je 0x4058fa
cmp ecx, 2
je 0x405896
mov eax, dword [ebx]
lea ebp, [ebx + 4]
mov edx, eax
sar edx, 0x1f
cmp ecx, 1
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edx
je 0x4059b3
cmp ecx, 4
je 0x4059e6
nop
mov eax, dword [esp + 0x70]
lea ecx, [esp + 0x2c]
mov ebx, ebp
mov edx, dword [esp + 0x74]
call fcn.00403c70
movzx eax, byte [esi]
jmp 0x405142
cmp ecx, 4
je 0x40590f
cmp ecx, 1
lea esi, [esi]
je 0x4058c3
cmp ecx, 2
je 0x4054b6
cmp ecx, 3
nop
je 0x4059fd
mov edx, dword [ebx]
lea ebp, [ebx + 4]
mov eax, dword [esp + 0x44]
mov ebx, ebp
mov dword [edx], eax
movzx eax, byte [esi]
jmp 0x405142
cmp byte [esi], 0x68
je 0x405939
mov edi, ebx
mov edx, 4
movzx eax, byte [esi]
mov ecx, 1
mov ebx, edi
jmp 0x405138
or dword [esp + 0x30], 0x800
xor ecx, ecx
mov edx, dword [ebx]
lea eax, [esp + 0x2c]
mov dword [esp], eax
lea ebp, [ebx + 4]
mov eax, 0x78
mov dword [esp + 0x74], ecx
mov ebx, ebp
mov dword [esp + 0x70], edx
call fcn.00403ee0
movzx eax, byte [esi]
jmp 0x405142
test edx, edx
jne 0x405720
or dword [esp + 0x30], 0x400
mov edi, ebx
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
test edx, edx
jne 0x405720
or dword [esp + 0x30], 0x100
mov edi, ebx
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
test ebp, ebp
je 0x40512c
test edx, edx
sete byte [esp + 0x27]
jne 0x405857
mov eax, dword [ebx]
lea edi, [ebx + 4]
test eax, eax
mov dword [ebp], eax
js 0x4059ca
xor ebp, ebp
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
mov eax, edi
mov ebp, ebx
lea edx, [esp + 0x2c]
mov ebx, ebp
call fcn.004039b0
movzx eax, byte [esi]
jmp 0x405142
cmp ecx, 3
je 0x405924
cmp ecx, 2
je 0x4058ad
mov eax, dword [ebx]
cmp ecx, 1
lea ebp, [ebx + 4]
mov dword [esp + 0x74], 0
mov dword [esp + 0x70], eax
je 0x40599d
cmp ecx, 4
je 0x405a1a
cmp edi, 0x75
je 0x405470
mov edx, dword [esp + 0x70]
lea eax, [esp + 0x2c]
mov ebx, ebp
mov ecx, dword [esp + 0x74]
mov dword [esp], eax
mov eax, edi
call fcn.00403ee0
movzx eax, byte [esi]
jmp 0x405142
movzx eax, byte [esi]
cmp al, 0x36
je 0x4053c9
cmp al, 0x33
je 0x405873
mov edi, ebx
mov edx, 4
mov ecx, 2
mov ebx, edi
jmp 0x405138
mov dword [esp + 0x38], 0xffffffff
movzx eax, word [ebx]
lea ebp, [ebx + 4]
mov edx, 1
lea ecx, [esp + 0x2c]
mov ebx, ebp
mov dword [esp + 0x74], 0
mov dword [esp + 0x70], eax
lea eax, [esp + 0x70]
call fcn.00403a00
movzx eax, byte [esi]
jmp 0x405142
test edx, edx
jne case.0x405183.1
or dword [esp + 0x30], 0x200
mov edi, ebx
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
cmp edx, 1
ja 0x40512c
mov edi, ebx
mov edx, 2
mov dword [esp + 0x38], 0
lea ebp, [esp + 0x38]
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
lea eax, [ecx - 2]
cmp eax, 1
jbe case.0x405183.51
mov edi, dword [ebx]
mov eax, str._null_
mov edx, 6
test edi, edi
je 0x4056d0
mov dword [esp], edi
call sub.msvcrt.dll_strlen
mov edx, eax
mov eax, edi
lea ebp, [ebx + 4]
lea ecx, [esp + 0x2c]
mov ebx, ebp
call fcn.00403b10
movzx eax, byte [esi]
jmp 0x405142
lea eax, [ecx - 2]
cmp eax, 1
mov dword [esp + 0x38], 0xffffffff
jbe 0x405638
mov eax, dword [ebx]
lea ebp, [ebx + 4]
mov edx, 1
lea ecx, [esp + 0x2c]
mov ebx, ebp
mov byte [esp + 0x70], al
lea eax, [esp + 0x70]
call fcn.00403b10
movzx eax, byte [esi]
jmp 0x405142
mov edi, ebx
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
fld qword [ebx]
lea ebp, [ebx + 8]
fst qword [esp + 0x50]
fxam
wait
fnstsw ax
and eax, 0x4500
cmp eax, 0x100
je 0x4058dd
movzx ebx, word [esp + 0x56]
mov edi, ebx
and edi, 0x8000
je 0x405764
or cl, 0x80
mov dword [esp + 0x30], ecx
fstp qword [esp]
call fcn.004076b0
cmp eax, 0x500
je 0x405a4c
mov eax, dword [esp + 0x50]
mov ecx, ebx
mov edx, dword [esp + 0x54]
shr cx, 4
and cx, 0x7ff
mov word [esp + 0x58], cx
shld edx, eax, 8
mov dword [esp + 0x54], edx
shl eax, 8
and word [esp + 0x56], 0xfff
test cx, cx
mov dword [esp + 0x50], eax
jne 0x405952
mov eax, dword [esp + 0x54]
or eax, dword [esp + 0x50]
je 0x4057bf
mov word [esp + 0x58], 0xfc01
lea eax, [esp + 0x2c]
mov ebx, ebp
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
mov eax, dword [esp + 0x54]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x5c]
mov dword [esp + 0xc], eax
call fcn.00404af0
movzx eax, byte [esi]
jmp 0x405142
or cl, 0x80
mov dword [esp + 0x30], ecx
jmp 0x4052b5
mov edi, dword [ebx]
test edi, edi
je 0x405a42
mov dword [esp], edi
lea ebp, [ebx + 4]
call sub.msvcrt.dll_wcslen
lea ecx, [esp + 0x2c]
mov ebx, ebp
mov edx, eax
mov eax, edi
call fcn.00403a00
movzx eax, byte [esi]
jmp 0x405142
movzx eax, byte [esi]
mov edi, ebx
mov edx, 4
mov ecx, 2
jmp 0x405625
mov eax, dword [esp + 0x64]
or eax, dword [esp + 0x60]
je 0x4052ea
jmp 0x4052df
cmp edx, 2
je 0x405575
mov edi, ebx
mov edx, 4
movzx eax, byte [esi]
xor ebp, ebp
mov ebx, edi
jmp 0x405138
cmp byte [esi + 1], 0x32
jne 0x405619
add esi, 2
mov edi, ebx
mov edx, 4
mov ecx, 2
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
mov eax, dword [ebx]
lea ebp, [ebx + 4]
mov edx, eax
sar edx, 0x1f
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edx
jmp 0x405470
mov ecx, dword [ebx]
lea ebp, [ebx + 4]
mov dword [esp + 0x74], 0
mov dword [esp + 0x70], ecx
jmp 0x4055dd
mov edx, dword [ebx]
lea ebp, [ebx + 4]
mov eax, dword [esp + 0x44]
mov ebx, ebp
mov word [edx], ax
movzx eax, byte [esi]
jmp 0x405142
fstp st(0)
jmp 0x4058df
fstp st(0)
xor ax, ax
mov edx, 0x40ad61
lea ecx, [esp + 0x2c]
mov ebx, ebp
call fcn.00403bd0
movzx eax, byte [esi]
jmp 0x405142
mov eax, dword [ebx]
lea ebp, [ebx + 8]
mov edx, dword [ebx + 4]
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edx
jmp 0x405470
mov edx, dword [ebx]
lea ebp, [ebx + 4]
mov eax, dword [esp + 0x44]
mov ebx, ebp
mov byte [edx], al
movzx eax, byte [esi]
jmp 0x405142
mov eax, dword [ebx]
lea ebp, [ebx + 8]
mov edx, dword [ebx + 4]
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edx
jmp 0x4055dd
add esi, 1
mov edi, ebx
mov edx, 4
mov ecx, 4
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138
lea eax, [ecx - 0x3ff]
cmp ax, 0xff83
mov word [esp + 0x58], ax
jl 0x4057bf
add word [esp + 0x56], 0x1000
jmp 0x4057bf
mov eax, ebx
mov edx, 0x40ad65
lea ecx, [esp + 0x2c]
mov ebx, ebp
call fcn.00403bd0
movzx eax, byte [esi]
jmp 0x405142
cmp edx, 2
jne 0x4053a0
mov dl, 3
jmp 0x4053a0
movzx eax, word [esp + 0x70]
mov dword [esp + 0x74], 0
mov dword [esp + 0x70], eax
jmp 0x4055dd
movsx eax, word [esp + 0x70]
mov ecx, eax
sar ecx, 0x1f
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], ecx
jmp 0x405470
cmp byte [esp + 0x27], 0
je 0x405a66
or dword [esp + 0x30], 0x400
neg dword [esp + 0x34]
jmp 0x405585
movsx eax, byte [esp + 0x70]
mov edx, eax
sar edx, 0x1f
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edx
jmp 0x405470
mov eax, dword [esp + 0x44]
lea ebp, [ebx + 4]
mov edx, dword [ebx]
mov ebx, ebp
mov ecx, eax
sar ecx, 0x1f
mov dword [edx], eax
mov dword [edx + 4], ecx
movzx eax, byte [esi]
jmp 0x405142
movzx eax, byte [esp + 0x70]
mov dword [esp + 0x74], 0
mov dword [esp + 0x70], eax
jmp 0x4055dd
lea eax, [edi - 0x30]
mov edi, ebx
mov dword [ebp], eax
mov ebx, edi
movzx eax, byte [esi]
jmp 0x405138
mov edi, 0x40ad4c
jmp 0x40580b
mov eax, edi
mov edx, 0x40ad65
lea ecx, [esp + 0x2c]
mov ebx, ebp
call fcn.00403bd0
movzx eax, byte [esi]
jmp 0x405142
mov dword [esp + 0x38], 0xffffffff
xor ebp, ebp
movzx eax, byte [esi]
mov ebx, edi
jmp 0x405138