Function at 0x49d987
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
push esi
mov esi, dword [esp + 0x34]
push esi
call fcn.0048c2d7
add esp, 4
test eax, eax
jne 0x49dbfa
mov eax, dword [esp + 0x30]
push eax
call fcn.0049dc47
add esp, 4
test eax, eax
jne 0x49dbfa
mov eax, dword [esp + 0x28]
imul esi, esi, 0x64
mov esi, dword [esi + 0x5c83dc]
mov ecx, eax
and cl, 7
neg cl
push ebp
sbb ecx, ecx
shr eax, 3
neg ecx
add ecx, eax
mov ebp, ecx
lea edx, [ebp - 2]
lea eax, [esi + esi]
cmp eax, edx
jae 0x49dc37
mov ecx, dword [esp + 0x20]
mov eax, 0x7fffffff
sub eax, esi
shl eax, 1
mov dword [esp + 0x14], eax
add eax, ebp
cmp ecx, eax
ja 0x49dc37
push ebx
push edi
push ebp
call fcn.0046ab87
push ebp
mov edi, eax
call fcn.0046ab87
mov ebx, eax
push esi
mov dword [esp + 0x24], ebx
call fcn.0046ab87
add esp, 0xc
test edi, edi
mov dword [esp + 0x14], eax
je 0x49dc0c
test ebx, ebx
je 0x49dbff
test eax, eax
je 0x49dbff
mov eax, dword [esp + 0x2c]
test eax, eax
lea ecx, [esp + 0x10]
push ecx
mov dword [esp + 0x14], ebp
push edi
je 0x49da58
mov edx, dword [esp + 0x38]
push edx
push eax
mov eax, dword [esp + 0x50]
push eax
jmp 0x49da60
mov edx, dword [esp + 0x48]
push 0
push edi
push edx
call fcn.004bda07
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x49dbd8
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x1c]
sub eax, edx
add eax, ebp
mov ebx, eax
push ebx
lea eax, [edi + esi]
push 0
push eax
mov dword [esp + 0x1c], esi
call fcn.00482f17
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x30]
add eax, ebx
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x1c], eax
mov byte [eax + edi], 1
mov eax, dword [esp + 0x1c]
inc eax
push ebx
mov dword [esp + 0x20], eax
push ecx
add eax, edi
push eax
call fcn.0048b547
mov eax, dword [esp + 0x28]
add eax, ebx
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x54]
lea edx, [eax + eax*4]
mov eax, dword [esp + 0x50]
push eax
push esi
push ebx
call dword [edx*8 + 0x5d16d4]
add esp, 0x24
cmp eax, esi
je 0x49daed
mov ebx, 0x7d7
jmp 0x49dbd8
mov edx, dword [esp + 0x18]
mov ecx, ebp
sub ecx, esi
lea eax, [ecx - 1]
push eax
push edx
push esi
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x4c]
push ebx
push eax
call fcn.004b6a57
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x49dbd8
mov edx, dword [esp + 0x1c]
test edx, edx
jbe 0x49db34
mov ecx, dword [esp + 0x18]
mov eax, edi
sub ecx, edi
mov bl, byte [ecx + eax]
xor byte [eax], bl
inc eax
dec edx
jne 0x49db27
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
push esi
push ecx
push edx
mov edx, dword [esp + 0x4c]
push edi
push edx
call fcn.004b6a57
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x49dbd8
test esi, esi
jbe 0x49db70
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
sub ecx, eax
mov edx, esi
lea esp, [esp]
mov bl, byte [ecx + eax]
xor byte [eax], bl
inc eax
dec edx
jne 0x49db67
mov eax, dword [esp + 0x48]
cmp dword [eax], ebp
jae 0x49db81
mov dword [eax], ebp
mov ebx, 0x7d4
jmp 0x49dbd8
mov ebx, dword [esp + 0x44]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x10], 0
mov byte [ebx], 0
mov eax, dword [esp + 0x10]
inc eax
push esi
mov dword [esp + 0x14], eax
push ecx
add eax, ebx
push eax
call fcn.0048b547
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x28]
add eax, esi
push edx
mov dword [esp + 0x20], eax
add eax, ebx
push edi
push eax
call fcn.0048b547
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x60]
sub ebp, esi
lea ebp, [eax + ebp - 1]
add esp, 0x18
mov dword [esp + 0x10], ebp
mov dword [ecx], ebp
xor ebx, ebx
mov edx, dword [esp + 0x14]
push edx
call fcn.0046dc87
mov eax, dword [esp + 0x1c]
push eax
call fcn.0046dc87
push edi
call fcn.0046dc87
add esp, 0xc
pop edi
mov eax, ebx
pop ebx
pop ebp
pop esi
add esp, 0x10
ret
push edi
call fcn.0046dc87
mov eax, dword [esp + 0x18]
add esp, 4
test ebx, ebx
je 0x49dc1d
push ebx
call fcn.0046dc87
mov eax, dword [esp + 0x18]
add esp, 4
test eax, eax
je 0x49dc2a
push eax
call fcn.0046dc87
add esp, 4
pop edi
pop ebx
pop ebp
mov eax, 0xc
pop esi
add esp, 0x10
ret
pop ebp
mov eax, 0x7e2
pop esi
add esp, 0x10
ret