Function at 0x5121c0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
push ebx
mov ebx, ecx
push ebp
push esi
mov eax, dword [ebx]
push edi
test eax, eax
mov dword [esp + 0x10], ebx
je 0x5121e2
pop edi
pop esi
pop ebp
mov eax, 0xfffffffb
pop ebx
add esp, 0x24
ret 0xc
mov ecx, dword [ebx + 4]
cmp ecx, 2
je 0x512200
mov eax, dword [ebx + 8]
test eax, eax
jne 0x512200
pop edi
pop esi
pop ebp
mov eax, 0xfffffffa
pop ebx
add esp, 0x24
ret 0xc
mov edi, dword [esp + 0x38]
test edi, edi
je 0x512503
mov eax, dword [esp + 0x3c]
test eax, eax
jle 0x512503
cdq
and edx, 0x7f
add eax, edx
mov esi, eax
mov eax, ecx
sar esi, 7
sub eax, 0
mov dword [esp + 0x3c], esi
je 0x5124ce
dec eax
je 0x512421
dec eax
je 0x512249
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x24
ret 0xc
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebx + 0x10]
mov edx, dword [ebx + 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x18]
mov dword [esp + 0x18], ecx
test esi, esi
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
jle 0x5124f4
mov ebp, dword [esp + 0x40]
mov dword [esp + 0x38], esi
xor esi, esi
jmp 0x512285
mov ebx, dword [esp + 0x10]
xor esi, esi
jmp 0x512285
mov ebx, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], eax
lea edx, [esp + 0x24]
lea eax, [esp + 0x24]
mov dword [esp + 0x30], ecx
push edx
push eax
mov ecx, ebx
call fcn.00512850
mov al, byte [esp + 0x15]
mov dl, byte [esp + 0x14]
mov cl, al
shr cl, 7
shl dl, 1
or cl, dl
mov byte [esp + 0x14], cl
mov cl, byte [esp + 0x16]
mov dl, cl
shr dl, 7
shl al, 1
or dl, al
mov al, byte [esp + 0x17]
mov byte [esp + 0x15], dl
mov dl, al
shr dl, 7
shl cl, 1
or dl, cl
mov cl, byte [esp + 0x18]
mov byte [esp + 0x16], dl
mov dl, cl
shr dl, 7
shl al, 1
or dl, al
mov al, byte [esp + 0x19]
mov byte [esp + 0x17], dl
mov dl, al
shr dl, 7
shl cl, 1
or dl, cl
mov cl, byte [esp + 0x1a]
mov byte [esp + 0x18], dl
mov dl, cl
shr dl, 7
shl al, 1
or dl, al
mov al, byte [esp + 0x1b]
mov byte [esp + 0x19], dl
mov dl, al
shr dl, 7
shl cl, 1
or dl, cl
mov cl, byte [esp + 0x1c]
mov byte [esp + 0x1a], dl
mov dl, cl
shr dl, 7
shl al, 1
or dl, al
mov al, byte [esp + 0x1d]
mov byte [esp + 0x1b], dl
mov dl, al
shr dl, 7
shl cl, 1
or dl, cl
mov cl, byte [esp + 0x1e]
mov byte [esp + 0x1c], dl
mov dl, cl
shr dl, 7
shl al, 1
or dl, al
mov al, byte [esp + 0x1f]
mov byte [esp + 0x1d], dl
mov dl, al
shr dl, 7
shl cl, 1
or dl, cl
mov byte [esp + 0x1e], dl
mov cl, byte [esp + 0x20]
mov ebx, esi
mov dl, cl
and ebx, 7
shr dl, 7
shl al, 1
or dl, al
mov al, byte [esp + 0x21]
mov byte [esp + 0x1f], dl
mov dl, al
shr dl, 7
shl cl, 1
or dl, cl
mov cl, byte [esp + 0x22]
mov byte [esp + 0x20], dl
mov dl, cl
shr dl, 7
shl al, 1
or dl, al
mov al, byte [esp + 0x23]
shr al, 7
shl cl, 1
or al, cl
mov byte [esp + 0x21], dl
mov byte [esp + 0x22], al
mov eax, esi
cdq
and edx, 7
mov cl, 7
add eax, edx
sub cl, bl
sar eax, 3
mov dl, byte [eax + edi]
shr dl, cl
mov cl, byte [esp + 0x23]
shl cl, 1
and dl, 1
or dl, cl
mov cl, bl
mov byte [esp + 0x23], dl
mov dl, byte [esp + 0x24]
mov bl, byte [eax + ebp]
and dl, 0x80
shr dl, cl
xor bl, dl
inc esi
cmp esi, 0x80
mov byte [eax + ebp], bl
jl 0x512281
mov eax, dword [esp + 0x38]
dec eax
mov dword [esp + 0x38], eax
jne 0x512279
mov esi, dword [esp + 0x3c]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
shl eax, 7
add esp, 0x24
ret 0xc
mov eax, dword [ebx + 0x10]
mov ecx, dword [ebx + 0x14]
mov edx, dword [ebx + 0x18]
mov ebp, dword [ebx + 0xc]
test esi, esi
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], edx
jle 0x5124f4
mov dword [esp + 0x38], esi
mov esi, dword [esp + 0x40]
lea eax, [esp + 0x24]
mov ecx, ebx
push eax
push edi
call fcn.00512d00
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x18]
xor eax, ebp
mov ebp, dword [esp + 0x1c]
xor ecx, edx
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x24], eax
xor edx, ebp
mov ebp, dword [esp + 0x20]
xor dword [esp + 0x30], ebp
mov ebp, dword [edi]
mov dword [esi], eax
mov eax, dword [edi + 4]
mov dword [esp + 0x28], ecx
mov dword [esi + 4], ecx
mov ecx, dword [edi + 8]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x2c], edx
mov dword [esi + 8], edx
mov edx, dword [edi + 0xc]
mov dword [esi + 0xc], eax
mov eax, dword [esp + 0x38]
add edi, 0x10
add esi, 0x10
dec eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x38], eax
jne 0x512449
mov esi, dword [esp + 0x3c]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
shl eax, 7
add esp, 0x24
ret 0xc
test esi, esi
jle 0x5124f4
mov ebp, dword [esp + 0x40]
mov dword [esp + 0x38], esi
push ebp
push edi
mov ecx, ebx
call fcn.00512d00
mov eax, dword [esp + 0x38]
add edi, 0x10
add ebp, 0x10
dec eax
mov dword [esp + 0x38], eax
jne 0x5124da
mov eax, esi
pop edi
pop esi
pop ebp
shl eax, 7
pop ebx
add esp, 0x24
ret 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret 0xc