Function at 0x401f80
Capabilities:
Enumerate files on windows
Query environment variable
Set file attributes

Disassembly:
sub esp, 0x348
push esi
push edi
push 0x40524c
call dword [sym.imp.MSVCRT.dll_getenv]
mov edx, eax
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
add esp, 4
mov esi, edx
repne scasb al, byte es:[edi]
not ecx
mov eax, ecx
lea edi, [esp + 0x110]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
mov esi, edx
mov edx, ecx
lea edi, [esp + 0x10]
mov eax, dword [esp + 0x358]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
test eax, eax
rep movsb byte es:[edi], byte [esi]
jne 0x402055
lea eax, [esp + 8]
lea ecx, [esp + 0x110]
push eax
push 0x100
push ecx
call fcn.004023f0
test eax, eax
jl 0x4020d6
mov eax, dword [esp + 8]
mov edx, 0x100
sub edx, eax
push 0x405244
lea eax, [esp + eax + 0x114]
push edx
push eax
call fcn.004023a0
test eax, eax
jl 0x4020d6
lea ecx, [esp + 8]
lea edx, [esp + 0x10]
push ecx
push 0x100
push edx
call fcn.004023f0
test eax, eax
jl 0x4020d6
mov eax, dword [esp + 8]
push 0x405238
mov ecx, 0x100
jmp 0x4020c1
cmp eax, 1
jne 0x4020e2
lea eax, [esp + 8]
lea ecx, [esp + 0x110]
push eax
push 0x100
push ecx
call fcn.004023f0
test eax, eax
jl 0x4020d6
mov eax, dword [esp + 8]
mov edx, 0x100
sub edx, eax
push 0x405244
lea eax, [esp + eax + 0x114]
push edx
push eax
call fcn.004023a0
test eax, eax
jl 0x4020d6
lea ecx, [esp + 8]
lea edx, [esp + 0x10]
push ecx
push 0x100
push edx
call fcn.004023f0
test eax, eax
jl 0x4020d6
mov eax, dword [esp + 8]
push 0x405228
mov ecx, 0x100
sub ecx, eax
lea edx, [esp + eax + 0x14]
push ecx
push edx
call fcn.004023a0
test eax, eax
jge 0x40215f
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x348
ret
cmp eax, 2
jne 0x4020d6
lea eax, [esp + 8]
lea ecx, [esp + 0x110]
push eax
push 0x100
push ecx
call fcn.004023f0
test eax, eax
jl 0x4020d6
mov eax, dword [esp + 8]
mov edx, 0x100
sub edx, eax
push 0x40521c
lea eax, [esp + eax + 0x114]
push edx
push eax
call fcn.004023a0
test eax, eax
jl 0x4020d6
lea ecx, [esp + 8]
lea edx, [esp + 0x10]
push ecx
push 0x100
push edx
call fcn.004023f0
test eax, eax
jl 0x4020d6
mov eax, dword [esp + 8]
mov ecx, 0x100
sub ecx, eax
push 0x405208
lea edx, [esp + eax + 0x14]
push ecx
push edx
call fcn.004023a0
test eax, eax
jl 0x4020d6
lea eax, [esp + 0x210]
lea ecx, [esp + 0x10]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
mov dword [esp + 0xc], eax
je 0x4020d6
push ebx
push ebp
lea edx, [esp + 0x118]
push 0x100
lea eax, [esp + 0x1c]
push edx
push eax
call dword [sym.imp.MSVCRT.dll__mbsnbcpy]
add esp, 0xc
lea ecx, [esp + 0x10]
lea edx, [esp + 0x18]
push ecx
push 0x100
push edx
call fcn.004023f0
mov ebp, dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test eax, eax
jl 0x402249
lea eax, [esp + 0x244]
mov ecx, 0x100
push eax
mov eax, dword [esp + 0x14]
sub ecx, eax
lea edx, [esp + eax + 0x1c]
push ecx
push edx
call fcn.004023a0
test eax, eax
jl 0x402249
mov eax, dword [esp + 0x35c]
lea ecx, [esp + 0x18]
push eax
push ecx
call fcn.00401c90
add esp, 8
cmp eax, 1
jne 0x402249
lea edx, [esp + 0x18]
push 0x80
push edx
call ebp
mov esi, dword [sym.imp.MSVCRT.dll__unlink]
lea eax, [esp + 0x18]
push eax
call esi
lea edi, [esp + 0x1c]
or ecx, 0xffffffff
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
mov eax, dword [0x405204]
lea edx, [esp + 0x18]
not ecx
dec ecx
sub edx, 3
push 0x80
mov dword [ecx + edx], eax
lea ecx, [esp + 0x1c]
push ecx
call ebp
lea edx, [esp + 0x18]
push edx
call esi
add esp, 4
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x218]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
je 0x402372
lea ecx, [esp + 0x118]
push 0x100
lea edx, [esp + 0x1c]
push ecx
push edx
call dword [sym.imp.MSVCRT.dll__mbsnbcpy]
add esp, 0xc
mov ecx, 0x100
lea eax, [esp + 0x18]
xor edx, edx
cmp byte [eax], 0
je 0x402299
inc eax
dec ecx
jne 0x40228e
jmp 0x40229d
test ecx, ecx
jne 0x4022a2
mov edx, 0x80070057
lea eax, [esp + 0x14]
test eax, eax
je 0x4022b9
test edx, edx
jl 0x4022b7
mov ebx, 0x100
sub ebx, ecx
jmp 0x4022b9
xor ebx, ebx
test edx, edx
jl 0x40224d
mov edx, 0x100
lea eax, [esp + ebx + 0x18]
sub edx, ebx
mov edi, 0
je 0x40224d
lea esi, [esp + 0x244]
sub esi, eax
mov cl, byte [esi + eax]
test cl, cl
je 0x4022eb
mov byte [eax], cl
inc eax
dec edx
jne 0x4022dc
jmp 0x4022ef
test edx, edx
jne 0x4022f5
dec eax
mov edi, 0x8007007a
test edi, edi
mov byte [eax], 0
jl 0x40224d
mov ecx, dword [esp + 0x35c]
lea edx, [esp + 0x18]
push ecx
push edx
call fcn.00401c90
add esp, 8
cmp eax, 1
jne 0x40224d
lea eax, [esp + 0x18]
push 0x80
push eax
call ebp
mov esi, dword [sym.imp.MSVCRT.dll__unlink]
lea ecx, [esp + 0x18]
push ecx
call esi
lea edi, [esp + 0x1c]
or ecx, 0xffffffff
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
mov eax, dword [0x405204]
lea edx, [esp + 0x18]
not ecx
dec ecx
sub edx, 3
push 0x80
mov dword [ecx + edx], eax
lea ecx, [esp + 0x1c]
push ecx
call ebp
lea edx, [esp + 0x18]
push edx
call esi
add esp, 4
jmp 0x40224d
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x12
pop ebp
neg eax
pop ebx
pop edi
sbb eax, eax
pop esi
add esp, 0x348
ret