Function at 0x10051120
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x1014
call fcn.102244a0
push ebx
push ebp
push esi
mov ebx, dword [esp + 0x1024]
push edi
mov edi, dword [esp + 0x102c]
push 0
push 0x8002
mov dword [edi], 0
mov ecx, dword [0x107ab964]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, eax
cmp esi, 0xffffffff
je 0x1005143b
mov ecx, dword [0x107ab964]
push esi
mov edx, dword [ecx]
call dword [edx + 0x20]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x1c], ebp
jg 0x1005118f
mov ecx, dword [0x107ab964]
push esi
mov eax, dword [ecx]
call dword [eax + 0x18]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1014
ret
mov ecx, dword [0x107ab964]
push esi
push ecx
call fcn.1000fca0
add esp, 8
test eax, eax
jle 0x1005142f
cmp ebp, eax
jle 0x1005142f
mov eax, dword [0x107ab964]
lea edx, [esp + 0x18]
push edx
push esi
push eax
call fcn.10025680
add esp, 0xc
test eax, eax
je 0x100513c7
mov eax, dword [esp + 0x18]
cmp ebp, eax
jl 0x100513c7
test eax, eax
jle 0x100513c7
add eax, 0x400
cmp ebp, eax
jge 0x10051215
mov ecx, dword [0x107ab964]
push esi
mov edx, dword [ecx]
call dword [edx + 0x18]
mov eax, dword [0x107ab964]
push edi
push ebx
push eax
call fcn.1002bac0
add esp, 0xc
neg eax
pop edi
pop esi
sbb eax, eax
pop ebp
neg eax
pop ebx
add esp, 0x1014
ret
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x24]
push 1
rep stosd dword es:[edi], eax
mov eax, dword [0x107ab964]
lea ecx, [esp + 0x18]
lea edx, [esp + 0x28]
push ecx
push edx
push 0x1000
push 0x1000
push 0x2000
push ebp
push esi
push eax
call fcn.100253e0
add esp, 0x24
test eax, eax
je 0x1005142f
cmp dword [esp + 0x14], 0x1000
jne 0x1005142f
xor eax, eax
mov bl, 0xba
mov edi, 0xbdb4858d
mov edx, 0x3080fff0
mov ecx, 0xf9754a40
cmp word [esp + eax + 0x24], 0x1274
jne 0x10051297
cmp byte [esp + eax + 0x26], bl
jne 0x10051297
cmp dword [esp + eax + 0x2b], edi
jne 0x10051297
cmp dword [esp + eax + 0x2f], edx
jne 0x10051297
cmp dword [esp + eax + 0x34], ecx
je 0x100512b8
inc eax
cmp eax, 0xfe0
jl 0x10051276
mov ecx, dword [0x107ab964]
push esi
mov eax, dword [ecx]
call dword [eax + 0x18]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1014
ret
mov cl, byte [esp + eax + 0x33]
cmp eax, 0xfe0
mov byte [esp + 0x13], cl
mov ecx, dword [esp + eax + 0x27]
mov dword [esp + 0x20], ecx
jge 0x100513c7
test ecx, ecx
je 0x100513c7
mov ebx, ebp
sub ebx, ecx
test ebx, ebx
jle 0x1005142f
cmp ebp, ebx
jle 0x1005142f
mov eax, 0x1000
mov edi, ebx
mov dword [esp + 0x14], eax
xor ebp, ebp
jmp 0x10051302
mov ecx, dword [esp + 0x20]
cmp eax, 0x1000
jne 0x100513c2
mov eax, dword [esp + 0x1c]
cmp eax, edi
jle 0x100513c2
lea edx, [esp + 0x14]
push 1
lea ecx, [esp + 0x28]
push edx
mov edx, dword [0x107ab964]
push ecx
push 0x1000
push 0x1000
push edi
push eax
push esi
push edx
call fcn.100253e0
add esp, 0x24
test eax, eax
je 0x1005142f
mov ecx, dword [esp + 0x14]
test ecx, ecx
jl 0x1005142f
xor eax, eax
test ecx, ecx
jle 0x10051368
mov dl, byte [esp + 0x13]
xor byte [esp + eax + 0x24], dl
inc eax
cmp eax, ecx
jl 0x1005135b
test ebp, ebp
jne 0x10051379
cmp word [esp + 0x24], 0x5a4d
jne 0x1005142f
push ecx
mov ecx, dword [0x107ab964]
lea eax, [esp + 0x28]
push 0x1000
push eax
push edi
push esi
push ecx
call fcn.10029d90
add esp, 0x18
test eax, eax
je 0x100513c7
mov eax, dword [esp + 0x14]
add edi, eax
inc ebp
cmp ebp, 0xa
jl 0x100512fe
mov ecx, dword [0x107ab964]
push esi
mov eax, dword [ecx]
call dword [eax + 0x18]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1014
ret
cmp ebp, 0xa
jl 0x100513e0
mov ecx, dword [0x107ab964]
push esi
mov eax, dword [ecx]
call dword [eax + 0x18]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1014
ret
push 0
push ecx
mov ecx, dword [0x107ab964]
push ebx
push esi
push ecx
call fcn.1002b820
add esp, 0x14
test eax, eax
je 0x1005142f
mov eax, dword [0x107ab964]
push 1
push 0x13a3
push ebx
push esi
push eax
call fcn.10013800
mov ecx, dword [0x107ab964]
add esp, 0x14
test eax, eax
je 0x10051435
mov eax, dword [ecx]
push esi
call dword [eax + 0x18]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1014
ret
mov ecx, dword [0x107ab964]
mov edx, dword [ecx]
push esi
call dword [edx + 0x18]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1014
ret