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

Disassembly:
sub esp, 0x9c
mov eax, dword [0x695e68]
push ebx
push ebp
push esi
xor esi, esi
push edi
cmp eax, esi
mov dword [esp + 0x10], esi
jne 0x5911eb
push 0x380
mov dword [0x695e68], 1
call fcn.0055e950
mov edi, eax
mov ecx, 0xe0
xor eax, eax
mov dword [0x6ac29c], edi
rep stosd dword es:[edi], eax
push 0x460
call fcn.0055e950
mov edi, eax
mov ecx, 0x118
xor eax, eax
mov dword [0x6ac3d4], edi
rep stosd dword es:[edi], eax
push 0x8000
call fcn.0055e950
add esp, 0xc
mov dword [0x695e70], eax
call fcn.00590b10
mov ebp, eax
cmp ebp, 0xffffffff
je 0x5914c3
mov ebx, dword [esp + 0xb4]
test ebx, 0x80000000
je 0x59121f
and ebx, 0x7fffffff
mov dword [esp + 0x10], 1
mov dword [esp + 0xb4], ebx
mov eax, dword [esp + 0xb0]
push ebx
push eax
call fcn.0055e3c0
mov edi, eax
add esp, 8
cmp edi, 0xffffffff
jne 0x591244
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.0055e410
add esp, 0xc
cmp eax, 0x40
jne 0x5912a5
cmp byte [esp + 0x2c], 0x4d
jne 0x5912a5
cmp byte [esp + 0x2d], 0x5a
jne 0x5912a5
mov edx, dword [esp + 0x68]
push esi
push edx
push edi
call fcn.0055e560
lea eax, [esp + 0x38]
push 2
push eax
push edi
call fcn.0055e410
add esp, 0x18
cmp eax, 2
jne 0x5912a5
cmp byte [esp + 0x2c], 0x50
jne 0x5912a5
cmp byte [esp + 0x2d], 0x45
jne 0x5912a5
test ebx, ebx
mov esi, 1
jne 0x591446
push esi
push edi
call fcn.00590990
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
je 0x591446
mov ecx, dword [0x6ac3d0]
push 0
add ecx, esi
push ecx
push edi
call fcn.0055e560
mov edx, dword [0x6ac3d0]
add esp, 0xc
add edx, esi
cmp eax, edx
jne 0x591446
lea eax, [esp + 0x14]
push 0x16
push eax
push edi
call fcn.0055e410
add esp, 0xc
cmp eax, 0x16
jne 0x591446
mov eax, dword [esp + 0x14]
xor ebx, ebx
cmp eax, 0x605444f
mov eax, dword [esp + 0x18]
jne 0x59134c
test ax, ax
je 0x59134c
mov edx, dword [0x6ac29c]
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 0x59132e
mov ebx, dword [esp + 0x18]
jmp 0x591371
mov cx, word [esp + 0x1e]
cmp cx, word [esp + 0x1c]
jne 0x591446
cmp word [esp + 0x1a], 0
jne 0x591446
test ax, ax
jne 0x591446
mov eax, dword [esp + 0x10]
test eax, eax
je 0x591392
mov eax, dword [0x6ac29c]
lea edx, [ebp*8]
sub edx, ebp
test byte [eax + edx*8 + 8], 1
je 0x591446
lea esi, [ebp*8]
sub esi, ebp
shl esi, 3
call fcn.005933d0
mov ecx, dword [0x6ac29c]
push ebx
mov dword [esi + ecx], eax
mov edx, dword [0x6ac29c]
mov dword [esi + edx + 4], edi
mov eax, dword [0x6ac29c]
mov byte [esi + eax + 0x20], 0
mov ecx, dword [esp + 0x28]
mov edx, dword [0x6ac3d0]
mov eax, dword [0x6ac29c]
add edx, ecx
mov dword [esi + eax + 0xc], edx
mov ecx, dword [0x6ac29c]
mov edx, dword [esp + 0x24]
mov dword [esi + ecx + 0x10], edx
mov eax, dword [0x6ac29c]
mov ecx, dword [esi + eax + 0xc]
mov dword [esi + eax + 0x18], ecx
mov edx, dword [0x6ac29c]
mov eax, dword [esp + 0x20]
mov dword [esi + edx + 0x1c], eax
mov ecx, dword [0x6ac29c]
mov eax, dword [esp + 0x24]
mov edx, dword [esi + ecx]
mov ecx, dword [esp + 0x28]
push edx
mov edx, dword [0x6ac3d0]
add edx, ecx
push eax
push edx
push edi
call fcn.00590b80
add esp, 0x14
test eax, eax
jne 0x59145c
mov eax, dword [0x6ac29c]
mov ecx, dword [esi + eax]
push ecx
call fcn.00593470
mov edx, dword [0x6ac29c]
add esp, 4
mov dword [esi + edx], 0
push edi
call fcn.0055e470
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 0x59148b
cmp ecx, 2
je 0x59148b
mov ecx, dword [0x6ac29c]
cmp eax, 0xffffffff
mov dword [esi + ecx + 0x14], 0
je 0x5914a7
push eax
call fcn.0055ea20
add esp, 4
jmp 0x5914a7
mov edx, dword [0x6ac29c]
cmp eax, 0xffffffff
mov dword [esi + edx + 0x14], eax
jne 0x5914a7
mov eax, dword [0x6ac29c]
mov dword [esi + eax + 0x14], 0xffffffff
mov ecx, dword [0x6ac29c]
push 0
mov edx, dword [esi + ecx]
push edx
call fcn.00592fe0
add esp, 8
or ebp, 0x4f440000
mov esi, ebp
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x9c
ret