Function at 0x46bbb0
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
test esi, esi
je 0x46bdd0
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x46bdd0
mov ebx, dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
lea eax, [esi*8]
push eax
push dword [ebp + 0x14]
call ebx
test eax, eax
jne 0x46bdd0
mov ecx, dword [ebp + 0x18]
mov eax, dword [sym.imp.KERNEL32.dll_IsBadWritePtr]
shl esi, 2
test ecx, ecx
je 0x46bc0a
push esi
push ecx
call eax
test eax, eax
jne 0x46bdd0
mov eax, dword [sym.imp.KERNEL32.dll_IsBadWritePtr]
mov ecx, dword [ebp + 0x1c]
test ecx, ecx
je 0x46bc1e
push 4
push ecx
call eax
test eax, eax
jne 0x46bdd0
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x46bc31
push esi
push 0
push eax
call fcn.00471b60
add esp, 0xc
mov eax, dword [ebp + 0x1c]
test eax, eax
je 0x46bc3e
mov dword [eax], 0
mov esi, dword [ebp + 8]
test esi, esi
je 0x46bdd0
push 0x40
push esi
call ebx
test eax, eax
jne 0x46bdd0
mov eax, 0x5a4d
cmp word [esi], ax
jne 0x46bdd0
mov esi, dword [esi + 0x3c]
add esi, dword [ebp + 8]
push 0xf8
push esi
call ebx
test eax, eax
jne 0x46bdd0
cmp dword [esi], 0x4550
jne 0x46bdd0
mov eax, dword [esi + 0x80]
test eax, eax
je 0x46bdda
mov edx, dword [ebp + 8]
lea esi, [eax + edx]
mov eax, dword [esi + 0xc]
test eax, eax
je 0x46bcc1
add eax, edx
push edi
push eax
call fcn.0047d4b4
add esp, 8
test eax, eax
je 0x46bcbe
mov eax, dword [esi + 0x20]
add esi, 0x14
mov edx, dword [ebp + 8]
test eax, eax
jne 0x46bca1
mov edx, dword [ebp + 8]
cmp dword [esi + 0xc], 0
je 0x46bdda
mov eax, dword [esi]
mov ebx, 1
mov ecx, dword [esi + 0x10]
add eax, edx
mov dword [ebp - 8], eax
add ecx, edx
mov dword [ebp - 4], ecx
mov eax, dword [eax]
test eax, eax
je 0x46bda8
js 0x46bd89
lea edi, [edx + 2]
add edi, eax
cmp byte [edi], 0
je 0x46bd9d
xor ebx, ebx
xor esi, esi
cmp dword [ebp + 0x10], ebx
jbe 0x46bd31
mov eax, dword [ebp + 0x14]
mov edx, dword [eax + esi*8]
movzx eax, byte [edi]
movsx ecx, byte [edx]
cmp ecx, eax
jne 0x46bd28
push edi
push edx
call fcn.0047d4b4
add esp, 8
test eax, eax
je 0x46bdb9
inc esi
cmp esi, dword [ebp + 0x10]
jb 0x46bd06
mov ecx, dword [ebp - 4]
mov edi, dword [ebp + 0x14]
test ebx, ebx
je 0x46bd89
push 0x1c
lea eax, [ebp - 0x28]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
lea eax, [ebp - 0x14]
push eax
push 4
push dword [ebp - 0x1c]
push dword [ebp - 0x28]
call ebx
mov edx, dword [ebp + 0x18]
mov ecx, dword [ebp - 4]
test edx, edx
je 0x46bd68
mov eax, dword [ecx]
mov dword [edx + esi*4], eax
mov eax, dword [edi + esi*8 + 4]
mov dword [ecx], eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 0x14]
push dword [ebp - 0x1c]
push dword [ebp - 0x28]
call ebx
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp - 4]
test eax, eax
je 0x46bd89
inc dword [eax]
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 8]
add eax, 4
add ecx, 4
mov dword [ebp - 8], eax
mov dword [ebp - 4], ecx
mov eax, dword [eax]
test eax, eax
jne 0x46bce9
lea ebx, [eax + 1]
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x14]
mov eax, 1
mov ecx, dword [ebp - 4]
cmp dword [edi + esi*8 + 4], ebx
cmovne ebx, eax
jmp 0x46bd34
push 1
push 0x57
call dword [sym.imp.USER32.dll_SetLastErrorEx]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret