Function at 0x46f840
Capabilities:
Encode data using xor
Parse pe header

Disassembly:
sub esp, 0x9c
mov eax, dword [0x4a505c]
push ebx
push ebp
push esi
xor esi, esi
push edi
cmp eax, esi
mov dword [esp + 0x10], esi
jne 0x46f8ab
push 0x380
mov dword [0x4a505c], 1
call fcn.004629a0
mov edi, eax
mov ecx, 0xe0
xor eax, eax
mov dword [0x4a691c], edi
rep stosd dword es:[edi], eax
push 0x460
call fcn.004629a0
mov edi, eax
mov ecx, 0x118
xor eax, eax
mov dword [0x4a6a68], edi
rep stosd dword es:[edi], eax
push 0x8000
call fcn.004629a0
add esp, 0xc
mov dword [0x4a5064], eax
call fcn.0046f1d0
mov ebp, eax
cmp ebp, 0xffffffff
je 0x46fb83
mov ebx, dword [esp + 0xb4]
test ebx, 0x80000000
je 0x46f8df
and ebx, 0x7fffffff
mov dword [esp + 0x10], 1
mov dword [esp + 0xb4], ebx
mov eax, dword [esp + 0xb0]
push ebx
push eax
call fcn.00462840
mov edi, eax
add esp, 8
cmp edi, 0xffffffff
jne 0x46f904
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
lea ecx, [esp + 0x2c]
push 0x40
push ecx
push edi
xor esi, esi
call fcn.00462890
add esp, 0xc
cmp eax, 0x40
jne 0x46f965
cmp byte [esp + 0x2c], 0x4d
jne 0x46f965
cmp byte [esp + 0x2d], 0x5a
jne 0x46f965
mov edx, dword [esp + 0x68]
push esi
push edx
push edi
call fcn.00462970
lea eax, [esp + 0x38]
push 2
push eax
push edi
call fcn.00462890
add esp, 0x18
cmp eax, 2
jne 0x46f965
cmp byte [esp + 0x2c], 0x50
jne 0x46f965
cmp byte [esp + 0x2d], 0x45
jne 0x46f965
test ebx, ebx
mov esi, 1
jne 0x46fb06
push esi
push edi
call fcn.0046f050
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
je 0x46fb06
mov ecx, dword [0x4a6a64]
push 0
add ecx, esi
push ecx
push edi
call fcn.00462970
mov edx, dword [0x4a6a64]
add esp, 0xc
add edx, esi
cmp eax, edx
jne 0x46fb06
lea eax, [esp + 0x14]
push 0x16
push eax
push edi
call fcn.00462890
add esp, 0xc
cmp eax, 0x16
jne 0x46fb06
mov eax, dword [esp + 0x14]
xor ebx, ebx
cmp eax, 0x605444f
mov eax, dword [esp + 0x18]
jne 0x46fa0c
test ax, ax
je 0x46fa0c
mov edx, dword [0x4a691c]
lea ecx, [ebp*8]
sub ecx, ebp
lea eax, [edx + ecx*8 + 8]
mov ecx, dword [edx + ecx*8 + 8]
or ecx, 1
mov dword [eax], ecx
mov ecx, 4
mov al, cl
mov dl, 3
imul dl
mov bl, byte [esp + ecx + 0x14]
sub al, 0x5b
xor bl, al
mov byte [esp + ecx + 0x14], bl
inc ecx
cmp ecx, 0x16
jb 0x46f9ee
mov ebx, dword [esp + 0x18]
jmp 0x46fa31
mov cx, word [esp + 0x1e]
cmp cx, word [esp + 0x1c]
jne 0x46fb06
cmp word [esp + 0x1a], 0
jne 0x46fb06
test ax, ax
jne 0x46fb06
mov eax, dword [esp + 0x10]
test eax, eax
je 0x46fa52
mov eax, dword [0x4a691c]
lea edx, [ebp*8]
sub edx, ebp
test byte [eax + edx*8 + 8], 1
je 0x46fb06
lea esi, [ebp*8]
sub esi, ebp
shl esi, 3
call fcn.00472360
mov ecx, dword [0x4a691c]
push ebx
mov dword [esi + ecx], eax
mov edx, dword [0x4a691c]
mov dword [esi + edx + 4], edi
mov eax, dword [0x4a691c]
mov byte [esi + eax + 0x20], 0
mov ecx, dword [esp + 0x28]
mov edx, dword [0x4a6a64]
mov eax, dword [0x4a691c]
add edx, ecx
mov dword [esi + eax + 0xc], edx
mov ecx, dword [0x4a691c]
mov edx, dword [esp + 0x24]
mov dword [esi + ecx + 0x10], edx
mov eax, dword [0x4a691c]
mov ecx, dword [esi + eax + 0xc]
mov dword [esi + eax + 0x18], ecx
mov edx, dword [0x4a691c]
mov eax, dword [esp + 0x20]
mov dword [esi + edx + 0x1c], eax
mov ecx, dword [0x4a691c]
mov eax, dword [esp + 0x24]
mov edx, dword [esi + ecx]
mov ecx, dword [esp + 0x28]
push edx
mov edx, dword [0x4a6a64]
add edx, ecx
push eax
push edx
push edi
call fcn.0046f240
add esp, 0x14
test eax, eax
jne 0x46fb1c
mov eax, dword [0x4a691c]
mov ecx, dword [esi + eax]
push ecx
call fcn.004723f0
mov edx, dword [0x4a691c]
add esp, 4
mov dword [esi + edx], 0
push edi
call fcn.004628f0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x9c
ret
mov ecx, dword [esp + 0xb4]
cmp ecx, 1
je 0x46fb4b
cmp ecx, 2
je 0x46fb4b
mov ecx, dword [0x4a691c]
cmp eax, 0xffffffff
mov dword [esi + ecx + 0x14], 0
je 0x46fb67
push eax
call fcn.004629d0
add esp, 4
jmp 0x46fb67
mov edx, dword [0x4a691c]
cmp eax, 0xffffffff
mov dword [esi + edx + 0x14], eax
jne 0x46fb67
mov eax, dword [0x4a691c]
mov dword [esi + eax + 0x14], 0xffffffff
mov ecx, dword [0x4a691c]
push 0
mov edx, dword [esi + ecx]
push edx
call fcn.00471f20
add esp, 8
or ebp, 0x4f440000
mov esi, ebp
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x9c
ret