Function at 0x10038740
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x38
push ebx
mov ebx, dword [esp + 0x44]
push ebp
mov ecx, dword [ebx + 4]
test ecx, ecx
jne 0x10038765
mov eax, dword [ebx + 0xc]
test byte [eax], 1
jne 0x10038765
mov ebp, 0x516
mov eax, ebp
pop ebp
pop ebx
add esp, 0x38
ret
push esi
push edi
mov edi, dword [esp + 0x4c]
mov esi, dword [edi + 4]
sub esi, ecx
jns 0x100387b3
push dword [esp + 0x58]
push edi
call fcn.10037d20
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x10038ada
mov esi, dword [esp + 0x54]
push esi
push eax
call fcn.10038390
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x10038ada
mov dword [esi + 4], eax
mov eax, dword [esi + 0xc]
pop edi
pop esi
mov dword [eax], ebp
mov eax, ebp
pop ebp
pop ebx
add esp, 0x38
ret
push dword [esp + 0x54]
push esi
call fcn.10038390
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x10038ada
lea eax, [esi + 0x20]
sar eax, 5
shl eax, 2
push eax
mov eax, dword [esp + 0x58]
push ebp
push dword [eax + 0xc]
call fcn.100506f0
push dword [esp + 0x64]
push dword [ebx + 4]
call fcn.10038390
mov ebp, eax
add esp, 0x14
mov dword [esp + 0x3c], ebp
test ebp, ebp
jne 0x10038ada
mov ebp, dword [edi + 4]
mov esi, dword [ebx + 4]
add ebp, 0x20
sar ebp, 5
add esi, 0x20
sar esi, 5
mov dword [esp + 0x28], esi
lea eax, [ebp*4 + 8]
push eax
push dword [edi + 0x14]
mov dword [esp + 0x48], eax
call fcn.10050640
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x10038842
pop edi
mov ebp, 0x3e9
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x38
ret
mov dword [eax + ebp*4], 0
mov dword [eax + ebp*4 + 4], 0
lea eax, [esi*4 + 8]
push eax
push dword [edi + 0x14]
mov dword [esp + 0x4c], eax
call fcn.10050640
mov ebx, eax
add esp, 8
mov dword [esp + 0x14], ebx
test ebx, ebx
jne 0x1003887c
mov ebp, 0x3e9
jmp 0x10038aa2
mov dword [ebx + esi*4], 0
mov dword [ebx + esi*4 + 4], 0
mov ecx, dword [edi + 4]
mov edx, dword [edi + 0xc]
inc ecx
and ecx, 0x8000001f
jns 0x1003889f
dec ecx
or ecx, 0xffffffe0
inc ecx
jne 0x100388a6
or eax, 0xffffffff
jmp 0x100388ad
or eax, 0xffffffff
shl eax, cl
not eax
and dword [edx + ebp*4 - 4], eax
mov eax, dword [esp + 0x50]
mov ecx, dword [eax + 4]
and ecx, 0x8000001f
jns 0x100388c5
dec ecx
or ecx, 0xffffffe0
inc ecx
push dword [esp + 0x10]
mov dword [esp + 0x28], ecx
je 0x10038908
mov eax, 0x20
sub eax, ecx
mov ecx, eax
push ecx
push ebp
push edx
mov dword [esp + 0x34], ecx
call fcn.1002e720
mov ecx, dword [esp + 0x20]
push ebx
push dword [esp + 0x38]
mov dword [ecx + ebp*4], eax
mov eax, dword [esp + 0x68]
push esi
push dword [eax + 0xc]
call fcn.1002e720
inc esi
add esp, 0x20
mov dword [esp + 0x28], esi
inc ebp
jmp 0x1003892b
push 0
push ebp
push edx
call fcn.1002e720
mov ecx, dword [esp + 0x20]
push ebx
push 0
push esi
mov dword [ecx + ebp*4], eax
mov eax, dword [esp + 0x6c]
push dword [eax + 0xc]
call fcn.1002e720
add esp, 0x20
mov eax, dword [esp + 0x54]
sub ebp, esi
mov dword [esp + 0x34], ebp
mov ecx, dword [eax + 0xc]
js 0x10038a3c
mov ebx, dword [esp + 0x10]
lea eax, [ebp - 1]
add eax, esi
lea edx, [ecx + ebp*4]
mov dword [esp + 0x18], edx
lea edi, [ebx + eax*4]
mov eax, ebx
sub eax, ecx
mov dword [esp + 0x38], edi
mov dword [esp + 0x30], eax
lea ecx, [ecx]
mov ecx, 0x1f
mov ebp, 0x80000000
mov eax, 1
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x20], eax
jmp 0x10038980
test dword [edi], ebp
je 0x100389ce
xor ebx, ebx
xor edi, edi
test esi, esi
jle 0x100389c8
mov eax, dword [esp + 0x30]
mov ebp, dword [esp + 0x20]
add eax, edx
mov edx, dword [esp + 0x14]
lea eax, [eax + 4]
mov edx, dword [edx + edi*4]
mov esi, edx
shl esi, cl
inc edi
or esi, ebx
mov ecx, ebp
xor dword [eax - 4], esi
mov ebx, edx
mov esi, dword [esp + 0x28]
shr ebx, cl
mov ecx, dword [esp + 0x1c]
cmp edi, esi
jl 0x10038996
mov ebp, dword [esp + 0x2c]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
xor dword [edx], ebp
mov edi, dword [esp + 0x38]
inc eax
ror ebp, 1
dec ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x2c], ebp
cmp eax, 0x20
jl 0x10038980
test byte [edi], 1
mov ebx, dword [esp + 0x14]
je 0x10038a15
xor edx, edx
test esi, esi
jle 0x10038a0e
mov ecx, dword [esp + 0x30]
add ecx, dword [esp + 0x18]
lea ebx, [ebx]
mov eax, dword [ebx + edx*4]
lea ecx, [ecx + 4]
xor dword [ecx - 4], eax
inc edx
cmp edx, esi
jl 0x10038a00
mov edx, dword [esp + 0x18]
xor dword [edx], 1
mov eax, dword [esp + 0x34]
sub edi, 4
dec eax
mov dword [esp + 0x38], edi
sub edx, 4
mov dword [esp + 0x34], eax
mov dword [esp + 0x18], edx
test eax, eax
jns 0x10038960
mov edi, dword [esp + 0x4c]
mov eax, dword [esp + 0x54]
mov ebp, dword [esp + 0x50]
push eax
mov eax, dword [edi + 4]
sub eax, dword [ebp + 4]
push eax
call fcn.10038300
mov eax, dword [esp + 0x2c]
add esp, 8
test eax, eax
jne 0x10038a75
lea eax, [esi*4]
push eax
mov eax, dword [esp + 0x5c]
push dword [esp + 0x14]
push dword [eax + 0xc]
call fcn.100506d0
add esp, 0xc
jmp 0x10038a8d
mov ecx, dword [esp + 0x58]
push dword [ecx + 0xc]
push eax
lea eax, [esi - 1]
push eax
push dword [esp + 0x1c]
call fcn.1002e7a0
add esp, 0x10
mov eax, dword [ebp + 4]
push dword [esp + 0x58]
dec eax
push eax
call fcn.10038300
mov ebp, dword [esp + 0x44]
add esp, 8
push dword [esp + 0x40]
mov esi, dword [esp + 0x14]
push 0
push esi
call fcn.100506f0
push esi
push dword [edi + 0x14]
call fcn.10050630
add esp, 0x14
test ebx, ebx
je 0x10038ada
push dword [esp + 0x44]
push 0
push ebx
call fcn.100506f0
push ebx
push dword [edi + 0x14]
call fcn.10050630
add esp, 0x14
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x38
ret