Function at 0x401640
Capabilities:
Enumerate files on windows
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4033fd
mov eax, dword fs:[0]
push eax
sub esp, 0x164
mov eax, dword [0x406004]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0x104
xor edi, edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov esi, eax
mov dword [ebp - 0x16c], esi
push 0x104
push esi
push str.TEMP
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
xorps xmm0, xmm0
mov dword [ebp - 0x18], edi
movups xmmword [ebp - 0x28], xmm0
mov dword [ebp - 0x14], edi
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x4016a6
sub esi, ecx
cmp esi, 0x7fffffff
ja 0x40186f
mov dword [ebp - 0x14], 0xf
cmp esi, 0x10
jae 0x4016e7
push esi
push dword [ebp - 0x16c]
lea eax, [ebp - 0x28]
mov dword [ebp - 0x18], esi
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov byte [ebp + esi - 0x28], 0
jmp 0x40177c
mov edi, esi
or edi, 0xf
cmp edi, 0x7fffffff
jbe 0x40171f
mov ecx, 0x80000000
mov edi, 0x7fffffff
add ecx, 0x23
push ecx
call fcn.00402658
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x40183e
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
jmp 0x401751
mov eax, 0x16
cmp edi, eax
cmovb edi, eax
lea eax, [edi + 1]
cmp eax, 0x1000
jb 0x401740
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x401874
jmp 0x401701
test eax, eax
je 0x40174f
push eax
call fcn.00402658
add esp, 4
jmp 0x401751
xor eax, eax
push esi
push dword [ebp - 0x16c]
mov dword [ebp - 0x170], eax
push eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x14], edi
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x170]
add esp, 0xc
xor edi, edi
mov byte [eax + esi], 0
mov dword [ebp - 4], 0
mov edx, dword [ebp - 0x14]
mov eax, edx
mov ecx, dword [ebp - 0x18]
sub eax, ecx
cmp eax, 2
jb 0x4017b2
lea eax, [ecx + 2]
cmp edx, 0x10
mov dword [ebp - 0x18], eax
mov edx, 0x2a5c
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
mov word [eax + ecx], dx
mov byte [eax + ecx + 2], 0
jmp 0x4017cc
push 2
push ecx
mov byte [ebp - 0x16c], 0
lea ecx, [ebp - 0x28]
push dword [ebp - 0x16c]
push 2
call fcn.004024f0
cmp dword [ebp - 0x14], 0x10
lea ecx, [ebp - 0x168]
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x40180a
nop dword [eax]
lea eax, [ebp - 0x168]
inc edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x4017f0
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [ebp - 0x14]
xor eax, eax
cmp edi, 0x1e
setl al
mov dword [ebp - 0x16c], eax
cmp ecx, 0x10
jb 0x401854
mov edx, dword [ebp - 0x28]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x401844
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x401844
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.00402688
mov eax, dword [ebp - 0x16c]
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040264a
mov esp, ebp
pop ebp
ret
call fcn.004011a0
call fcn.00401100
int3