Function at 0x4035b0
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x5abdcc]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, ecx
mov ecx, 0x5a4d
push esi
push edi
mov dword [ebp - 0xc], eax
cmp word [eax], cx
jne 0x4039da
mov edi, dword [eax + 0x3c]
add edi, eax
mov dword [ebp - 0x14], edi
cmp dword [edi], 0x4550
jne 0x4039da
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x2000
push dword [edi + 0x50]
push dword [edi + 0x34]
call esi
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x40361d
push 4
push 0x2000
push dword [edi + 0x50]
push eax
call esi
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x4039da
push ebx
push 0x14
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov eax, dword [ebp - 0x1c]
push 4
push 0x1000
mov dword [ebp - 0x18], ebx
mov dword [ebx + 4], eax
mov dword [ebx + 0xc], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0x10], 0
push dword [edi + 0x50]
push eax
call esi
push 4
push 0x1000
push dword [edi + 0x54]
push dword [ebp - 0x1c]
call esi
mov esi, eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax + 0x3c]
add ecx, dword [edi + 0x54]
push ecx
push eax
push esi
call fcn.00538ff0
mov ecx, dword [ebp - 0xc]
add esp, 0xc
mov dword [ebp - 0x20], 0
mov eax, dword [ecx + 0x3c]
mov ecx, dword [ebp - 0x1c]
add eax, esi
mov dword [ebx], eax
xor esi, esi
mov dword [eax + 0x34], ecx
mov ecx, dword [ebx]
mov edx, dword [ebx + 4]
mov dword [ebp - 0x10], edx
movzx eax, word [ecx + 0x14]
add eax, 0x28
cmp si, word [ecx + 6]
jae 0x403733
lea edi, [eax + ecx]
mov eax, dword [edi]
test eax, eax
jne 0x4036e8
mov eax, dword [ebp - 0x14]
mov esi, dword [eax + 0x38]
test esi, esi
jle 0x403716
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.00539570
jmp 0x403710
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 - 0xc]
push ecx
push esi
call fcn.00538ff0
mov dword [edi - 8], esi
mov edx, dword [ebp - 0x10]
add esp, 0xc
mov ecx, dword [ebx]
add edi, 0x28
mov esi, dword [ebp - 0x20]
inc esi
mov dword [ebp - 0x20], esi
movzx eax, word [ecx + 6]
cmp esi, eax
jl 0x4036b6
mov edx, dword [ebx + 4]
mov edi, dword [ebp - 0x14]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x1c]
mov ebx, edx
sub eax, dword [edi + 0x34]
mov esi, ecx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0xc], ebx
je 0x4037c7
cmp dword [ecx + 0xa4], 0
mov dword [ebp - 0xc], ebx
jbe 0x4037c7
mov edi, dword [ecx + 0xa0]
add edi, edx
mov dword [ebp - 0xc], edx
mov eax, dword [edi]
test eax, eax
je 0x4037c7
mov ecx, dword [edi + 4]
lea ebx, [eax + edx]
xor esi, esi
lea edx, [edi + 8]
lea eax, [ecx - 8]
test eax, 0xfffffffe
jbe 0x4037ae
nop dword [eax + eax]
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x40379e
mov ecx, dword [ebp - 0x14]
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 0x403780
mov eax, dword [edi + ecx]
add edi, ecx
mov edx, dword [ebp - 0x10]
test eax, eax
jne 0x403766
mov edi, dword [ebp - 0x18]
mov ebx, dword [edi + 4]
mov esi, dword [edi]
mov dword [ebp - 0xc], ebx
jmp 0x4037ca
mov edi, dword [ebp - 0x18]
cmp dword [esi + 0x84], 0
jbe 0x4038c9
mov esi, dword [esi + 0x80]
mov eax, dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
add esi, ebx
push 0x14
push esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x10], eax
call eax
test eax, eax
jne 0x4038c9
mov ecx, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov eax, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 8], ecx
mov dword [ebp - 0x14], eax
nop dword [eax + eax]
mov eax, dword [esi + 0xc]
test eax, eax
je 0x4038c9
add eax, ebx
push eax
call ecx
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4039bf
mov eax, dword [edi + 0xc]
xor ecx, ecx
inc eax
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
push dword [edi + 8]
call fcn.0053db36
add esp, 8
mov dword [edi + 8], eax
test eax, eax
je 0x4039bf
mov ecx, dword [edi + 0xc]
mov dword [eax + ecx*4], ebx
inc dword [edi + 0xc]
mov eax, dword [esi]
test eax, eax
je 0x40386a
mov edx, dword [esi + 0x10]
jmp 0x40386f
mov eax, dword [esi + 0x10]
mov edx, eax
mov ecx, dword [ebp - 0xc]
lea esi, [eax + ecx]
mov eax, dword [esi]
lea edi, [ecx + edx]
test eax, eax
je 0x4038a9
jns 0x403885
movzx eax, ax
jmp 0x40388a
add ecx, 2
add eax, ecx
push eax
push ebx
call dword [ebp - 0x14]
mov dword [edi], eax
test eax, eax
je 0x4039bf
mov eax, dword [esi + 4]
add esi, 4
mov ecx, dword [ebp - 0xc]
add edi, 4
test eax, eax
jne 0x40387e
mov esi, dword [ebp - 0x20]
add esi, 0x14
push 0x14
push esi
mov dword [ebp - 0x20], esi
call dword [ebp - 0x10]
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 0x18]
mov ecx, dword [ebp - 8]
test eax, eax
je 0x403810
mov esi, dword [ebp - 0x18]
xor eax, eax
mov dword [ebp - 0x14], 0
mov ebx, dword [esi]
movzx edi, word [ebx + 0x14]
add edi, 0x28
cmp ax, word [ebx + 6]
jae 0x40398c
add edi, ebx
nop word [eax + eax]
mov edx, dword [edi + 0x14]
mov esi, dword [edi]
test edx, 0x2000000
je 0x40390e
push 0x4000
push esi
push dword [edi - 8]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x403971
mov ecx, edx
mov eax, edx
shr eax, 0x1e
and eax, 1
shr ecx, 0x1d
and ecx, 1
lea ecx, [eax + ecx*2]
mov eax, edx
shr eax, 0x1f
lea eax, [eax + ecx*2]
mov ecx, dword [eax*4 + 0x590fd4]
mov eax, edx
mov dword [ebp - 0x10], ecx
or dword [ebp - 0x10], 0x200
and eax, 0x4000000
mov eax, dword [ebp - 0x10]
cmove eax, ecx
mov ecx, esi
test esi, esi
jne 0x403962
test dl, 0x40
je 0x403957
mov esi, dword [ebx + 0x20]
jmp 0x40395e
test dl, dl
jns 0x403971
mov esi, dword [ebx + 0x24]
test esi, esi
je 0x403971
lea edx, [ebp - 8]
push edx
push eax
push ecx
push dword [edi - 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov esi, dword [ebp - 0x18]
add edi, 0x28
mov ecx, dword [ebp - 0x14]
inc ecx
mov dword [ebp - 0x14], ecx
mov ebx, dword [esi]
movzx eax, word [ebx + 6]
cmp ecx, eax
jl 0x4038f0
mov eax, dword [ebx + 0x28]
test eax, eax
je 0x4039ac
mov ecx, dword [ebp - 0x1c]
add eax, ecx
je 0x4039bf
push 0
push 1
push ecx
call eax
test eax, eax
je 0x4039bf
mov dword [esi + 0x10], 1
pop ebx
pop edi
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0053757c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x18]
call fcn.004039f0
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0053757c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
xor ecx, ebp
pop esi
call fcn.0053757c
mov esp, ebp
pop ebp
ret