Function at 0x406c40
Capabilities:
Query environment variable
Read file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x47c]
sub esp, 0x47c
push 0xfffffffffffffffe
push 0x43add0
push 0x424280
mov eax, dword fs:[0]
push eax
sub esp, 0x110
mov eax, dword [0x440750]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp + 0x478], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x1c], ecx
xor eax, eax
mov word [ebp + 0x270], ax
push 0x206
push eax
lea ecx, [ebp + 0x272]
push ecx
call fcn.00424c20
add esp, 0xc
push 0x104
lea edx, [ebp + 0x270]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
lea eax, [ebp + 0x270]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x28], esi
cmp esi, 0xffffffff
je 0x406d25
mov dword [ebp - 4], 0
xor ecx, ecx
mov word [ebp], cx
push 0x3e
push ecx
lea edx, [ebp + 2]
push edx
call fcn.00424c20
add esp, 0xc
push 0
push 0
push 0
push esi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call edi
cmp eax, 0xffffffff
jne 0x406d4c
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x440750
call fcn.004254d8
add esp, 0xc
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x478]
xor ecx, ebp
call fcn.0042497b
add ebp, 0x47c
mov esp, ebp
pop ebp
ret
push 0
lea ecx, [ebp - 0x24]
push ecx
push 0x40
lea edx, [ebp]
push edx
push esi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
call ebx
test eax, eax
je 0x406d12
push 0
push 0
mov ecx, dword [ebp + 0x3c]
push ecx
push esi
call edi
cmp eax, 0xffffffff
jne 0x406d7d
push 0xfffffffffffffffe
lea edx, [ebp - 0x10]
push edx
jmp 0x406d18
mov dword [ebp - 0x120], 0
push 0xf4
push 0
lea eax, [ebp - 0x11c]
push eax
call fcn.00424c20
add esp, 0xc
push 0
lea ecx, [ebp - 0x24]
push ecx
push 0xf8
lea edx, [ebp - 0x120]
push edx
push esi
call ebx
test eax, eax
je 0x406d12
push 1
push 0
movzx eax, word [ebp - 0x11a]
lea ecx, [eax + eax*4]
lea edx, [ecx*8 - 0x28]
push edx
push esi
call edi
cmp eax, 0xffffffff
je 0x406d12
mov byte [ebp + 0x40], 0
xor eax, eax
mov dword [ebp + 0x41], eax
mov word [ebp + 0x45], ax
mov byte [ebp + 0x47], al
mov dword [ebp + 0x48], eax
mov dword [ebp + 0x4c], eax
mov dword [ebp + 0x50], eax
mov dword [ebp + 0x54], eax
mov dword [ebp + 0x58], eax
mov dword [ebp + 0x5c], eax
mov dword [ebp + 0x60], eax
mov dword [ebp + 0x64], eax
push eax
lea ecx, [ebp - 0x24]
push ecx
push 0x28
lea edx, [ebp + 0x40]
push edx
push esi
call ebx
test eax, eax
je 0x406d12
mov ecx, dword [ebp + 0x54]
mov edx, dword [ebp + 0x50]
lea eax, [edx + ecx]
push 0
push 0
push eax
push esi
call edi
cmp eax, 0xffffffff
je 0x406d12
mov dword [ebp - 0x20], 0
push 0
lea ecx, [ebp - 0x24]
push ecx
push 4
lea edx, [ebp - 0x20]
push edx
push esi
call ebx
test eax, eax
je 0x406d12
mov eax, dword [ebp - 0x20]
cmp eax, 4
jne 0x406e65
push 0xfffffffffffffffe
lea ecx, [ebp - 0x10]
push ecx
jmp 0x406d18
shr eax, 1
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0042407f
mov edi, eax
mov eax, dword [ebp - 0x20]
push eax
push 0
push edi
call fcn.00424c20
add esp, 0x10
push 0
lea ecx, [ebp - 0x24]
push ecx
mov edx, dword [ebp - 0x20]
push edx
push edi
push esi
call ebx
test eax, eax
je 0x406d12
push edi
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
call esi
test eax, eax
je 0x406ef8
cmp word [edi], 0x25
jne 0x406ee7
push 0x104
lea ecx, [ebp + 0x68]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x406eda
lea edx, [ebp + 0x68]
push edx
mov eax, dword [ebp - 0x1c]
add eax, 0x288
push eax
jmp 0x406ef2
push edi
mov ecx, dword [ebp - 0x1c]
add ecx, 0x288
push ecx
jmp 0x406ef2
push edi
mov edx, dword [ebp - 0x1c]
add edx, 0x288
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push edi
call esi
lea eax, [edi + eax*2 + 2]
push eax
mov ecx, dword [ebp - 0x1c]
add ecx, 0x698
call fcn.004069b0
push edi
call fcn.00424c0b
push 0xfffffffffffffffe
lea ecx, [ebp - 0x10]
push ecx
push 0x440750
call fcn.004254d8
add esp, 0x10
mov eax, 1
jmp 0x406d27