Function at 0x791da0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x28
mov dword [esp + 0xc], edx
mov dword [esp + 4], ecx
mov ecx, 0x98b28a
mov edx, 0x98b28a
xor ebx, ebx
mov eax, dword [0xbcbae0]
and ecx, 1
xor ecx, edx
xor eax, esp
mov dword [esp + 0x24], eax
mov dword [esp + 0x10], ecx
xor edx, edx
cmp dword [esp + 0x10], 0xffffffff
mov esi, dword [ebx*4 + 0xb4d370]
mov edi, dword [ebx*4 + 0xb4d4b0]
mov dword [esp + 0x18], ebx
mov eax, 1
sete dl
or edx, 0x9a5a8a64
add edx, 0x230
xor edx, dword [ebx*4 + 0xb4bdd0]
mov ecx, edx
and cl, 7
movzx ebx, cl
shl eax, cl
xor cl, 7
mov dword [esp], ebx
mov ebx, 1
shl ebx, cl
movzx ecx, byte [esi + edi - 1]
mov ebp, dword [esp]
bt ecx, ebp
jb 0x791eb1
mov dword [esp + 8], eax
mov al, byte [esi + edi - 1]
mov ecx, eax
or cl, bl
lock cmpxchg byte [esi + edi - 1], cl
jne 0x791e33
mov ecx, dword [esp + 8]
movzx eax, al
test ebx, eax
je 0x791e55
movzx eax, byte [esi + edi - 1]
test ecx, eax
je 0x791e4a
jmp 0x791eb1
movzx eax, byte [esi + edi - 1]
test ecx, eax
jne 0x791eab
lea ecx, [edi - 4]
shr ecx, 2
je 0x791ea3
xor eax, eax
mov ebp, esi
mov dword [esp + 0x14], ecx
mov ecx, ebp
mov dword [esp + 0x1c], ebp
mov ebp, dword [ebp]
mov dword [esp], edx
xor ebp, edx
mov dword [ecx], ebp
mov ecx, eax
not ebp
inc eax
shl dword [esp], cl
and cl, 0x1f
xor cl, 0x1f
shr edx, cl
mov ecx, dword [esp + 0x14]
or edx, dword [esp]
imul edx, ebp
mov ebp, dword [esp + 0x1c]
add ebp, 4
cmp eax, ecx
jne 0x791e6e
mov eax, dword [esp + 8]
or byte [esi + edi - 1], al
not bl
and byte [esi + edi - 1], bl
mov ebx, dword [esp + 0x18]
inc ebx
cmp ebx, 0x50
jne 0x791dcf
mov eax, dword [esp + 0x3c]
and eax, 0x7fffffff
mov dword [esp + 0x20], eax
lea eax, [esp + 0x20]
push 0
push eax
push dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
push dword [ebx + 8]
call dword [0xbabda8]
xor edi, edi
cmp eax, 0xffffffff
jne 0x79209a
call dword [0xbabc58]
test eax, eax
je 0x79209a
mov esi, fcn.007f2130
mov ebp, eax
xor eax, eax
movzx edx, byte [0xbacf43]
imul esi, esi
and esi, 3
cmp esi, 3
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
bt edx, eax
jb 0x792076
mov al, byte [0xbacf43]
xor ecx, ecx
cmp esi, 3
mov ah, 1
sete cl
mov ebx, ecx
xor ebx, 1
lea ecx, [ecx + ebx*2 + 2]
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbacf43], ah
jne 0x791f30
mov ecx, fcn.007f2130
xor edx, edx
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 3
sete dl
mov ebx, edx
xor ebx, 1
lea edx, [edx + ebx*2 + 2]
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x791fa4
mov ebx, dword [esp + 4]
xor eax, eax
cmp ecx, 3
movzx esi, byte [0xbacf43]
sete al
mov edx, eax
xor edx, 1
lea eax, [eax + edx*2 + 2]
bt esi, eax
jae 0x791f82
jmp 0x792076
xor eax, eax
cmp ecx, 3
movzx edx, byte [0xbacf43]
mov ebx, dword [esp + 4]
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
bt edx, eax
jb 0x79204d
mov ecx, fcn.007f2130
xor eax, eax
imul ecx, ecx
and ecx, 3
cmp ecx, 3
sete al
mov ecx, eax
not ecx
and ecx, 0x1d
lea ecx, [eax + ecx*2 + 0x64309ee2]
mov eax, dword [0xbacf30]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbacf30], eax
not eax
imul edx, eax
mov eax, dword [0xbacf34]
lea esi, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbacf34], eax
or esi, edx
not eax
mov edx, dword [0xbacf38]
imul eax, esi
lea esi, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbacf38], edx
or esi, eax
not edx
mov al, 1
imul edx, esi
shl al, cl
xor dword [0xbacf3c], edx
or byte [0xbacf43], al
mov eax, fcn.007f2130
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 3
sete cl
mov eax, ecx
xor eax, 1
lea ecx, [ecx + eax*2 + 2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbacf43], al
mov dword [ebx + 0x14], ebp
mov ecx, 0x160a
mov edx, ebp
push 0x2c74
push dword [ebx + 0x1c]
push 0xbacf30
call fcn.007911b0
add esp, 0xc
mov edi, 1
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.00980459
mov eax, edi
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret