Function at 0x807840
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x30
mov eax, dword [0xbcbae0]
xor esi, esi
xor eax, esp
mov dword [esp + 0x2c], eax
cmp dword [edx + 0x44], 0
je 0x807cf7
cmp dword [edx + 0x34], 0
mov ebx, edx
jne 0x807cf7
test byte [ebx + 6], 0x10
jne 0x807cf7
mov ebp, ecx
call fcn.007ebd10
mov dword [esp + 0x24], eax
mov eax, dword [ebx + 0x20]
mov ecx, dword [ebp]
mov edx, 0x50
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x24]
mov edi, ecx
mov dword [esp + 0x20], eax
mov eax, dword [ebx + 0x28]
mov dword [esp + 0x1c], eax
mov eax, dword [ebx + 0x2c]
mov dword [esp + 0x28], 0
mov esi, dword [ebx + 0x44]
mov dword [esp + 0x18], eax
push 0
call fcn.0077efb0
add esp, 4
test eax, eax
je 0x807c8c
mov dword [esp + 4], eax
lea eax, [ebx + 0x20]
mov dword [esp + 8], edi
mov ecx, ebp
xor edx, edx
mov dword [eax + 0xc], 0
mov dword [eax + 8], 0
mov dword [eax + 4], 0
mov dword [esp + 0x14], eax
mov dword [eax], 0
mov eax, 0xffeffff7
and eax, dword [ebx + 4]
or eax, 0x100000
mov dword [ebx + 4], eax
push 1
push dword [esi + 8]
call fcn.0080e070
add esp, 8
mov ecx, ebp
mov edx, eax
push 1
mov edi, esi
push dword [esi + 0xc]
call fcn.0080e070
add esp, 8
test eax, eax
mov dword [esp], ebx
je 0x80796f
mov ecx, dword [ebx + 0x30]
test ecx, ecx
je 0x80796f
mov ecx, dword [ecx]
mov esi, dword [eax]
cmp ecx, esi
jg 0x80796f
mov dword [eax], ecx
mov ecx, eax
mov edx, dword [ebx + 0x30]
mov ebx, eax
push 0xffffffffffffffff
call fcn.007f2030
add esp, 4
test eax, eax
jne 0x807966
mov eax, dword [esp]
mov ecx, dword [esp + 8]
mov edx, dword [eax + 0x30]
call fcn.007c00f0
mov eax, dword [esp]
mov dword [eax + 0x30], 0
mov ecx, dword [esp]
mov dword [ebx], esi
mov eax, ebx
mov ebx, ecx
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x28]
mov edx, edi
mov esi, edi
lea ecx, [eax + 1]
mov dword [ebp + 0x28], ecx
mov dword [edi + 0x30], eax
add dword [ebp + 0x28], 3
lea eax, [esp + 0x28]
mov ecx, ebp
push eax
push dword [esp + 8]
push dword [ebx + 0x1c]
mov ebx, dword [esp + 0x18]
push ebx
call fcn.0080e140
add esp, 0x10
mov edx, edi
lea eax, [esp + 0x28]
mov ecx, ebp
push eax
push dword [esp + 8]
mov eax, dword [esp + 8]
push dword [eax + 0x30]
push ebx
call fcn.0080e140
add esp, 0x10
mov edx, dword [esp + 0x28]
mov eax, 0
test edx, edx
je 0x8079ce
mov eax, dword [edx]
mov esi, edi
mov dword [edi + 0x4c], eax
mov ecx, ebp
push 0
push dword [edi + 8]
call fcn.0080e070
add esp, 8
mov edx, eax
mov ecx, ebp
push 0
push dword [edi + 0xc]
call fcn.0080e070
mov edx, edi
add esp, 8
mov ebx, eax
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x48]
mov ecx, dword [esi + 0x2c]
mov eax, dword [eax + 0x14]
test byte [ecx + 6], 0x10
je 0x807a39
lea ebx, [esp + 0x28]
mov ecx, ebp
push ebx
push dword [esp + 8]
push eax
push dword [esp + 0x18]
call fcn.0080e140
add esp, 0x10
mov ebx, dword [esp + 0x28]
test ebx, ebx
jne 0x807a2e
xor eax, eax
jmp 0x807a30
mov eax, dword [ebx]
mov dword [esi + 0x50], eax
mov byte [esi + 0x60], 1
jmp 0x807a5b
test ebx, ebx
jne 0x807a41
xor ecx, ecx
jmp 0x807a43
mov ecx, dword [ebx]
mov dword [esi + 0x50], ecx
mov ecx, ebp
mov edx, ebx
push 0
push eax
call fcn.0080e070
add esp, 8
mov ebx, eax
mov dword [esp + 0x28], eax
mov edx, dword [esi + 0x28]
test edx, edx
je 0x807a83
mov ecx, dword [esp + 8]
push 0
call fcn.007f0780
add esp, 4
mov ecx, ebp
mov edx, ebx
push eax
call fcn.007d8ad0
add esp, 4
mov ebx, eax
mov dword [esp + 0x28], eax
mov eax, dword [ebp + 0x2c]
mov ecx, dword [esp + 0x24]
mov edx, 0x48
inc eax
mov dword [ebp + 0x2c], eax
mov dword [esi + 0x34], eax
mov eax, dword [ebp + 0x2c]
inc eax
mov dword [ebp + 0x2c], eax
mov dword [esi + 0x38], eax
push dword [esi + 0x34]
push 0
call fcn.007c57e0
add esp, 8
mov esi, dword [esi + 0x24]
mov edx, edi
test esi, esi
jne 0x8079fb
mov esi, dword [esp + 0x20]
test ebx, ebx
jne 0x807c01
mov edx, fcn.0081fa20
xor eax, eax
movzx edi, byte [0xbb209b]
imul edx, edx
and edx, 3
cmp edx, 1
seta al
mov ecx, eax
xor ecx, 3
lea eax, [ecx + eax*2]
bt edi, eax
jb 0x807bd8
mov al, byte [0xbb209b]
xor ecx, ecx
cmp edx, 1
mov ah, 1
seta cl
mov ebx, ecx
xor ebx, 3
lea ecx, [ebx + ecx*2]
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb209b], ah
jne 0x807af6
mov ecx, fcn.0081fa20
xor edx, edx
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 1
seta dl
mov ebx, edx
xor ebx, 3
lea edx, [ebx + edx*2]
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x807b60
xor eax, eax
cmp ecx, 1
movzx edi, byte [0xbb209b]
seta al
mov edx, eax
xor edx, 3
lea eax, [edx + eax*2]
bt edi, eax
jae 0x807b42
jmp 0x807bd8
xor eax, eax
cmp ecx, 1
movzx edx, byte [0xbb209b]
seta al
mov ecx, eax
xor ecx, 3
lea eax, [ecx + eax*2]
bt edx, eax
jb 0x807bb0
mov eax, fcn.0081fa20
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 1
seta cl
mov eax, ecx
xor eax, 0xdb8c24eb
lea ecx, [eax + ecx*2 + 0x220]
mov al, 1
xor dword [str._9], ecx
and cl, 7
shl al, cl
or byte [0xbb209b], al
mov eax, fcn.0081fa20
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 1
seta cl
mov eax, ecx
xor eax, 3
lea ecx, [eax + ecx*2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbb209b], al
mov ecx, dword [esp + 8]
mov edx, 0x98
push str._9
call fcn.007d8c20
add esp, 4
mov ecx, ebp
xor edx, edx
push eax
call fcn.007d8ad0
add esp, 4
mov ebx, eax
mov dword [esp + 0x28], eax
mov ecx, ebp
mov edx, ebx
push 0
push 0
push dword [esp + 0x18]
push dword [esp + 0x24]
push dword [esp + 0x2c]
push esi
push dword [esp + 0x24]
call fcn.007d8990
add esp, 0x1c
mov esi, eax
xor edi, edi
mov ecx, ebp
xor edx, edx
push 0
push 0
call fcn.007d8e50
add esp, 8
mov ebx, dword [esp + 0x14]
test eax, eax
mov dword [ebx], eax
je 0x807c74
mov dword [eax + 0x1c], esi
mov ecx, ebp
mov edx, dword [ebx]
call fcn.007ff8d0
or byte [esi + 4], 0x40
mov ecx, ebp
mov edx, esi
push 0x40
call fcn.007f6070
add esp, 4
test eax, eax
jne 0x807c9f
mov ebx, dword [esp]
mov ecx, dword [esp + 8]
mov edx, dword [esp + 4]
mov edi, 7
jmp 0x807cc2
mov ebx, dword [esp + 8]
mov edx, esi
mov ecx, ebx
call fcn.007c0190
mov ecx, ebx
mov ebx, dword [esp]
mov edx, dword [esp + 4]
jmp 0x807cc2
mov ecx, edi
mov edx, 7
mov esi, 7
call fcn.0078dc50
jmp 0x807cf7
mov edx, dword [esp + 4]
mov ecx, 0x14
mov esi, eax
mov edi, edx
rep movsd dword es:[edi], dword [esi]
or byte [edx + 0x24], 2
mov ecx, dword [ebx]
mov ebx, dword [esp]
xor edi, edi
mov dword [ecx + 0x18], edx
mov ecx, dword [esp + 8]
mov edx, eax
cmp byte [ecx + 0x51], 0
mov esi, 7
cmove esi, edi
call fcn.00774f10
test esi, esi
jne 0x807cdb
xor esi, esi
jmp 0x807cf7
cmp dword [ebp + 0x24], 0
jne 0x807cee
mov ecx, dword [ebp]
mov edx, 7
call fcn.0078dc50
mov ecx, ebp
mov edx, ebx
call fcn.0080e1e0
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00980459
mov eax, esi
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret