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

Disassembly:
sub esp, 0x9c
mov eax, dword [0x6938a0]
push ebx
push ebp
push esi
xor esi, esi
push edi
cmp eax, esi
mov dword [esp + 0x10], esi
jne 0x5998eb
push 0x380
mov dword [0x6938a0], 1
call fcn.00567110
mov edi, eax
mov ecx, 0xe0
xor eax, eax
mov dword [0x6a9d1c], edi
rep stosd dword es:[edi], eax
push 0x460
call fcn.00567110
mov edi, eax
mov ecx, 0x118
xor eax, eax
mov dword [0x6a9e54], edi
rep stosd dword es:[edi], eax
push 0x8000
call fcn.00567110
add esp, 0xc
mov dword [0x6938a8], eax
call fcn.00599210
mov ebp, eax
cmp ebp, 0xffffffff
je 0x599bc3
mov ebx, dword [esp + 0xb4]
test ebx, 0x80000000
je 0x59991f
and ebx, 0x7fffffff
mov dword [esp + 0x10], 1
mov dword [esp + 0xb4], ebx
mov eax, dword [esp + 0xb0]
push ebx
push eax
call fcn.00566b80
mov edi, eax
add esp, 8
cmp edi, 0xffffffff
jne 0x599944
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.00566bd0
add esp, 0xc
cmp eax, 0x40
jne 0x5999a5
cmp byte [esp + 0x2c], 0x4d
jne 0x5999a5
cmp byte [esp + 0x2d], 0x5a
jne 0x5999a5
mov edx, dword [esp + 0x68]
push esi
push edx
push edi
call fcn.00566d20
lea eax, [esp + 0x38]
push 2
push eax
push edi
call fcn.00566bd0
add esp, 0x18
cmp eax, 2
jne 0x5999a5
cmp byte [esp + 0x2c], 0x50
jne 0x5999a5
cmp byte [esp + 0x2d], 0x45
jne 0x5999a5
test ebx, ebx
mov esi, 1
jne 0x599b46
push esi
push edi
call fcn.00599090
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
je 0x599b46
mov ecx, dword [0x6a9e50]
push 0
add ecx, esi
push ecx
push edi
call fcn.00566d20
mov edx, dword [0x6a9e50]
add esp, 0xc
add edx, esi
cmp eax, edx
jne 0x599b46
lea eax, [esp + 0x14]
push 0x16
push eax
push edi
call fcn.00566bd0
add esp, 0xc
cmp eax, 0x16
jne 0x599b46
mov eax, dword [esp + 0x14]
xor ebx, ebx
cmp eax, 0x605444f
mov eax, dword [esp + 0x18]
jne 0x599a4c
test ax, ax
je 0x599a4c
mov edx, dword [0x6a9d1c]
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, 0x4d
xor bl, al
mov byte [esp + ecx + 0x14], bl
inc ecx
cmp ecx, 0x16
jb 0x599a2e
mov ebx, dword [esp + 0x18]
jmp 0x599a71
mov cx, word [esp + 0x1e]
cmp cx, word [esp + 0x1c]
jne 0x599b46
cmp word [esp + 0x1a], 0
jne 0x599b46
test ax, ax
jne 0x599b46
mov eax, dword [esp + 0x10]
test eax, eax
je 0x599a92
mov eax, dword [0x6a9d1c]
lea edx, [ebp*8]
sub edx, ebp
test byte [eax + edx*8 + 8], 1
je 0x599b46
lea esi, [ebp*8]
sub esi, ebp
shl esi, 3
call fcn.0059bb30
mov ecx, dword [0x6a9d1c]
push ebx
mov dword [esi + ecx], eax
mov edx, dword [0x6a9d1c]
mov dword [esi + edx + 4], edi
mov eax, dword [0x6a9d1c]
mov byte [esi + eax + 0x20], 0
mov ecx, dword [esp + 0x28]
mov edx, dword [0x6a9e50]
mov eax, dword [0x6a9d1c]
add edx, ecx
mov dword [esi + eax + 0xc], edx
mov ecx, dword [0x6a9d1c]
mov edx, dword [esp + 0x24]
mov dword [esi + ecx + 0x10], edx
mov eax, dword [0x6a9d1c]
mov ecx, dword [esi + eax + 0xc]
mov dword [esi + eax + 0x18], ecx
mov edx, dword [0x6a9d1c]
mov eax, dword [esp + 0x20]
mov dword [esi + edx + 0x1c], eax
mov ecx, dword [0x6a9d1c]
mov eax, dword [esp + 0x24]
mov edx, dword [esi + ecx]
mov ecx, dword [esp + 0x28]
push edx
mov edx, dword [0x6a9e50]
add edx, ecx
push eax
push edx
push edi
call fcn.00599280
add esp, 0x14
test eax, eax
jne 0x599b5c
mov eax, dword [0x6a9d1c]
mov ecx, dword [esi + eax]
push ecx
call fcn.0059bbd0
mov edx, dword [0x6a9d1c]
add esp, 4
mov dword [esi + edx], 0
push edi
call fcn.00566c30
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 0x599b8b
cmp ecx, 2
je 0x599b8b
mov ecx, dword [0x6a9d1c]
cmp eax, 0xffffffff
mov dword [esi + ecx + 0x14], 0
je 0x599ba7
push eax
call fcn.005671e0
add esp, 4
jmp 0x599ba7
mov edx, dword [0x6a9d1c]
cmp eax, 0xffffffff
mov dword [esi + edx + 0x14], eax
jne 0x599ba7
mov eax, dword [0x6a9d1c]
mov dword [esi + eax + 0x14], 0xffffffff
mov ecx, dword [0x6a9d1c]
push 0
mov edx, dword [esi + ecx]
push edx
call fcn.0059b6e0
add esp, 8
or ebp, 0x4f440000
mov esi, ebp
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x9c
ret