Function at 0x7890a0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 8
test edx, edx
je 0x789101
mov ebp, dword [esp + 0x30]
cmp dword [esp + 0x28], 0
mov edi, edx
mov ebx, ecx
je 0x7890be
test ebp, ebp
jne 0x789101
mov esi, dword [esp + 0x2c]
test ebp, ebp
sete al
test esi, esi
sete cl
xor cl, al
jne 0x789101
cmp dword [esp + 0x34], 0
mov edx, dword [esp + 0x1c]
sete al
cmp dword [esp + 0x38], 0
lea edx, [edx + 1]
sete cl
cmp edx, 0x80
ja 0x789101
xor al, cl
jne 0x789101
mov ecx, edi
call fcn.00777870
cmp eax, 0x100
jl 0x789115
mov ecx, 0x73d
call fcn.00774740
mov eax, 0x15
jmp 0x7893ea
mov dword [esp], ebx
mov ebx, dword [esp + 0x20]
mov eax, ebx
and ebx, 7
and eax, 0x380800
cmp ebx, 4
mov dword [esp + 4], eax
jne 0x78913a
mov ebx, 2
mov eax, dword [esp + 0x1c]
jmp 0x7891b4
cmp ebx, 5
jne 0x789134
mov ebx, dword [esp + 0x3c]
mov ecx, dword [esp]
or eax, 1
mov edx, edi
push ebx
mov ebx, dword [esp + 0x3c]
push ebx
mov ebx, dword [esp + 0x3c]
push ebx
push ebp
push esi
push dword [esp + 0x3c]
mov ebx, dword [esp + 0x3c]
push ebx
push eax
mov eax, dword [esp + 0x3c]
mov ebx, eax
push eax
call fcn.007890a0
add esp, 0x24
test eax, eax
jne 0x7893ea
mov eax, dword [esp + 4]
mov ecx, dword [esp]
mov edx, edi
or eax, 2
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push ebp
push esi
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push eax
push ebx
call fcn.007890a0
add esp, 0x24
test eax, eax
jne 0x7893ea
mov eax, ebx
mov ebx, 3
mov ecx, dword [esp]
mov edx, edi
push 0
push ebx
push eax
call fcn.00789480
add esp, 0xc
test eax, eax
je 0x789370
mov ecx, dword [eax + 4]
and ecx, 3
cmp ecx, ebx
jne 0x789370
movsx eax, byte [eax]
cmp eax, dword [esp + 0x1c]
jne 0x789370
mov ecx, dword [esp]
cmp dword [ecx + 0xb0], 0
je 0x789369
mov eax, fcn.007b5140
mov edx, 3
mov esi, ecx
movzx ecx, byte [0xbb6583]
sub edx, eax
mov eax, edx
xor eax, fcn.007b5140
sete al
or al, 4
add al, 0x44
and al, 7
movzx eax, al
bt ecx, eax
jb 0x78934f
mov al, byte [0xbb6583]
mov ecx, edx
mov ah, 1
xor ecx, fcn.007b5140
sete cl
or cl, 4
add cl, 0x44
and cl, 7
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb6583], ah
jne 0x78922e
mov edx, fcn.007b5140
mov ecx, 3
movzx eax, al
sub ecx, edx
mov edx, ecx
xor edx, fcn.007b5140
sete dl
or dl, 4
add dl, 0x44
and dl, 7
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x7892a7
mov eax, ecx
movzx edx, byte [0xbb6583]
xor eax, fcn.007b5140
sete al
or al, 4
add al, 0x44
and al, 7
movzx eax, al
bt edx, eax
jae 0x789283
jmp 0x78934f
xor edx, edx
xor ecx, fcn.007b5140
movzx ecx, byte [0xbb6583]
sete dl
or edx, 0x1064001c
add edx, 0x1344
mov eax, edx
and al, 7
movzx eax, al
bt ecx, eax
jb 0x789324
mov esi, 0xbb6540
xor eax, eax
mov edi, dword [esi]
mov ecx, eax
mov ebx, edx
inc eax
shl ebx, cl
xor cl, 0x1f
xor edi, edx
shr edx, cl
mov dword [esi], edi
or edx, ebx
not edi
add esi, 4
imul edx, edi
cmp eax, 0x10
jne 0x7892d8
mov eax, fcn.007b5140
mov ecx, 3
sub ecx, eax
mov al, 1
xor ecx, fcn.007b5140
sete cl
or cl, 4
add cl, 0x44
and cl, 7
shl al, cl
or byte [0xbb6583], al
mov esi, dword [esp]
mov eax, fcn.007b5140
mov ecx, 3
sub ecx, eax
mov al, 0xfe
xor ecx, fcn.007b5140
sete cl
or cl, 4
add cl, 0x44
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbb6583], al
push 0xbb6540
push 5
push esi
call fcn.0077b710
add esp, 0xc
mov eax, 5
jmp 0x7893ea
xor edx, edx
call fcn.00783b20
movzx eax, bl
mov ebx, dword [esp]
mov edx, edi
mov ecx, ebx
push 1
push eax
push dword [esp + 0x24]
call fcn.00789480
add esp, 0xc
test eax, eax
jne 0x789394
mov eax, 7
jmp 0x7893ea
mov ecx, ebx
mov edx, eax
mov edi, eax
call fcn.0083b0a0
mov ecx, dword [esp + 0x3c]
test ecx, ecx
je 0x7893a9
inc dword [ecx]
mov eax, dword [edi + 4]
mov dword [edi + 0x24], ecx
and eax, 3
or eax, dword [esp + 4]
xor eax, 0x200000
mov dword [edi + 4], eax
mov eax, dword [esp + 0x28]
test eax, eax
cmovne esi, eax
mov eax, dword [esp + 0x34]
mov dword [edi + 0x10], esi
mov dword [edi + 0x14], ebp
mov dword [edi + 0x18], eax
mov eax, dword [esp + 0x38]
mov dword [edi + 0x1c], eax
mov eax, dword [esp + 0x24]
mov dword [edi + 8], eax
mov eax, dword [esp + 0x1c]
mov byte [edi], al
xor eax, eax
add esp, 8
pop esi
pop edi
pop ebx
pop ebp
ret