Function at 0x10040f30
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
mov eax, dword [esi + 8]
mov ebp, dword [eax + 8]
push edi
push ebp
mov dword [esp + 0x1c], ebp
call fcn.10087e65
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
jne 0x10040f61
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
cmp dword [esp + 0x44], 0
mov eax, dword [esi + 0x14]
je 0x10040fb3
test eax, eax
je 0x10040f8c
mov edx, dword [eax + 4]
lea ecx, [edx - 1]
test edx, edx
jne 0x10040f7d
xor eax, eax
jmp 0x10040f8c
mov edx, dword [eax]
mov eax, dword [edx + ecx*4]
call fcn.10049f70
shl ecx, 5
add eax, ecx
add eax, 7
cdq
and edx, 7
add eax, edx
mov edi, eax
mov eax, dword [esp + 0x34]
sar edi, 3
mov esi, edi
lea ecx, [eax + 1]
sub esi, ebp
mov byte [eax], 0
mov dword [esp + 0x14], ecx
lea ebx, [eax + ebp + 1]
dec esi
jmp 0x10040ff2
test eax, eax
je 0x10040fd4
mov edx, dword [eax + 4]
lea ecx, [edx - 1]
test edx, edx
jne 0x10040fc5
xor eax, eax
jmp 0x10040fd4
mov edx, dword [eax]
mov eax, dword [edx + ecx*4]
call fcn.10049f70
shl ecx, 5
add eax, ecx
add eax, 7
cdq
and edx, 7
add eax, edx
mov edi, eax
mov eax, dword [esp + 0x34]
sar edi, 3
dec edi
mov esi, edi
mov dword [esp + 0x14], eax
lea ebx, [eax + ebp]
sub esi, ebp
mov ecx, dword [esp + 0x38]
push ecx
push 0
push eax
call fcn.1008e320
lea eax, [ebp + ebp]
mov ebp, dword [esp + 0x3c]
mov edx, edi
sub edx, eax
dec edx
add esp, 0xc
cmp ebp, edx
jle 0x1004101b
or edi, 0xffffffff
jmp 0x100411a2
inc eax
cmp edi, eax
jl 0x10041013
push esi
call fcn.10087e65
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x10041039
or edi, 0xffffffff
jmp 0x10041191
mov eax, dword [esp + 0x28]
mov eax, dword [eax + 8]
mov ecx, dword [eax]
push ecx
push eax
call sym.inicrypto_v5.4.1.dll_ISC_Init_DIGEST
add esp, 8
test eax, eax
je 0x10041058
or edi, 0xffffffff
jmp 0x10041191
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x28]
push edx
mov edx, dword [ecx + 8]
push eax
push edx
call sym.inicrypto_v5.4.1.dll_ISC_Update_DIGEST
add esp, 0xc
test eax, eax
je 0x1004107e
or edi, 0xffffffff
jmp 0x10041191
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx + 8]
lea eax, [esp + 0x18]
push eax
push ebx
push edx
call sym.inicrypto_v5.4.1.dll_ISC_Final_DIGEST
add esp, 0xc
test eax, eax
je 0x100410a0
or edi, 0xffffffff
jmp 0x10041191
cmp dword [esp + 0x44], 0
push ebp
je 0x100410c8
mov ecx, dword [esp + 0x30]
mov eax, ebx
sub eax, ebp
mov ebp, dword [esp + 0x1c]
mov edx, edi
sub edx, ebp
sub edx, dword [esp + 0x34]
mov byte [eax + esi - 1], 1
push ecx
lea eax, [edx + ebx - 1]
jmp 0x100410e4
mov edx, dword [esp + 0x30]
mov ecx, ebx
sub ecx, ebp
mov ebp, dword [esp + 0x1c]
mov eax, edi
sub eax, ebp
sub eax, dword [esp + 0x34]
mov byte [ecx + esi - 1], 1
push edx
add eax, ebx
push eax
call fcn.1008d020
add esp, 0xc
test ebp, ebp
jle 0x10041101
mov ecx, dword [esp + 0x14]
push ebp
push 0
push ecx
call fcn.1008e320
add esp, 0xc
mov edx, dword [esp + 0x14]
push ebp
push edx
call sym.inicrypto_v5.4.1.dll_ISC_Rand_Bytes
add esp, 8
test eax, eax
je 0x10041118
or edi, 0xffffffff
jmp 0x10041191
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x28]
mov eax, dword [eax]
mov edx, dword [esp + 0x1c]
push ebp
push ecx
push esi
and eax, 0xff00ff00
push edx
call fcn.100406f0
add esp, 0x10
test eax, eax
je 0x10041140
or edi, 0xffffffff
jmp 0x10041191
test esi, esi
jle 0x1004115d
mov ecx, dword [esp + 0x1c]
mov eax, ebx
sub ecx, ebx
mov dword [esp + 0x18], esi
mov dl, byte [ecx + eax]
xor byte [eax], dl
inc eax
sub dword [esp + 0x18], 1
jne 0x10041150
mov eax, dword [esp + 0x28]
mov eax, dword [eax]
mov ecx, dword [esp + 0x20]
push esi
push ebx
push ebp
and eax, 0xff00ff00
push ecx
call fcn.100406f0
add esp, 0x10
test ebp, ebp
jle 0x10041191
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
sub ecx, eax
mov dl, byte [ecx + eax]
xor byte [eax], dl
inc eax
sub ebp, 1
jne 0x10041186
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x100411a2
push eax
call fcn.10087d88
add esp, 4
mov eax, dword [esp + 0x20]
push eax
call fcn.10087d88
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret