Function at 0x499720
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
mov ebx, edx
mov esi, ecx
mov edi, dword [esp + 0x38]
mov edx, dword [esp + 0x34]
mov ebp, dword [esp + 0x30]
test ebx, ebx
je 0x499774
test edx, edx
js 0x499747
movsx eax, word [ebx + 0x20]
cmp eax, edx
jne 0x4997c4
mov eax, dword [esi + 0x6c]
cmp dword [esi + 0x70], eax
jle 0x4997ac
lea ecx, [eax + 1]
mov dword [esi + 0x6c], ecx
mov ecx, dword [esi + 0x68]
lea eax, [eax + eax*4]
mov dword [ecx + eax*4], 0x87
mov dword [ecx + eax*4 + 4], ebp
mov dword [ecx + eax*4 + 8], edi
mov dword [ecx + eax*4 + 0xc], 0
jmp 0x49979f
mov eax, dword [esi + 0x6c]
cmp dword [esi + 0x70], eax
jle 0x4999d6
lea ecx, [eax + 1]
mov dword [esi + 0x6c], ecx
mov ecx, dword [esi + 0x68]
lea eax, [eax + eax*4]
mov dword [ecx + eax*4], 0x5e
mov dword [ecx + eax*4 + 4], ebp
mov dword [ecx + eax*4 + 8], edx
mov dword [ecx + eax*4 + 0xc], edi
mov dword [ecx + eax*4 + 0x10], 0
add esp, 0x1c
jmp 0x4997bf
mov ecx, esi
mov edx, 0x87
push 0
push edi
push ebp
call fcn.004747e0
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [esp + 0xc], edi
mov eax, edx
mov edi, 0xaf
cmp byte [ebx + 0x2b], 1
mov dword [esp + 8], edx
je 0x499af3
mov edx, ebx
mov ebx, dword [ebx + 4]
mov eax, dword [esp + 8]
lea ecx, [eax + eax*2]
movzx eax, word [ebx + ecx*4 + 0xa]
test al, 0x20
jne 0x4999e9
mov dword [esp + 4], ebx
mov eax, dword [edx + 0x1c]
test al, 0x80
mov ebx, edx
jne 0x499a30
mov edi, dword [esp + 8]
test di, di
js 0x499a6e
and eax, 0x20
je 0x499a6e
movsx eax, di
mov dword [esp + 0x10], eax
test di, di
mov dword [esp], ebp
je 0x499aca
mov dword [esp + 0x14], 0
mov eax, edi
shl eax, 0x10
mov ecx, 0
cmp eax, 0x110000
mov ebp, dword [esp + 4]
jb 0x4999a2
mov eax, edi
and eax, 0xf
mov ecx, 0x10
cmovne ecx, eax
mov eax, dword [esp + 0x10]
sub eax, ecx
lea edx, [ebp + 0xbe]
pxor xmm0, xmm0
movdqa xmm3, xmmword [0x528790]
mov dword [esp + 0x14], eax
mov ecx, eax
pxor xmm1, xmm1
movzx eax, word [edx - 0x60]
movd xmm4, eax
movzx eax, word [edx - 0x6c]
movd xmm6, eax
punpcklwd xmm6, xmm4
movzx eax, word [edx - 0x78]
movd xmm4, eax
movzx eax, word [edx - 0x84]
movd xmm5, eax
punpcklwd xmm5, xmm4
punpckldq xmm5, xmm6
movzx eax, word [edx - 0x90]
movd xmm4, eax
movzx eax, word [edx - 0x9c]
movd xmm6, eax
punpcklwd xmm6, xmm4
movzx eax, word [edx - 0xa8]
movd xmm7, eax
movzx eax, word [edx - 0xb4]
movd xmm4, eax
punpcklwd xmm4, xmm7
punpckldq xmm4, xmm6
punpcklqdq xmm4, xmm5
movzx eax, word [edx]
movd xmm5, eax
movzx eax, word [edx - 0xc]
movd xmm7, eax
punpcklwd xmm7, xmm5
movzx eax, word [edx - 0x18]
movd xmm5, eax
movzx eax, word [edx - 0x24]
movd xmm6, eax
punpcklwd xmm6, xmm5
punpckldq xmm6, xmm7
movzx eax, word [edx - 0x30]
movd xmm5, eax
movzx eax, word [edx - 0x3c]
movd xmm7, eax
punpcklwd xmm7, xmm5
movzx eax, word [edx - 0x48]
movd xmm2, eax
movzx eax, word [edx - 0x54]
movd xmm5, eax
punpcklwd xmm5, xmm2
punpckldq xmm5, xmm7
punpcklqdq xmm5, xmm6
pcmpeqd xmm2, xmm2
pxor xmm4, xmm2
psrlw xmm4, 5
pand xmm4, xmm3
paddw xmm0, xmm4
pxor xmm5, xmm2
psrlw xmm5, 5
pand xmm5, xmm3
paddw xmm1, xmm5
add edx, 0xc0
add ecx, 0xfffffff0
jne 0x499880
paddw xmm1, xmm0
pshufd xmm0, xmm1, 0xee
paddw xmm0, xmm1
pshufd xmm1, xmm0, 0x55
paddw xmm1, xmm0
movdqa xmm0, xmm1
psrld xmm0, 0x10
paddw xmm0, xmm1
movd ecx, xmm0
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
sub edx, eax
lea eax, [eax + eax*2]
lea eax, [eax*4 + 0xa]
add eax, ebp
nop dword [eax + eax]
movzx ebp, word [eax]
bt ebp, 5
sbb cx, 0xffff
add eax, 0xc
dec edx
jne 0x4999c0
jmp 0x499acc
mov ecx, esi
mov edx, 0x5e
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
jmp fcn.004747e0
lea edi, [ebx + ecx*4]
mov dword [esp + 8], edi
mov esi, dword [esi + 0xc]
test eax, 0x100
jne 0x499a58
lea edi, [ebx + ecx*4]
add edi, 0xa
mov ebx, dword [esi + 0x34]
or eax, 0x100
mov word [edi], ax
inc ebp
mov dword [esi + 0x34], ebp
mov ecx, esi
push dword [esp + 0xc]
push dword [esp + 0xc]
call fcn.00496790
add esp, 8
mov dword [esi + 0x34], ebx
and byte [edi + 1], 0xfe
add esp, 0x1c
jmp 0x4997bf
mov eax, dword [ebx + 8]
xor ecx, ecx
test eax, eax
mov dword [esp], ebp
je 0x499a74
nop dword [eax]
movzx ecx, word [eax + 0x37]
and ecx, 3
cmp cx, 2
je 0x499a72
mov eax, dword [eax + 0x14]
test eax, eax
jne 0x499a40
xor ecx, ecx
jmp 0x499a74
mov eax, dword [esp + 8]
push dword [eax]
push 0x53162a
push esi
call fcn.00434540
jmp 0x4997bc
mov ecx, edi
jmp 0x499aeb
mov ecx, eax
movzx edx, word [ecx + 0x34]
mov eax, 0xffffffff
mov edi, 0x5e
test edx, edx
je 0x499abb
mov eax, dword [ecx + 4]
xor ebp, ebp
xor ecx, ecx
mov edi, dword [esp + 8]
nop word cs:[eax + eax]
cmp word [eax + ecx*2], di
je 0x499ac0
inc ecx
add ebp, 0x10000
cmp edx, ecx
jne 0x499aa0
mov ebp, dword [esp]
mov eax, 0xffffffff
jmp 0x499aee
mov ebp, dword [esp]
jmp 0x499af3
sar ebp, 0x10
mov eax, ebp
mov ebp, dword [esp]
jmp 0x499aee
xor ecx, ecx
mov eax, dword [esp + 0x10]
lea eax, [eax + eax*2]
mov edx, dword [esp + 4]
test byte [edx + eax*4 + 0xa], 0x20
je 0x499ae8
mov eax, edi
sub eax, ecx
add ax, word [ebx + 0x24]
mov ecx, eax
mov ebp, dword [esp]
movsx eax, cx
mov edi, 0x5e
mov dword [esp + 4], eax
mov eax, dword [esi + 0x6c]
cmp dword [esi + 0x70], eax
jle 0x499b3e
lea ecx, [eax + 1]
mov dword [esi + 0x6c], ecx
mov ecx, dword [esi + 0x68]
lea eax, [eax + eax*4]
mov edx, ebx
mov ebx, edi
mov byte [ecx + eax*4], bl
mov ebx, edx
mov word [ecx + eax*4 + 2], 0
mov dword [ecx + eax*4 + 4], ebp
mov edx, dword [esp + 4]
mov dword [ecx + eax*4 + 8], edx
mov edx, dword [esp + 0xc]
mov dword [ecx + eax*4 + 0xc], edx
mov dword [ecx + eax*4 + 0x10], 0
mov byte [ecx + eax*4 + 1], 0
jmp 0x499b53
mov ecx, esi
mov edx, edi
push dword [esp + 0xc]
push dword [esp + 8]
push ebp
call fcn.004747e0
add esp, 0xc
movzx edx, byte [ebx + 0x2b]
cmp dl, 2
mov edi, dword [esp + 8]
jne 0x499baf
mov eax, dword [ebx + 4]
lea ecx, [edi + edi*2]
cmp byte [eax + ecx*4 + 5], 0x45
jne 0x4997a7
cmp byte [ebx + 0x2b], 1
je 0x4997a7
mov eax, dword [esi + 0x6c]
cmp dword [esi + 0x70], eax
jle 0x499c38
lea ecx, [eax + 1]
mov dword [esi + 0x6c], ecx
mov ecx, dword [esi + 0x68]
lea eax, [eax + eax*4]
mov dword [ecx + eax*4], 0x57
mov edx, dword [esp + 0xc]
mov dword [ecx + eax*4 + 4], edx
mov dword [ecx + eax*4 + 8], 0
jmp 0x49976a
mov dword [esp + 0x18], 0
mov eax, dword [ebx + 4]
lea ebp, [edi + edi*2]
movzx ecx, word [eax + ebp*4 + 8]
test ecx, ecx
je 0x499b60
test dl, dl
jne 0x499b60
mov edx, dword [ebx + 0x34]
test edx, edx
je 0x499b60
cmp dword [edx], ecx
jl 0x499b60
shl ecx, 4
mov edx, dword [ecx + edx - 8]
test edx, edx
je 0x499b60
mov ecx, dword [esi]
mov dword [esp], eax
movzx eax, byte [ecx + 0x54]
mov byte [esp + 4], al
mov eax, dword [esp]
movzx eax, byte [eax + ebp*4 + 5]
mov dword [esp], eax
movzx eax, byte [esp + 4]
lea ebp, [esp + 0x18]
push ebp
push dword [esp + 4]
push eax
call fcn.00476670
add esp, 0xc
mov ebp, dword [esp + 0x18]
test ebp, ebp
je 0x499b60
mov ecx, dword [esi]
cmp byte [ecx + 0x57], 0
je 0x499c4c
cmp dword [ecx + 0x210], 0
je 0x499c63
mov edx, ebp
call fcn.00453890
jmp 0x499b60
mov ecx, esi
mov edx, 0x57
push 0
push 0
push dword [esp + 0x14]
jmp 0x4997b7
mov eax, dword [esi + 0x68]
mov ecx, dword [esi + 0x6c]
lea ecx, [ecx + ecx*4]
mov byte [eax + ecx*4 - 0x13], 0xf6
mov dword [eax + ecx*4 - 4], ebp
jmp 0x499b60
test byte [ebp + 0x11], 0x90
jne 0x499c6f
cmp dword [ebp + 0x18], 0
je 0x499c76
mov ecx, ebp
call fcn.00455c20
mov ecx, dword [ebp + 0x14]
mov edx, ebp
call fcn.0043f4f0
jmp 0x499b60