Function at 0x1004eb80
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0x10
mov ecx, 0x5a4d
push ebx
push edi
cmp word [eax], cx
jne 0x1004edbd
mov ebx, dword [eax + 0x3c]
add ebx, eax
mov dword [ebp - 0x10], ebx
cmp dword [ebx], 0x4550
jne 0x1004edbd
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x1004ebb7
mov eax, dword [ebx + 0x34]
mov edi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x2000
push dword [ebx + 0x50]
push eax
call edi
mov dword [ebp - 4], eax
test eax, eax
jne 0x1004ebe9
push 4
push 0x2000
push dword [ebx + 0x50]
push eax
call edi
mov dword [ebp - 4], eax
test eax, eax
je 0x1004edbd
push esi
push 0x14
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
xor eax, eax
push 4
push 0x1000
mov dword [esi], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov eax, dword [ebp - 4]
mov dword [esi + 4], eax
push dword [ebx + 0x50]
push eax
call edi
mov ecx, dword [ebx + 0x54]
mov edi, eax
mov eax, dword [ebp + 8]
add ecx, dword [eax + 0x3c]
push ecx
push eax
push edi
call fcn.100c2f10
mov ecx, dword [ebp + 8]
add esp, 0xc
mov dword [ebp - 0xc], 0
mov eax, dword [ecx + 0x3c]
add eax, edi
mov edi, dword [ebp - 4]
mov dword [esi + 8], eax
mov dword [eax + 0x34], edi
mov eax, dword [esi + 8]
mov ecx, dword [esi + 4]
mov dword [ebp - 8], ecx
xor ecx, ecx
movzx edx, word [eax + 0x14]
add edx, 0x28
cmp cx, word [eax + 6]
mov ecx, dword [ebp - 8]
jae 0x1004eceb
lea ebx, [edx + eax]
lea ecx, [ecx]
mov eax, dword [ebx]
test eax, eax
jne 0x1004eca2
mov eax, dword [ebp - 0x10]
mov edi, dword [eax + 0x38]
test edi, edi
jle 0x1004ecd0
mov eax, dword [ebx - 4]
push 4
push 0x1000
push edi
add eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push edi
push 0
push eax
mov dword [ebx - 8], eax
call fcn.100c3490
jmp 0x1004ecca
push 4
push 0x1000
push eax
mov eax, dword [ebx - 4]
add eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push dword [ebx]
mov ecx, dword [ebx + 4]
mov edi, eax
add ecx, dword [ebp + 8]
push ecx
push edi
call fcn.100c2f10
mov dword [ebx - 8], edi
mov ecx, dword [ebp - 8]
add esp, 0xc
mov eax, dword [esi + 8]
add ebx, 0x28
mov edi, dword [ebp - 0xc]
inc edi
mov dword [ebp - 0xc], edi
movzx eax, word [eax + 6]
cmp edi, eax
jl 0x1004ec70
mov ebx, dword [ebp - 0x10]
mov edi, dword [ebp - 4]
mov eax, edi
sub eax, dword [ebx + 0x34]
je 0x1004ecfc
push eax
push esi
call fcn.1004edd0
add esp, 8
mov bl, byte [ebp + 0x10]
test bl, bl
je 0x1004ed10
push esi
call fcn.1004e860
add esp, 4
test al, al
je 0x1004ed42
push esi
call fcn.1004e980
mov eax, dword [esi + 8]
add esp, 4
mov eax, dword [eax + 0x28]
test eax, eax
je 0x1004ed39
test bl, bl
je 0x1004ed39
add eax, edi
je 0x1004ed42
push 0
push 1
push edi
call eax
test eax, eax
je 0x1004ed42
mov byte [esi], 1
mov eax, esi
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [esi], 0
je 0x1004ed59
mov eax, dword [esi + 8]
mov ecx, dword [esi + 4]
push 0
push 0
mov eax, dword [eax + 0x28]
push ecx
add eax, ecx
call eax
cmp dword [esi + 0x10], 0
je 0x1004ed8f
xor edi, edi
cmp dword [esi + 0xc], edi
jle 0x1004ed84
mov ebx, dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea esp, [esp]
mov eax, dword [esi + 0x10]
mov eax, dword [eax + edi*4]
cmp eax, 0xffffffff
je 0x1004ed7e
push eax
call ebx
inc edi
cmp edi, dword [esi + 0xc]
jl 0x1004ed70
push dword [esi + 0x10]
call fcn.100cdfb7
add esp, 4
mov eax, dword [esi + 4]
test eax, eax
je 0x1004eda4
push 0x8000
push 0
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret