Function at 0x40eb17
Capabilities:
Access peb ldr_data
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0xc88
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
test eax, eax
je 0x40eb60
mov ebx, dword [edx + 4]
mov edi, ecx
mov dword [esp + 0x10], eax
lea eax, [edx + 4]
mov esi, edx
mov ecx, edx
mov dword [esp + 4], eax
mov edx, edi
push 0
call fcn.0040eaea
pop ecx
test ax, ax
je 0x40eb69
mov ecx, dword [esp + 4]
mov edx, eax
mov dword [ecx], ebx
jmp 0x40ebef
mov dx, 8
jmp 0x40ebf9
mov eax, dword [esi + 4]
mov edx, dword [esi]
mov dword [esp + 0xc], ebx
lea ebx, [esp + 0xa70]
mov dword [esp + 0x20], edi
mov ecx, ebx
dec eax
push eax
call fcn.0040f2aa
pop eax
movzx edx, word [ebx + 0x210]
test dx, dx
je 0x40eb9d
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
jmp 0x40ebed
mov dword [esp + 0x18], esi
lea eax, [esp + 0x60]
push 0x210
push ebx
push eax
call fcn.0040307b
add esp, 0xc
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
lea esi, [esp + 0x40]
mov ecx, esi
mov eax, dword [eax + 0x10]
mov edx, dword [eax + 0x2c]
lea eax, [esp + 0x64]
push 1
push 0
push eax
call fcn.0040f561
add esp, 0xc
cmp word [esi + 4], 0
mov ecx, dword [esp + 0xc]
je 0x40ec03
mov eax, dword [esp + 4]
mov dx, 8
mov dword [eax], ecx
mov ebx, dword [ebp + 8]
mov eax, dword [esp + 0x10]
mov dword [ebx + 4], eax
mov eax, edx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x40]
mov eax, dword [esp + 4]
mov ebx, dword [ebp + 8]
mov dword [eax], ecx
mov ecx, ebx
mov edx, esi
push 0x2a
call fcn.0040eaea
pop ecx
test ax, ax
je 0x40ec28
push edi
jmp 0x40ec41
mov dword [esp + 8], edi
mov ecx, ebx
mov edx, esi
push 0
call fcn.0040eaea
pop ecx
test ax, ax
je 0x40ec56
push dword [esp + 8]
mov esi, eax
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
mov edx, esi
mov dword [eax], ecx
jmp 0x40ebf2
mov eax, dword [ebx]
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 4]
and dword [esp + 0x34], 0
lea eax, [eax + eax - 2]
cmp eax, 0xffff
jbe 0x40ec86
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
mov dx, 0xb
jmp 0x40ec52
mov edi, eax
mov ebx, 0x800
mov dword [esp + 0x30], 0
mov dword [esp + 0x1c], 0
mov eax, edi
mov esi, dword [esp + 8]
mov word [esp + 0x38], ax
mov word [esp + 0x3a], ax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x3c], eax
push 0
lea eax, [esp + 0x3c]
push eax
push 0
push 1
push 0x800
lea eax, [esp + 0x284]
push eax
lea eax, [esp + 0x60]
push eax
push 0
push 0
push 0
push esi
call sub.ntdll.dll_NtQueryDirectoryFile
test eax, eax
jne 0x40ed54
mov edx, dword [esp + 0x10]
xor esi, esi
cmp esi, 0x7ff
ja 0x40ec9d
mov ecx, dword [esp + esi + 0x270]
mov eax, esi
add esi, ecx
test ecx, ecx
cmove esi, ebx
test byte [esp + eax + 0x2a8], 0x10
jne 0x40ece8
lea ecx, [esp + eax + 0x270]
mov eax, dword [ecx + 0x3c]
shr eax, 1
sub eax, edx
je 0x40ed4c
mov edx, dword [esp + 0x10]
lea edx, [ecx + edx*2 + 0x40]
lea ecx, [esp + 0x24]
push eax
call fcn.0040f642
mov edx, dword [esp + 0x14]
add esp, 4
cmp byte [esp + 0x25], 0
je 0x40ece8
movzx eax, byte [esp + 0x24]
mov byte [esp + eax + 0x34], 1
mov al, 1
mov dword [esp + 0x30], eax
jmp 0x40ece8
mov al, 1
mov dword [esp + 0x1c], eax
jmp 0x40ece8
cmp eax, 0x80000006
je 0x40ed90
mov ebx, dword [ebp + 8]
cmp eax, 0xc000000f
je 0x40ee0d
mov esi, dword [esp + 4]
mov edi, dword [esp + 0xc]
cmp eax, 0xc0000022
jne 0x40ee24
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov dword [esi], edi
mov dx, 9
jmp 0x40ebf2
test byte [esp + 0x1c], 1
mov si, 8
je 0x40eeeb
mov ebx, dword [esp + 0xc]
test ebx, ebx
je 0x40edd4
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
mov ecx, dword [ecx + 4]
movzx eax, word [eax + ecx*2 - 2]
cmp eax, 0x2f
je 0x40edd4
cmp eax, 0x5c
je 0x40edd4
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
push 0x5c
call fcn.0040eaea
pop ecx
test ax, ax
jne 0x40ee49
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x20]
mov ecx, edi
mov edx, esi
push dword [esp + 0x10]
mov eax, dword [ebp + 8]
push dword [eax]
call fcn.0040ea9a
pop ecx
pop edx
test ax, ax
mov dword [esp + 0x28], eax
je 0x40ee38
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov dword [eax], ebx
jmp 0x40f07c
push esi
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
mov dx, 8
jmp 0x40ec52
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov dword [esi], edi
mov dx, 0xe
jmp 0x40ebf2
mov ecx, edi
mov edx, esi
push 0
call fcn.0040eaea
pop ecx
test ax, ax
je 0x40ee64
mov esi, eax
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov dword [eax], ebx
mov ebx, dword [ebp + 8]
mov edx, esi
jmp 0x40ebf2
mov ecx, dword [edi]
mov edx, dword [ebp + 0x14]
push dword [ebp + 0x24]
push dword [ebp + 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
call fcn.0040f72d
add esp, 0x10
mov esi, eax
movzx eax, ax
lea ecx, [eax - 8]
cmp ecx, 2
jb 0x40eeeb
cmp eax, 0x6d
je 0x40eeac
test eax, eax
je 0x40f0ac
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
mov dword [eax], ecx
jmp 0x40ee5a
mov eax, dword [esp + 0x10]
mov ecx, dword [ebp + 8]
xor edx, edx
add eax, eax
add eax, dword [ecx]
cmp dword [esp + 0x10], edx
je 0x40eee7
inc edx
cmp word [eax - 2], 0x2e
lea ecx, [eax - 2]
mov eax, ecx
jne 0x40eeb9
push 4
push str..EXE
call fcn.0040f7ac
pop ecx
pop edx
test al, 1
mov si, 0x6d
je 0x40eeeb
jmp 0x40f03e
mov si, 0x6d
mov dword [esp + 0x28], esi
test byte [esp + 0x30], 1
mov esi, dword [esp + 0xc]
je 0x40f058
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
lea edi, [esp + 0x50]
lea ebx, [esp + 0x14]
mov dword [edi], eax
mov dword [edi + 4], ecx
and dword [edi + 8], 0
mov word [edi + 0xc], 0x3b
mov ecx, edi
call fcn.0040f22b
test eax, eax
je 0x40f069
mov esi, edx
mov ecx, ebx
mov dword [esp + 0x2c], eax
mov edx, eax
mov dword [esp + 0x1c], esi
push esi
call fcn.0040f642
pop eax
cmp byte [esp + 0x15], 0
je 0x40ef1b
movzx eax, byte [esp + 0x14]
cmp byte [esp + eax + 0x34], 1
jne 0x40ef1b
mov ebx, dword [esp + 0xc]
mov eax, dword [esp + 4]
test ebx, ebx
mov dword [eax], ebx
je 0x40ef8e
mov eax, dword [esp + 0x18]
mov eax, dword [eax]
movzx eax, word [eax + ebx*2 - 2]
cmp eax, 0x2f
je 0x40ef8e
cmp eax, 0x5c
je 0x40ef8e
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
push 0x5c
call fcn.0040eaea
pop ecx
test ax, ax
jne 0x40f090
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x20]
mov ecx, edi
mov edx, esi
push dword [esp + 0x10]
mov eax, dword [ebp + 8]
push dword [eax]
call fcn.0040ea9a
pop ecx
pop edx
test ax, ax
jne 0x40f088
mov ecx, edi
mov edx, esi
push dword [esp + 0x1c]
push dword [esp + 0x30]
call fcn.0040ea9a
pop ecx
pop edx
test ax, ax
jne 0x40f088
mov ecx, edi
mov edx, esi
push 0
call fcn.0040eaea
pop ecx
test ax, ax
jne 0x40f090
mov eax, dword [ebp + 0x24]
mov ecx, dword [edi]
mov edx, dword [ebp + 0x14]
push eax
push dword [ebp + 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
call fcn.0040f72d
add esp, 0x10
mov esi, eax
movzx eax, ax
lea edi, [esp + 0x50]
lea ebx, [esp + 0x14]
lea ecx, [eax - 8]
cmp ecx, 2
jb 0x40ef1b
cmp eax, 0x6d
jne 0x40f0a8
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x1c]
push 4
push str..EXE
call fcn.0040f7ac
pop ecx
pop edx
test al, 1
je 0x40ef1b
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
mov dx, 0x76
jmp 0x40ebed
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov dword [eax], esi
jmp 0x40f07c
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
mov dword [eax], ecx
mov ebx, dword [ebp + 8]
mov edx, dword [esp + 0x28]
jmp 0x40ebf2
push dword [esp + 8]
mov esi, eax
jmp 0x40f096
mov esi, eax
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov dword [eax], ebx
mov edx, esi
jmp 0x40ebef
test eax, eax
jne 0x40f0c4
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
xor edx, edx
jmp 0x40ebed
push dword [esp + 8]
call sub.ntdll.dll_NtClose
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0xc]
mov dword [eax], ecx
jmp 0x40f0a1