Function at 0x10157d60
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x34], edi
cmp byte [edi + 0x1f], 2
mov ebx, dword [edi + 0xc4]
movzx esi, byte [edi + 0x20]
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0xc], ebx
lea eax, [ebx + 0x200]
mov dword [ebp - 0x38], eax
lea eax, [ebx + 0x100]
je 0x10157d97
mov ecx, dword [edx]
jmp 0x10157d9a
mov ecx, dword [edx + 4]
push 0x100
push 0
push eax
mov dword [ebp - 0x20], ecx
call fcn.102dad40
xor eax, eax
xor ecx, ecx
add esp, 0xc
mov dword [ebp - 0x18], ecx
mov dword [ebp - 8], eax
cmp byte [edi + 0x1c], al
jbe 0x10157f74
mov dword [ebp - 0x1c], ebx
lea ebx, [eax + 0x14]
xor edx, edx
add ebx, edi
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x40], ebx
cmp byte [ebx], dl
jbe 0x10157f4f
mov eax, ecx
shl eax, 4
mov dword [ebp - 4], eax
xor ebx, ebx
test esi, esi
jle 0x10157f2a
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
shl edi, 4
mov dword [ebp - 0x10], edi
mov dword [ebp - 0x14], eax
lea esp, [esp]
mov eax, dword [ebp - 0x34]
mov esi, dword [ebp - 0x20]
mov ecx, dword [eax + 0x24]
imul ecx, dword [ebp - 0x18]
movsx edx, word [esi + ebx*2]
mov eax, dword [eax]
movsx esi, word [esi + ebx*2 + 2]
sub esi, edx
add ecx, edx
mov dword [ebp - 0x28], esi
lea eax, [eax + ecx*4]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x38]
mov al, byte [edi + eax]
test al, al
je 0x10157f0d
cmp al, 0xf
je 0x10157f0d
cmp al, 0xe
je 0x10157f0d
cmp al, 0xd
jne 0x10157e68
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0xc]
mov cx, word [eax]
mov eax, dword [ebp - 4]
sar cx, 2
inc cx
add eax, ebx
mov word [edx + eax*2 + 0x100], cx
jmp 0x10157f0d
xor ecx, ecx
cmp dword [ebp - 0x28], ecx
je 0x10157e88
mov edi, dword [ebp - 0x2c]
mov eax, dword [edi + esi*4 - 4]
dec esi
cdq
xor eax, edx
sub eax, edx
cmp eax, ecx
cmovg ecx, eax
test esi, esi
jne 0x10157e72
mov edi, dword [ebp - 0x10]
mov eax, ecx
cdq
xor eax, edx
sub eax, edx
cmp eax, 0x1fff
jg 0x10157f68
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x24], ecx
movsx esi, word [eax + edi*2]
mov edi, esi
and esi, 3
sar edi, 2
test ecx, ecx
je 0x10157ee6
mov edx, esi
lea ecx, [ebp - 0x24]
call fcn.10157450
bsr edx, dword [ebp - 0x24]
mov dword [ebp - 0x44], 0
setne cl
test cl, cl
je 0x10157eda
mov ecx, 0x1f
sub ecx, edx
sub ecx, eax
sub ecx, 2
jmp 0x10157ee8
mov ecx, 0x20
sub ecx, eax
sub ecx, 2
jmp 0x10157ee8
xor ecx, ecx
mov eax, dword [ebp - 4]
sub edi, ecx
mov edx, dword [ebp - 0xc]
add eax, ebx
push ecx
mov ecx, dword [ebp - 0x2c]
push esi
mov word [edx + eax*2 + 0x100], di
mov edx, dword [ebp - 0x28]
call fcn.10157c60
mov edi, dword [ebp - 0x10]
add esp, 8
add dword [ebp - 0x14], 2
inc ebx
mov esi, dword [ebp - 0x3c]
inc edi
mov dword [ebp - 0x10], edi
cmp ebx, esi
jl 0x10157e00
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x30]
add eax, 0x10
inc edx
mov dword [ebp - 4], eax
inc ecx
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x18], ecx
movzx eax, byte [eax]
cmp edx, eax
mov eax, dword [ebp - 4]
jl 0x10157de0
mov edi, dword [ebp - 0x34]
mov eax, dword [ebp - 8]
add dword [ebp - 0x1c], 0x20
inc eax
mov dword [ebp - 8], eax
movzx eax, byte [edi + 0x1c]
cmp dword [ebp - 8], eax
jge 0x10157f74
mov eax, dword [ebp - 8]
jmp 0x10157dc3
pop edi
pop esi
mov eax, 0x4004
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret