Function at 0x499060
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x20]
sub esp, 0x128
push esi
mov esi, dword [esp + 0x144]
push esi
mov dword [eax], 0
call fcn.00499380
add esp, 4
test eax, eax
jne 0x499317
mov eax, esi
imul eax, eax, 0x64
push ebx
mov ebx, dword [eax + 0x601698]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14c]
mov ecx, eax
and cl, 7
neg cl
push edi
mov dword [esp + 0x18], ebx
sbb ecx, ecx
shr eax, 3
neg ecx
add ecx, eax
mov eax, dword [esp + 0x148]
mov esi, ecx
cmp eax, esi
ja 0x49936b
lea edx, [ebx + eax + 2]
cmp esi, edx
jb 0x49936b
mov edi, dword [esp + 0x144]
cmp edi, esi
jne 0x49936b
push ebp
push esi
call fcn.0046f5b0
push esi
mov ebp, eax
call fcn.0046f5b0
push esi
mov dword [esp + 0x1c], eax
call fcn.0046f5b0
push esi
mov dword [esp + 0x28], eax
call fcn.0046f5b0
add esp, 0x10
test ebp, ebp
mov dword [esp + 0x14], eax
je 0x499328
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x49931f
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x49931f
test eax, eax
je 0x49931f
mov eax, dword [esp + 0x144]
cmp byte [eax + edi - 1], 0xbc
jne 0x499216
mov edi, esi
sub edi, ebx
lea ebx, [edi - 1]
push ebx
push eax
push ebp
call fcn.00498540
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x150]
push eax
mov ecx, esi
sub ecx, eax
lea eax, [ecx + edx - 1]
mov ecx, dword [esp + 0x24]
push eax
push ecx
call fcn.00498540
mov edx, dword [esp + 0x16c]
lea ecx, [esi*8]
sub ecx, edx
mov edx, dword [esp + 0x15c]
add esp, 0x18
inc ecx
mov eax, 0xff
sar eax, cl
mov cl, byte [edx]
mov dword [esp + 0x20], eax
not eax
test al, cl
jne 0x499216
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
push ebx
push eax
mov eax, dword [esp + 0x158]
push ecx
push edx
push eax
call fcn.004c6360
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x4992eb
test ebx, ebx
jbe 0x4991e9
mov ecx, dword [esp + 0x10]
mov eax, ebp
sub ecx, ebp
mov esi, ebx
lea esp, [esp]
mov dl, byte [ecx + eax]
xor byte [eax], dl
inc eax
dec esi
jne 0x4991e0
mov dl, byte [ebp]
mov ecx, dword [esp + 0x14c]
mov al, byte [esp + 0x20]
and dl, al
sub edi, ecx
xor ebx, ebx
sub edi, 2
mov byte [ebp], dl
je 0x499210
cmp byte [ebx + ebp], 0
jne 0x499216
inc ebx
cmp ebx, edi
jb 0x499205
cmp byte [ebx + ebp], 1
je 0x499220
mov esi, 0x7d5
jmp 0x4992eb
mov edi, dword [esp + 0x24]
lea ecx, [esp + 0x28]
push ecx
call dword [edi + 0x6016e4]
mov esi, eax
add esp, 4
test esi, esi
jne 0x4992eb
mov esi, dword [esp + 0x10]
push 8
push esi
call fcn.0049acc0
push 8
lea edx, [esp + 0x34]
push esi
push edx
call dword [edi + 0x6016e8]
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x4992eb
mov eax, dword [esp + 0x140]
mov ecx, dword [esp + 0x13c]
push eax
push ecx
lea edx, [esp + 0x30]
push edx
call dword [edi + 0x6016e8]
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x4992eb
mov eax, dword [esp + 0x14c]
push eax
lea ecx, [ebx + ebp + 1]
push ecx
lea edx, [esp + 0x30]
push edx
call dword [edi + 0x6016e8]
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x4992eb
mov eax, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x2c]
push ecx
call dword [edi + 0x6016ec]
mov esi, eax
add esp, 8
test esi, esi
jne 0x4992eb
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push edx
push eax
push ecx
call fcn.00498a70
add esp, 0xc
test eax, eax
jne 0x4992e9
mov edx, dword [esp + 0x158]
mov dword [edx], 1
xor esi, esi
mov eax, dword [esp + 0x14]
push eax
call fcn.0046f320
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0046f320
mov edx, dword [esp + 0x18]
push edx
call fcn.0046f320
push ebp
call fcn.0046f320
add esp, 0x10
pop ebp
pop edi
mov eax, esi
pop ebx
pop esi
add esp, 0x128
ret
push ebp
call fcn.0046f320
add esp, 4
mov eax, dword [esp + 0x10]
test eax, eax
je 0x499339
push eax
call fcn.0046f320
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x49934a
push eax
call fcn.0046f320
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x49935b
push eax
call fcn.0046f320
add esp, 4
pop ebp
pop edi
pop ebx
mov eax, 0xc
pop esi
add esp, 0x128
ret
pop edi
pop ebx
mov eax, 0x7e2
pop esi
add esp, 0x128
ret