Function at 0x978630
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
mov eax, 0x9791b0
mov edx, 3
mov esi, ecx
sub edx, eax
xor eax, eax
mov ecx, edx
xor ecx, 0x9791b0
movzx ecx, byte [0xbd1e67]
setne al
bt ecx, eax
jb 0x978763
mov al, byte [0xbd1e67]
mov ecx, edx
mov ah, 1
xor ecx, 0x9791b0
setne cl
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbd1e67], ah
jne 0x978667
mov edx, 0x9791b0
mov ecx, 3
movzx eax, al
sub ecx, edx
mov edx, ecx
xor edx, 0x9791b0
setne dl
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x9786c8
mov edx, ecx
xor eax, eax
xor edx, 0x9791b0
movzx edx, byte [0xbd1e67]
setne al
bt edx, eax
jae 0x9786aa
jmp 0x978763
xor eax, eax
xor ecx, 0x9791b0
movzx ecx, byte [0xbd1e67]
setne al
bt ecx, eax
jb 0x978741
mov eax, 0x9791b0
mov edx, 3
xor ecx, ecx
sub edx, eax
mov eax, dword [0xbd1e58]
xor edx, 0x9791b0
sete cl
xor ecx, 0x29116571
add ecx, 0x508
xor eax, ecx
mov dword [0xbd1e58], eax
not eax
mov edx, dword [0xbd1e5c]
imul eax, ecx
and cl, 7
lea edi, [eax + eax]
xor edx, eax
shr eax, 0x1e
mov dword [0xbd1e5c], edx
or edi, eax
not edx
mov al, 1
imul edx, edi
shl al, cl
xor dword [0xbd1e60], edx
or byte [0xbd1e67], al
mov eax, 0x9791b0
mov ecx, 3
sub ecx, eax
mov al, 0xfe
xor ecx, 0x9791b0
setne cl
xor cl, 7
rol al, cl
and byte [0xbd1e67], al
xor edi, edi
test esi, esi
mov eax, 0
je 0x978799
mov eax, dword [esi + 4]
cmp eax, 8
jne 0x978836
push 8
push dword [esi + 8]
push 0xbd1e58
call fcn.00988e30
add esp, 0xc
test eax, eax
jne 0x978833
mov eax, 0xb6b6b0
mov ecx, 0x977a50
mov dword [esp + 8], eax
and ecx, 1
inc ecx
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x10]
xor eax, eax
mov esi, dword [edi*4 + 0xb6c494]
mov ebp, dword [edi*4 + 0xb6c4a4]
mov dword [esp + 0x18], edi
mov ebx, 1
xor ecx, 0x977a50
sete al
mov ecx, eax
xor ecx, 0xc5e3be87
lea edx, [ecx + eax*2 + 0x250]
mov eax, 1
xor edx, dword [edi*4 + 0xb6c4b4]
mov ecx, edx
and cl, 7
shl eax, cl
movzx edi, cl
xor cl, 7
shl ebx, cl
movzx ecx, byte [esi + ebp - 1]
bt ecx, edi
jb 0x9788ba
mov dword [esp], eax
mov al, byte [esi + ebp - 1]
mov ecx, eax
or cl, bl
lock cmpxchg byte [esi + ebp - 1], cl
jne 0x97880f
mov ecx, dword [esp]
movzx eax, al
test ebx, eax
je 0x97885f
movzx eax, byte [esi + ebp - 1]
test ecx, eax
je 0x978825
jmp 0x9788ba
mov eax, dword [esi + 4]
cmp eax, 5
jne 0x9788d4
push 5
push dword [esi + 8]
push 0xbd1e88
call fcn.00988e30
add esp, 0xc
test eax, eax
jne 0x9788d4
mov eax, 0xb6b6c4
jmp 0x978799
mov dword [esp + 0xc], ebx
movzx eax, byte [esi + ebp - 1]
test ecx, eax
jne 0x9788b0
lea ecx, [ebp - 4]
shr ecx, 2
je 0x9788a9
xor eax, eax
mov ebx, esi
mov dword [esp + 0x14], ecx
mov edi, dword [ebx]
mov ecx, eax
mov dword [esp + 4], edx
inc eax
shl dword [esp + 4], cl
and cl, 0x1f
xor cl, 0x1f
xor edi, edx
shr edx, cl
mov ecx, dword [esp + 0x14]
or edx, dword [esp + 4]
mov dword [ebx], edi
not edi
add ebx, 4
imul edx, edi
cmp eax, ecx
jne 0x97887c
mov eax, dword [esp]
or byte [esi + ebp - 1], al
mov eax, dword [esp + 0xc]
not al
and byte [esi + ebp - 1], al
mov edi, dword [esp + 0x18]
inc edi
cmp edi, 4
jne 0x9787aa
mov eax, dword [esp + 8]
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
xor eax, eax
jmp 0x978799