Function at 0x581230
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 8]
xor ecx, ecx
push esi
mov esi, dword [ebp + 0x14]
mov eax, dword [ebx + 0x174]
mov edx, dword [ebx + 0x160]
mov dword [ebp - 0x14], eax
mov eax, dword [ebx + 0x164]
mov dword [ebp - 0x18], eax
mov eax, esi
add eax, dword [ebx + 0x38]
mov dword [ebp - 0x1c], edx
adc ecx, dword [ebx + 0x3c]
cmp ecx, 0xf
ja 0x581429
jb 0x581277
cmp eax, 0xffffffe0
ja 0x581429
cmp dword [ebx + 0x16c], 0
mov dword [ebx + 0x38], eax
lea eax, [ebx + 0x60]
mov dword [ebx + 0x3c], ecx
lea ecx, [ebx + 0x40]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], ecx
je 0x5812a5
push eax
push ecx
call edx
add esp, 8
mov dword [ebx + 0x16c], 0
jmp 0x5812ab
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], ecx
mov eax, dword [ebx + 0xc]
mov edx, dword [ebx + 0x168]
mov ecx, dword [ebp + 0x10]
mov dword [ebp + 0x14], edx
bswap eax
mov dword [ebp - 4], eax
push edi
mov edi, dword [ebp + 0xc]
test edx, edx
je 0x581311
test esi, esi
je 0x581302
mov al, byte [edx + ebx + 0x10]
dec esi
xor al, byte [edi]
inc edi
mov byte [ecx], al
inc ecx
xor byte [edx + ebx + 0x40], al
inc edx
and edx, 0xf
mov dword [ebp + 8], ecx
mov dword [ebp - 8], edi
mov dword [ebp + 0x14], edx
jne 0x5812c7
lea eax, [ebx + 0x60]
lea ecx, [ebx + 0x40]
push eax
push ecx
call dword [ebp - 0x1c]
mov eax, dword [ebp + 0x14]
add esp, 8
mov ecx, dword [ebp + 8]
mov dword [ebp + 0x14], eax
jmp 0x581317
pop edi
pop esi
mov dword [ebx + 0x168], edx
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp + 8], ecx
mov dword [ebp - 8], edi
cmp esi, 0xc00
jb 0x581383
mov eax, 0xaaaaaaab
mul esi
shr edx, 0xb
mov dword [ebp - 8], edx
nop dword [eax]
push ebx
push dword [ebp - 0x14]
push 0xc0
push ecx
push edi
call dword [ebp + 0x18]
mov eax, dword [ebp - 4]
push 0xc00
push dword [ebp + 8]
add eax, 0xc0
push dword [ebp - 0xc]
mov dword [ebp - 4], eax
push dword [ebp - 0x10]
bswap eax
mov dword [ebx + 0xc], eax
call dword [ebp - 0x18]
mov ecx, dword [ebp + 8]
add esp, 0x24
add ecx, 0xc00
add edi, 0xc00
sub esi, 0xc00
mov dword [ebp + 8], ecx
sub dword [ebp - 8], 1
jne 0x581330
mov dword [ebp - 8], edi
mov eax, esi
and eax, 0xfffffff0
mov dword [ebp - 0x1c], eax
je 0x5813cb
push ebx
push dword [ebp - 0x14]
mov edi, eax
shr edi, 4
push edi
push ecx
push dword [ebp - 8]
call dword [ebp + 0x18]
mov eax, dword [ebp - 4]
add eax, edi
mov edi, dword [ebp - 8]
mov dword [ebp - 4], eax
bswap eax
mov dword [ebx + 0xc], eax
mov eax, dword [ebp - 0x1c]
add edi, eax
push eax
push dword [ebp + 8]
sub esi, eax
push dword [ebp - 0xc]
push dword [ebp - 0x10]
call dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
add esp, 0x24
add dword [ebp + 8], eax
test esi, esi
je 0x581417
push dword [ebp - 0x14]
lea eax, [ebx + 0x10]
push eax
mov eax, dword [ebx + 0x170]
push ebx
call eax
mov eax, dword [ebp - 4]
add esp, 0xc
mov ecx, dword [ebp + 0x14]
inc eax
bswap eax
mov dword [ebx + 0xc], eax
mov eax, dword [ebp + 8]
sub edi, eax
lea edx, [ecx + eax]
add ecx, 0x40
add ecx, ebx
add dword [ebp + 0x14], esi
nop
mov al, byte [edi + edx]
lea edx, [edx + 1]
xor al, byte [ecx - 0x30]
lea ecx, [ecx + 1]
mov byte [edx - 1], al
xor byte [ecx - 1], al
sub esi, 1
jne 0x581400
mov ecx, dword [ebp + 0x14]
xor eax, eax
pop edi
pop esi
mov dword [ebx + 0x168], ecx
pop ebx
mov esp, ebp
pop ebp
ret
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret