Function at 0x4380f0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x24
mov eax, dword [esp + 0x38]
mov esi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
add ecx, esi
sub ecx, dword [esp + 0x48]
mov dword [eax + 8], 0
mov dword [eax + 4], 0
mov dword [eax], 0
mov dword [esp + 0x18], ecx
cmp ecx, esi
jbe 0x4383fa
mov ebp, dword [esp + 0x4c]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp + 0x10], 0
jmp 0x438159
add esi, ecx
dec esi
mov eax, dword [esp + 0x38]
inc esi
cmp esi, dword [esp + 0x18]
jae 0x4383fa
test ebp, ebp
je 0x43819c
movzx eax, byte [ebp]
mov byte [esp + 0x14], 0xb7
lea ecx, [esp + 0x15]
mov byte [ecx + 2], 0
mov word [ecx], 0
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edx, ecx
add dl, 0x94
xor dl, byte [esp + ecx + 0x14]
add dl, 0x1c
mov byte [esp + ecx + 0x14], dl
inc ecx
cmp ecx, 4
jne 0x438180
cmp al, byte [esp + 0x14]
je 0x4381a7
movzx eax, byte [esi]
mov ecx, dword [esp + 0x44]
cmp al, byte [ecx]
jne 0x43814a
cmp dword [esp + 0x48], 2
jb 0x438240
mov ecx, 1
jmp 0x4381d8
movzx eax, byte [esi + ecx]
mov edx, dword [esp + 0x44]
cmp al, byte [edx + ecx]
jne 0x438147
inc ecx
cmp ecx, dword [esp + 0x48]
je 0x438240
test ebp, ebp
je 0x4381c0
movzx eax, byte [ebp + ecx]
mov byte [esp], al
mov byte [esp + 0x1c], 0xcd
lea eax, [esp + 0x1d]
mov byte [eax + 4], 0
mov dword [eax], 0
mov ebx, 0x4789102
lea eax, [esp + 0x1c]
movzx edi, byte [eax]
lea ebp, [ebx - 0x4789100]
and ebp, edi
or edi, ebx
not edi
or edi, ebp
mov ebp, edi
and ebp, 1
xor edi, 1
lea edx, [edi + ebp*2]
add dl, 0xe
mov byte [eax], dl
inc eax
dec ebx
cmp ebx, 0x47890fc
jne 0x438200
movzx eax, byte [esp]
cmp al, byte [esp + 0x1c]
mov ebp, dword [esp + 0x4c]
jne 0x4381c0
jmp 0x4381d1
mov ecx, dword [esp + 8]
mov edi, ecx
mov eax, dword [esp + 4]
sub edi, eax
cmp ecx, dword [esp + 0x10]
je 0x43825d
mov edx, eax
mov eax, dword [esp + 0x38]
jmp 0x4383e1
mov dword [esp + 0xc], edi
mov ecx, edi
sar ecx, 2
lea eax, [ecx + 1]
mov edi, ecx
shr edi, 1
add edi, ecx
cmp edi, eax
ja 0x438275
mov edi, eax
lea eax, [edi*4]
push eax
call fcn.004086b0
add esp, 4
mov edx, eax
mov ebx, dword [esp + 4]
test ebx, ebx
mov dword [esp], eax
je 0x4383bc
mov dword [esp + 0x10], edi
cmp edx, ebx
mov eax, dword [esp + 8]
jbe 0x43835f
cmp eax, edx
jbe 0x43835f
cmp dword [esp + 0xc], 0
je 0x4383a9
mov eax, dword [esp + 4]
mov edx, dword [esp + 0xc]
add eax, edx
dec eax
mov ecx, dword [esp]
add ecx, edx
dec ecx
mov edi, edx
and edi, 7
je 0x4382f4
neg edi
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, byte [eax + edx]
mov byte [ecx + edx], bl
dec edx
cmp edi, edx
jne 0x4382e0
add eax, edx
add ecx, edx
add edx, dword [esp + 0xc]
mov edi, dword [esp + 4]
sub edi, dword [esp + 8]
cmp edi, 0xfffffff8
ja 0x4383a9
neg edx
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
movzx ebx, byte [eax + edi]
mov byte [ecx + edi], bl
movzx ebx, byte [eax + edi - 1]
mov byte [ecx + edi - 1], bl
movzx ebx, byte [eax + edi - 2]
mov byte [ecx + edi - 2], bl
movzx ebx, byte [eax + edi - 3]
mov byte [ecx + edi - 3], bl
movzx ebx, byte [eax + edi - 4]
mov byte [ecx + edi - 4], bl
movzx ebx, byte [eax + edi - 5]
mov byte [ecx + edi - 5], bl
movzx ebx, byte [eax + edi - 6]
mov byte [ecx + edi - 6], bl
movzx ebx, byte [eax + edi - 7]
mov byte [ecx + edi - 7], bl
add edi, 0xfffffff8
cmp edx, edi
jne 0x438310
jmp 0x4383a9
mov ebp, dword [esp + 0xc]
mov ecx, ebp
shr ecx, 2
mov eax, ebx
mov edi, edx
xchg esi, eax
rep movsd dword es:[edi], dword [esi]
xchg esi, eax
mov eax, edx
mov edx, ebp
and edx, 0xfffffffc
lea edi, [eax + edx]
add edx, ebx
mov ebx, ebp
mov eax, ebp
and ebx, 3
mov ecx, ebx
shr ecx, 1
mov ebp, edx
mov dword [esp + 8], edi
xchg esi, ebp
rep movsw word es:[edi], word [esi]
xchg esi, ebp
mov ebp, dword [esp + 0x4c]
test al, 1
je 0x4383a9
movzx ecx, byte [edx + ebx - 1]
mov eax, dword [esp + 8]
mov byte [eax + ebx - 1], cl
push dword [esp + 4]
call fcn.004086c0
add esp, 4
mov edi, dword [esp + 0x10]
mov edx, dword [esp]
mov eax, dword [esp + 0x38]
mov dword [eax], edx
lea ecx, [edx + edi*4]
mov edx, dword [esp]
mov edi, dword [esp + 0xc]
add edx, edi
mov dword [esp + 0x10], ecx
mov dword [eax + 8], ecx
mov ecx, dword [esp]
mov dword [esp + 4], ecx
mov ecx, edx
mov edx, dword [esp]
mov dword [edx + edi], esi
add ecx, 4
mov dword [esp + 8], ecx
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x48]
add esi, ecx
dec esi
jmp 0x43814e
add esp, 0x24
pop esi
pop edi
pop ebx
pop ebp
ret