Function at 0x10005120
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x10024008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, ecx
mov ecx, 0x5a4d
push ebx
push esi
mov dword [ebp - 0x18], eax
cmp word [eax], cx
jne 0x1000541c
mov ebx, dword [eax + 0x3c]
add ebx, eax
cmp dword [ebx], 0x4550
jne 0x1000541c
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x2000
push dword [ebx + 0x50]
push dword [ebx + 0x34]
call esi
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x1000518a
push 4
push 0x2000
push dword [ebx + 0x50]
push eax
call esi
mov dword [ebp - 0xc], eax
test eax, eax
je 0x1000541c
push edi
push 0x14
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov eax, dword [ebp - 0xc]
push 4
push 0x1000
mov dword [ebp - 0x10], edi
mov dword [edi + 4], eax
mov dword [edi + 0xc], 0
mov dword [edi + 8], 0
mov dword [edi + 0x10], 0
push dword [ebx + 0x50]
push eax
call esi
push 4
push 0x1000
push dword [ebx + 0x54]
push dword [ebp - 0xc]
call esi
mov ecx, dword [ebx + 0x54]
mov esi, eax
mov eax, dword [ebp - 0x18]
add ecx, dword [eax + 0x3c]
push ecx
push eax
push esi
call fcn.1000a310
mov ecx, dword [ebp - 0x18]
add esp, 0xc
mov dword [ebp - 8], 0
mov eax, dword [ecx + 0x3c]
mov ecx, dword [ebp - 0xc]
add eax, esi
mov dword [edi], eax
xor esi, esi
mov dword [eax + 0x34], ecx
mov ecx, dword [edi]
mov edx, dword [edi + 4]
mov dword [ebp - 0x14], edx
movzx eax, word [ecx + 0x14]
add eax, 0x28
cmp si, word [ecx + 6]
jae 0x10005297
lea edi, [eax + ecx]
nop
mov eax, dword [edi]
test eax, eax
jne 0x1000524f
mov esi, dword [ebx + 0x38]
test esi, esi
jle 0x1000527d
mov eax, dword [edi - 4]
push 4
push 0x1000
push esi
add eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push esi
push 0
push eax
mov dword [edi - 8], eax
call fcn.10008df0
jmp 0x10005277
push 4
push 0x1000
push eax
mov eax, dword [edi - 4]
add eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push dword [edi]
mov ecx, dword [edi + 4]
mov esi, eax
add ecx, dword [ebp - 0x18]
push ecx
push esi
call fcn.1000a310
mov dword [edi - 8], esi
mov edx, dword [ebp - 0x14]
add esp, 0xc
mov eax, dword [ebp - 0x10]
add edi, 0x28
mov esi, dword [ebp - 8]
inc esi
mov dword [ebp - 8], esi
mov ecx, dword [eax]
movzx eax, word [ecx + 6]
cmp esi, eax
jl 0x10005220
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
sub eax, dword [ebx + 0x34]
mov dword [ebp - 8], eax
je 0x1000530f
cmp dword [ecx + 0xa4], 0
jbe 0x1000530f
mov edx, dword [edi + 4]
mov edi, dword [ecx + 0xa0]
add edi, edx
mov dword [ebp - 0x14], edx
mov eax, dword [edi]
test eax, eax
je 0x1000530f
nop
mov ecx, dword [edi + 4]
lea ebx, [eax + edx]
xor esi, esi
lea edx, [edi + 8]
lea eax, [ecx - 8]
test eax, 0xfffffffe
jbe 0x10005303
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x100052f3
mov ecx, dword [ebp - 8]
and eax, 0xfff
add dword [eax + ebx], ecx
mov ecx, dword [edi + 4]
inc esi
add edx, 2
lea eax, [ecx - 8]
shr eax, 1
cmp esi, eax
jb 0x100052d5
mov eax, dword [edi + ecx]
add edi, ecx
mov edx, dword [ebp - 0x14]
test eax, eax
jne 0x100052c0
mov esi, dword [ebp - 0x10]
mov ecx, esi
call fcn.10004ff0
test eax, eax
je 0x10005402
mov edi, dword [esi]
xor ecx, ecx
xor ebx, ebx
movzx eax, word [edi + 0x14]
add eax, 0x28
cmp cx, word [edi + 6]
jae 0x100053cf
lea esi, [eax + edi]
nop dword [eax + eax]
mov edx, dword [esi + 0x14]
test edx, 0x2000000
je 0x1000535d
push 0x4000
push dword [esi]
push dword [esi - 8]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x100053b7
mov ecx, edx
mov eax, edx
shr eax, 0x1e
shr ecx, 0x1d
and eax, 1
and ecx, 1
lea ecx, [eax + ecx*2]
mov eax, edx
shr eax, 0x1f
lea eax, [eax + ecx*2]
mov ecx, dword [eax*4 + 0x10020a1c]
test edx, 0x4000000
je 0x1000538d
or ecx, 0x200
mov eax, dword [esi]
test eax, eax
jne 0x100053a8
test dl, 0x40
je 0x1000539d
mov eax, dword [edi + 0x20]
jmp 0x100053a4
test dl, dl
jns 0x100053b7
mov eax, dword [edi + 0x24]
test eax, eax
je 0x100053b7
lea edx, [ebp - 8]
push edx
push ecx
push eax
push dword [esi - 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [ebp - 0x10]
inc ebx
add esi, 0x28
mov edi, dword [eax]
movzx eax, word [edi + 6]
cmp ebx, eax
jl 0x10005340
mov esi, dword [ebp - 0x10]
mov eax, dword [edi + 0x28]
test eax, eax
je 0x100053ef
mov ecx, dword [ebp - 0xc]
add eax, ecx
je 0x10005402
push 0
push 1
push ecx
call eax
test eax, eax
je 0x10005402
mov dword [esi + 0x10], 1
pop edi
mov eax, esi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100073c8
mov esp, ebp
pop ebp
ret
mov ecx, esi
call fcn.100054c0
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100073c8
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop esi
xor ecx, ebp
pop ebx
call fcn.100073c8
mov esp, ebp
pop ebp
ret