Function at 0x801990
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x38
mov eax, dword [0xbcbae0]
mov edi, dword [esp + 0x50]
mov esi, dword [esp + 0x4c]
mov ebx, edx
xor eax, esp
mov dword [esp + 0x34], eax
mov ebp, dword [ecx]
lea ecx, [esp + 0x20]
call fcn.007be3f0
test ebx, ebx
jne 0x8019d7
mov word [esi], 0
mov dword [edi], 0
lea ebx, [ebp + 0x51]
mov dword [esp], 0
xor edi, edi
jmp 0x801f5b
mov edi, dword [ebx]
mov dword [esp + 0xc], ebx
mov ecx, ebp
lea eax, [edi*4]
lea edx, [eax + eax*4]
push 0
call fcn.0077efb0
add esp, 4
mov dword [esp], eax
mov eax, dword [esp + 0x4c]
cmp edi, 0x7fff
jl 0x801a1d
mov word [eax], 0x7fff
mov eax, dword [esp + 0x50]
mov ecx, dword [esp]
mov dword [esp + 8], 0x7fff
mov dword [eax], ecx
lea eax, [ebp + 0x51]
jmp 0x801a38
mov word [eax], di
mov eax, dword [esp + 0x50]
mov ecx, dword [esp]
test edi, edi
mov dword [eax], ecx
lea eax, [ebp + 0x51]
jle 0x801fb6
mov dword [esp + 8], edi
mov esi, dword [esp]
mov ecx, dword [esp + 0xc]
mov ebx, fcn.0079a320
xor edi, edi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ebp
not ebx
and ebx, 1
mov dword [esp + 4], ebx
cmp byte [eax], 0
jne 0x801f59
lea eax, [edi + edi*4]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
mov edi, dword [ecx + eax*4 + 8]
test edi, edi
je 0x801a7a
test byte [ecx + eax*4 + 0x10], 3
je 0x801ad1
mov ecx, dword [ecx + eax*4 + 4]
call fcn.007f16f0
movzx ecx, byte [eax]
cmp cl, 0x8b
je 0x801a9a
cmp cl, 0xa4
je 0x801a9f
cmp cl, 0x3b
jne 0x801ac9
add eax, 8
jmp 0x801ac7
mov eax, dword [eax + 0x10]
jmp 0x801a83
movzx edx, word [eax + 0x20]
mov ecx, dword [eax + 0x2c]
test dx, dx
jns 0x801abb
movzx edx, word [ecx + 0x28]
test dx, dx
jns 0x801abb
mov edi, 0xbb114c
jmp 0x801ad1
movsx eax, dx
lea eax, [eax + eax*4]
shl eax, 2
add eax, dword [ecx + 4]
mov edi, dword [eax]
test edi, edi
je 0x801c11
mov ecx, ebx
xor eax, eax
movzx edx, byte [0xbb1157]
add ecx, fcn.0079a320
sete al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2]
bt edx, eax
jb 0x801bf8
mov al, byte [0xbb1157]
mov edx, ebx
xor ecx, ecx
add edx, fcn.0079a320
sete cl
mov edx, ecx
xor edx, 5
lea ecx, [edx + ecx*2]
mov dl, 1
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbb1157], dl
jne 0x801afb
mov edx, ebx
xor ecx, ecx
movzx eax, al
add edx, fcn.0079a320
sete cl
mov edx, ecx
xor edx, 5
lea ecx, [edx + ecx*2]
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x801b6c
mov ecx, ebx
xor eax, eax
movzx edx, byte [0xbb1157]
add ecx, fcn.0079a320
sete al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2]
bt edx, eax
jae 0x801b46
jmp 0x801bf8
mov ecx, ebx
xor eax, eax
movzx edx, byte [0xbb1157]
add ecx, fcn.0079a320
sete al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2]
bt edx, eax
jb 0x801bd6
mov ecx, ebx
xor eax, eax
mov esi, dword [0xbb114c]
add ecx, fcn.0079a320
sete al
mov ecx, eax
xor ecx, 0xaed6f37d
lea ecx, [ecx + eax*2 + 0x900]
mov edx, ecx
xor esi, ecx
shr edx, 0x1f
mov dword [0xbb114c], esi
not esi
or edx, ecx
and cl, 7
imul edx, esi
xor dword [0xbb1150], edx
mov dl, 1
shl dl, cl
or byte [0xbb1157], dl
mov ecx, ebx
xor eax, eax
add ecx, fcn.0079a320
sete al
mov ecx, eax
xor ecx, 5
lea ecx, [ecx + eax*2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbb1157], al
mov ecx, edi
call fcn.00801fc0
test eax, eax
jne 0x801c11
mov ecx, ebp
mov edx, edi
call fcn.0077edc0
jmp 0x801d7c
mov edi, fcn.007b2c50
mov edx, fcn.007b2c50
xor eax, eax
movzx esi, byte [str.j_Iq]
or edi, 2
xor edx, 2
mov ecx, edi
add ecx, edx
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt esi, eax
jb 0x801d68
mov al, byte [str.j_Iq]
mov ebx, edi
xor ecx, ecx
mov ah, 1
add ebx, edx
sete cl
mov ebx, ecx
xor ebx, 1
lea ecx, [ecx + ebx*2 + 6]
and cl, 7
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [str.j_Iq], ah
jne 0x801c4d
mov ebx, edi
xor ecx, ecx
movzx eax, al
add ebx, edx
sete cl
mov ebx, ecx
xor ebx, 1
lea ecx, [ecx + ebx*2 + 6]
mov ebx, dword [esp + 4]
and cl, 7
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x801cc4
mov ecx, edi
xor eax, eax
movzx esi, byte [str.j_Iq]
add ecx, edx
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt esi, eax
jae 0x801c9c
jmp 0x801d68
mov ecx, edi
xor eax, eax
movzx esi, byte [str.j_Iq]
add ecx, edx
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt esi, eax
jb 0x801d48
mov ecx, edi
xor eax, eax
add ecx, edx
sete al
mov ecx, eax
not ecx
and ecx, 0x89
lea ecx, [eax + ecx*2 + 0x2ef86a76]
mov eax, dword [0xbb1158]
mov esi, ecx
xor eax, ecx
mov dword [0xbb1158], eax
not eax
mov ebx, dword [0xbb115c]
imul eax, ecx
lea ecx, [eax + eax]
xor ebx, eax
shr eax, 0x1e
mov dword [0xbb115c], ebx
or ecx, eax
not ebx
mov al, 1
imul ebx, ecx
mov ecx, esi
and cl, 7
xor dword [0xbb1160], ebx
mov ebx, dword [esp + 4]
shl al, cl
or byte [str.j_Iq], al
xor eax, eax
add edi, edx
sete al
mov ecx, eax
xor ecx, 1
lea ecx, [eax + ecx*2 + 6]
mov al, 0xfe
and cl, 7
xor cl, 7
rol al, cl
and byte [str.j_Iq], al
mov eax, dword [esp + 0x14]
inc eax
push eax
push 0xbb1158
push ebp
call fcn.00782620
add esp, 0xc
mov edi, eax
mov dword [esp + 0x30], 0
test edi, edi
je 0x801f35
lea ecx, [esp + 0x20]
mov edx, edi
call fcn.007bf720
test eax, eax
je 0x801f13
mov ecx, edi
call fcn.00777870
mov edx, eax
test eax, eax
jle 0x801dc6
movzx ecx, byte [edi + eax - 1]
dec eax
test eax, eax
jle 0x801dc0
lea ebx, [ecx - 0x30]
cmp ebx, 0xa
jb 0x801dae
cmp cl, 0x3a
cmove edx, eax
mov ebx, fcn.007c8850
mov eax, fcn.007c8850
movzx ecx, byte [0xbb1177]
and ebx, 1
xor ebx, eax
cmp ebx, 0xffffffff
sete al
not al
and al, 7
movzx eax, al
bt ecx, eax
jb 0x801ed4
mov al, byte [0xbb1177]
cmp ebx, 0xffffffff
mov ah, 1
sete cl
not cl
and cl, 7
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb1177], ah
jne 0x801df7
cmp ebx, 0xffffffff
movzx eax, al
sete cl
not cl
and cl, 7
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x801e4c
cmp ebx, 0xffffffff
movzx ecx, byte [0xbb1177]
sete al
not al
and al, 7
movzx eax, al
bt ecx, eax
jae 0x801e2e
jmp 0x801ed4
cmp ebx, 0xffffffff
movzx ecx, byte [0xbb1177]
sete al
not al
and al, 7
movzx eax, al
bt ecx, eax
jb 0x801ebc
xor ecx, ecx
cmp ebx, 0xffffffff
mov esi, dword [0xbb1168]
sete cl
xor ecx, 0xb63024f
lea eax, [ecx + 0x900]
and cl, 7
xor esi, eax
mov dword [0xbb1168], esi
not esi
imul esi, eax
mov eax, dword [0xbb116c]
lea ebp, [esi + esi]
xor eax, esi
shr esi, 0x1e
mov dword [0xbb116c], eax
or ebp, esi
not eax
imul eax, ebp
mov ebp, dword [esp + 0x18]
xor dword [0xbb1170], eax
mov ah, 1
shl ah, cl
or byte [0xbb1177], ah
cmp ebx, 0xffffffff
mov al, 0xfe
sete cl
not cl
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbb1177], al
mov eax, dword [esp + 0x30]
inc eax
mov dword [esp + 0x30], eax
push eax
push edi
push edx
push 0xbb1168
push ebp
call fcn.00782620
add esp, 0x14
cmp dword [esp + 0x30], 4
mov ebx, dword [esp + 4]
mov edi, eax
jb 0x801d86
lea eax, [esp + 0x30]
push eax
push 4
call fcn.00777c70
add esp, 8
jmp 0x801d86
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x20]
mov edx, edi
mov dword [esi], edi
push esi
call fcn.007bfe40
add esp, 4
cmp eax, esi
jne 0x801f3f
mov ecx, ebp
call fcn.0077e7a0
jmp 0x801f3f
mov esi, dword [esp + 0x10]
mov dword [esi], 0
mov edi, dword [esp + 0x14]
add esi, 0x14
mov ecx, dword [esp + 0xc]
mov eax, dword [esp + 0x1c]
inc edi
cmp edi, dword [esp + 8]
jl 0x801a57
mov ebx, eax
lea ecx, [esp + 0x20]
call fcn.007be410
cmp byte [ebx], 0
je 0x801fa3
test edi, edi
je 0x801f86
mov ebx, edi
xor edi, edi
mov ecx, dword [esp]
lea eax, [edi + edi*4]
mov edx, dword [ecx + eax*4]
mov ecx, ebp
call fcn.00774f10
inc edi
cmp edi, ebx
jne 0x801f71
mov edx, dword [esp]
mov ecx, ebp
call fcn.00774f10
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x4c]
mov dword [eax], 0
mov word [ecx], 0
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.00980459
add esp, 0x38
pop esi
pop edi
pop ebx
pop ebp
ret
xor edi, edi
jmp 0x801f59