Function at 0x401540
Capabilities:
Check for peb beingdebugged flag
Enumerate files on windows
Get process heap flags

Disassembly:
push ebp
xor edx, edx
mov ebp, esp
push edi
mov edi, eax
push esi
lea esi, [edi + 0x40]
push ebx
sub esp, 0x29c
mov eax, dword [eax + 0x40]
mov dword [ebp - 0x284], 0x69002e
mov dword [ebp - 0x280], 0x740064
mov word [ebp - 0x27c], dx
mov dword [ebp - 0x288], 0x2a
mov dword [ebp - 0x28c], eax
mov dword [ebp - 0x290], esi
cmp esi, eax
je 0x40175e
nop
mov eax, dword [ebp - 0x28c]
mov ebx, dword [eax + 8]
lea eax, [ebp - 0x288]
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_wcsstr]
test eax, eax
je 0x401780
mov edx, dword [edi + 4]
cmp word [edx], 0
je 0x401828
mov eax, edx
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x4015c8
sub eax, edx
sar eax, 1
add eax, 1
cmp word [ebx], 0
je 0x4015ef
mov edx, ebx
add edx, 2
cmp word [edx], 0
jne 0x4015e0
sub edx, ebx
sar edx, 1
add eax, edx
lea eax, [eax + eax + 2]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapAlloc
sub esp, 0xc
mov esi, eax
test eax, eax
je 0x401818
mov ecx, dword [edi + 4]
xor eax, eax
lea esi, [esi]
lea esi, [esi]
movzx edx, word [ecx + eax]
mov word [esi + eax], dx
add eax, 2
test dx, dx
jne 0x401630
mov dword [esp], esi
call sub.shlwapi.dll_PathAddBackslashW
mov edx, esi
sub esp, 4
cmp word [esi], 0
je 0x401661
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x401658
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [ebx + eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x401668
lea eax, [ebp - 0x268]
mov dword [esp], esi
mov dword [esp + 4], eax
call sub.kernel32.dll_FindFirstFileW
sub esp, 8
mov ebx, eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
sub esp, 0xc
cmp ebx, 0xffffffff
je 0x401818
lea esi, [ebp - 0x23c]
mov eax, dword [ebp - 0x23c]
cmp eax, 0x2e
je 0x401720
cmp eax, 0x2e002e
je 0x401770
test byte [ebp - 0x268], 0x10
jne 0x401720
mov dword [esp], esi
call sub.shlwapi.dll_PathFindExtensionW
sub esp, 4
test eax, eax
je 0x401720
lea ecx, [ebp - 0x284]
mov dword [esp], eax
mov dword [esp + 4], ecx
call sub.kernel32.dll_lstrcmpW
sub esp, 8
test eax, eax
jne 0x401720
mov edx, dword [edi + 8]
mov eax, dword [edi + 4]
mov ecx, esi
call fcn.00401460
test eax, eax
je 0x401832
lea esi, [esi]
lea eax, [ebp - 0x268]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sub.kernel32.dll_FindNextFileW
sub esp, 8
test eax, eax
jne 0x4016c1
mov dword [esp], ebx
call sub.kernel32.dll_FindClose
sub esp, 4
mov eax, dword [ebp - 0x28c]
mov eax, dword [eax]
mov dword [ebp - 0x28c], eax
cmp dword [ebp - 0x290], eax
jne 0x401590
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
cmp word [ebp - 0x238], 0
jne 0x4016d7
jmp 0x401720
mov dword [esp], ebx
call sub.shlwapi.dll_PathFindExtensionW
sub esp, 4
test eax, eax
je 0x4017a8
lea edx, [ebp - 0x284]
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.kernel32.dll_lstrcmpW
sub esp, 8
test eax, eax
je 0x401803
xor eax, eax
mov dword [esp + 0xc], ebx
lea ebx, [ebp - 0x268]
mov word [ebp - 0x26a], ax
lea eax, [ebp - 0x27a]
mov dword [esp + 8], eax
lea eax, [ebp - 0x268]
mov dword [esp + 4], 0x104
mov dword [esp], eax
mov dword [ebp - 0x27a], 0x2e0025
mov dword [ebp - 0x276], 0x730038
mov dword [ebp - 0x272], 0x69002e
mov dword [ebp - 0x26e], 0x740064
call fcn.004014f0
mov edx, dword [edi + 8]
mov eax, dword [edi + 4]
mov ecx, ebx
call fcn.00401460
test eax, eax
jne 0x401744
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 1
jmp 0x4015d8
mov dword [esp], ebx
call sub.kernel32.dll_FindClose
sub esp, 4
jmp 0x401818