Function at 0x51e370
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0x10
mov eax, dword [eax]
push ebx
push esi
push edi
test dword [eax + 0xc], 0x4000000
je 0x51e565
cmp dword [ebp + 0x10], 0
jne 0x51e3b6
mov esi, dword [ebp + 0xc]
push esi
call fcn.0051e310
add esp, 4
test eax, eax
jne 0x51e3aa
cmp dword [esi + 0x24], eax
je 0x51e565
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 0xc]
mov edi, dword [ebx + 0x24]
test edi, edi
je 0x51e3f8
mov esi, dword [edi + 0x14]
xor eax, eax
test esi, esi
jle 0x51e3f1
lea ecx, [edi + 0x24]
nop dword [eax]
mov ebx, dword [ebp + 0x10]
mov edx, dword [ecx]
cmp dword [ebx + edx*4], 0
mov ebx, dword [ebp + 0xc]
jge 0x51e3aa
cmp edx, dword [ebx + 4]
jne 0x51e3e9
cmp dword [ebp + 0x14], 0
jne 0x51e3aa
inc eax
add ecx, 8
cmp eax, esi
jl 0x51e3d0
mov edi, dword [edi + 4]
test edi, edi
jne 0x51e3c0
mov ecx, dword [ebx]
mov esi, ecx
mov dword [ebp - 0xc], ecx
test ecx, ecx
je 0x51e416
cmp byte [ecx], 0
je 0x51e40e
inc esi
cmp byte [esi], 0
jne 0x51e408
sub esi, ecx
and esi, 0x3fffffff
mov eax, dword [ebx + 0x44]
add eax, 0x38
mov dword [ebp + 8], esi
mov dword [ebp - 4], eax
cmp dword [eax + 0xc], 0
je 0x51e465
xor edi, edi
mov dword [ebp - 8], ecx
mov ebx, esi
test esi, esi
je 0x51e458
mov esi, ecx
movzx eax, byte [esi]
lea ecx, [edi*8]
dec ebx
lea esi, [esi + 1]
movzx edx, byte [eax + 0x5f0120]
xor edx, ecx
xor edi, edx
test ebx, ebx
jg 0x51e435
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov eax, edi
xor edx, edx
mov edi, dword [ebp - 4]
div dword [edi]
mov eax, edi
jmp 0x51e467
xor edx, edx
push edx
push esi
push ecx
push eax
call fcn.004f0180
add esp, 0x10
test eax, eax
je 0x51e565
mov ebx, dword [eax + 8]
mov dword [ebp - 8], ebx
test ebx, ebx
je 0x51e565
nop dword [eax]
xor edx, edx
mov dword [ebp + 8], edx
cmp dword [ebx + 0x14], edx
jle 0x51e557
mov eax, dword [ebp + 0xc]
lea ecx, [ebx + 0x28]
mov dword [ebp - 4], ecx
mov esi, dword [eax + 8]
mov dword [ebp - 0x10], esi
nop dword [eax]
mov ecx, dword [ecx]
xor edi, edi
mov dword [ebp - 0xc], ecx
test esi, esi
jle 0x51e541
mov ebx, dword [eax + 0xc]
test ecx, ecx
je 0x51e50f
mov eax, dword [ebx]
mov esi, ecx
mov cl, byte [eax]
test cl, cl
je 0x51e4ed
movzx edx, byte [esi]
movzx ecx, cl
mov cl, byte [ecx + 0x5f0120]
cmp cl, byte [edx + 0x5f0120]
jne 0x51e4ed
mov cl, byte [eax + 1]
inc eax
inc esi
test cl, cl
jne 0x51e4d0
movzx eax, byte [eax]
xor edx, edx
movzx ecx, byte [esi]
mov esi, dword [ebp - 0x10]
mov al, byte [eax + 0x5f0120]
cmp al, byte [ecx + 0x5f0120]
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp + 0xc]
sete dl
jmp 0x51e513
movzx edx, byte [ebx + 0x15]
test edx, edx
je 0x51e533
mov edx, dword [ebp + 0x10]
cmp dword [edx + edi*4], 0
jge 0x51e3aa
cmp edi, dword [eax + 4]
jne 0x51e533
cmp dword [ebp + 0x14], 0
jne 0x51e3aa
inc edi
add ebx, 0x18
cmp edi, esi
jl 0x51e4c2
mov edx, dword [ebp + 8]
mov ebx, dword [ebp - 8]
mov ecx, dword [ebp - 4]
inc edx
add ecx, 8
mov dword [ebp + 8], edx
mov dword [ebp - 4], ecx
cmp edx, dword [ebx + 0x14]
jl 0x51e4b0
mov ebx, dword [ebx + 0xc]
mov dword [ebp - 8], ebx
test ebx, ebx
jne 0x51e490
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret