Function at 0x1004a0d0
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x574
push ebx
push ebp
push esi
xor esi, esi
mov dword [eax], esi
mov ecx, dword [0x107ab964]
mov eax, dword [esp + 0x584]
push edi
mov edx, dword [ecx]
push esi
push 0x8002
push eax
call dword [edx + 4]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x1004a387
mov edx, dword [0x107ab964]
mov ecx, 0x18
xor eax, eax
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x24]
push ecx
push ebp
push edx
call fcn.1000fc50
mov ecx, dword [0x107ab964]
add esp, 0xc
cmp eax, esi
je 0x1004a381
mov edx, dword [ecx]
push ebp
call dword [edx + 0x20]
mov ebx, eax
cmp ebx, esi
jle 0x1004a37b
mov ecx, dword [0x107ab964]
push ebp
push ecx
call fcn.10011230
add esp, 8
cmp eax, esi
jl 0x1004a37b
cmp eax, 0x400
jge 0x1004a1a1
mov ecx, dword [0x107ab964]
push ebp
mov edx, dword [ecx]
call dword [edx + 0x18]
mov eax, dword [esp + 0x58c]
mov ecx, dword [esp + 0x588]
mov edx, dword [0x107ab964]
push eax
push ecx
push edx
call fcn.1002bac0
add esp, 0xc
neg eax
sbb eax, eax
neg eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x574
ret
lea eax, [esp + 0x14]
lea ecx, [esp + 0x1c]
push eax
lea edx, [esp + 0x1c]
push ecx
lea eax, [esp + 0x1b]
push edx
push eax
push ebx
mov dword [esp + 0x30], esi
sub esp, 0x60
mov dword [esp + 0x8c], esi
mov dword [esp + 0x88], esi
mov ecx, 0x18
lea esi, [esp + 0x98]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push ebp
mov byte [esp + 0x8b], 0
call fcn.1013ffc0
mov al, byte [esp + 0x8b]
add esp, 0x78
test al, al
je 0x1004a32f
mov esi, dword [esp + 0x18]
test esi, esi
je 0x1004a32f
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x1004a32f
mov edx, dword [esp + 0x14]
test edx, edx
jge 0x1004a32f
cmp eax, ebx
jg 0x1004a32f
cmp esi, 0x500
ja 0x1004a32f
mov ecx, 0x140
xor eax, eax
lea edi, [esp + 0x84]
push 1
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x24]
lea eax, [esp + 0x88]
push ecx
mov ecx, dword [0x107ab964]
push eax
add edx, ebx
push 0x500
push esi
push edx
push ebx
push ebp
push ecx
mov dword [esp + 0x38], edx
call fcn.100253e0
add esp, 0x24
test eax, eax
je 0x1004a37b
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
cmp eax, esi
jne 0x1004a37b
lea edx, [esi - 1]
xor eax, eax
test edx, edx
jle 0x1004a2a7
mov cl, byte [esp + 0x13]
xor byte [esp + eax + 0x84], cl
inc cl
inc eax
cmp eax, edx
jl 0x1004a295
mov byte [esp + 0x13], cl
cmp word [esp + 0x84], 0x5a4d
je 0x1004a2cc
mov ecx, dword [0x107ab964]
push ebp
mov edx, dword [ecx]
call dword [edx + 0x18]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x574
ret
mov ecx, dword [0x107ab964]
push esi
lea eax, [esp + 0x88]
push 0x500
push eax
push 0
push ebp
push ecx
call fcn.10029d90
add esp, 0x18
test eax, eax
jne 0x1004a309
mov ecx, dword [0x107ab964]
push ebp
mov edx, dword [ecx]
call dword [edx + 0x18]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x574
ret
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
sub ecx, eax
push eax
add edx, eax
mov eax, dword [0x107ab964]
push ecx
push edx
push ebp
push eax
call fcn.1002b820
add esp, 0x14
test eax, eax
jne 0x1004a348
mov ecx, dword [0x107ab964]
push ebp
mov edx, dword [ecx]
call dword [edx + 0x18]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x574
ret
mov eax, dword [esp + 0x14]
sub ebx, eax
push ebx
push eax
mov eax, dword [0x107ab964]
push ebp
push eax
call fcn.100014d0
mov ecx, dword [0x107ab964]
add esp, 0x10
mov edx, dword [ecx]
push ebp
call dword [edx + 0x18]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x574
ret
mov ecx, dword [0x107ab964]
mov eax, dword [ecx]
push ebp
call dword [eax + 0x18]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x574
ret