Function at 0x10040bd0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x64
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x80]
push ebx
mov ebx, dword [esp + 0x70]
push ebp
mov ebp, dword [esp + 0x70]
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 8], ecx
mov ecx, dword [ebp + 0x14]
push esi
push edi
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x14], ebx
mov dword [esp + 0x24], eax
mov dword [esp + 0x1c], eax
cmp ecx, eax
je 0x10040c2f
mov esi, dword [ecx + 4]
lea edx, [esi - 1]
cmp esi, eax
je 0x10040c2f
mov eax, dword [ecx]
mov eax, dword [eax + edx*4]
call fcn.10049f70
shl edx, 5
add eax, edx
mov esi, dword [esp + 0x80]
add eax, 7
cdq
and edx, 7
add eax, edx
mov edi, eax
sar edi, 3
cmp esi, edi
je 0x10040caa
push edi
call fcn.10087e65
push edi
mov ebx, eax
push 0
push ebx
mov dword [esp + 0x2c], ebx
call fcn.1008e320
mov ecx, dword [esp + 0x24]
push esi
sub edi, esi
push ecx
add edi, ebx
push edi
call fcn.1008d020
mov ecx, dword [ebp + 0x14]
add esp, 0x1c
test ecx, ecx
jne 0x10040c7b
xor eax, eax
jmp 0x10040c94
mov eax, dword [ecx + 4]
lea edx, [eax - 1]
test eax, eax
je 0x10040c94
mov eax, dword [ecx]
mov eax, dword [eax + edx*4]
call fcn.10049f70
shl edx, 5
add eax, edx
add eax, 7
cdq
and edx, 7
add eax, edx
mov esi, eax
sar esi, 3
mov dword [esp + 0x24], 1
test ebx, ebx
jne 0x10040cb8
mov edi, 0x18100049
jmp 0x10040f02
mov edx, dword [esp + 0x10]
mov edi, dword [edx + 8]
mov dword [esp + 0x18], edi
test ecx, ecx
jne 0x10040ccb
xor eax, eax
jmp 0x10040ce4
mov eax, dword [ecx + 4]
lea edx, [eax - 1]
test eax, eax
je 0x10040ce4
mov eax, dword [ecx]
mov eax, dword [eax + edx*4]
call fcn.10049f70
shl edx, 5
add eax, edx
dec eax
and eax, 7
mov dword [esp + 0x14], eax
jne 0x10040cf3
mov byte [ebx], 0
inc ebx
dec esi
mov ecx, dword [esp + 0x8c]
lea edx, [edi + ecx + 2]
cmp esi, edx
jge 0x10040d0c
mov edi, 0x18100059
jmp 0x10040f02
cmp byte [ebx + esi - 1], 0xbc
je 0x10040d1d
mov edi, 0x18100059
jmp 0x10040f02
sub esi, edi
dec esi
mov ebp, esi
lea edi, [ebx + ebp]
push ebp
mov dword [esp + 0x2c], edi
call fcn.10087e65
mov esi, eax
add esp, 4
test esi, esi
jne 0x10040d42
mov edi, 0x1810003b
jmp 0x10040ef5
mov ecx, dword [esp + 0x14]
mov eax, 0xff
shl eax, cl
mov cl, byte [ebx]
test cl, al
je 0x10040d5d
mov edi, 0x18100059
jmp 0x10040ef5
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x2c]
mov eax, dword [edx]
push ecx
push edi
push ebp
and eax, 0xff00ff00
push esi
call fcn.100406f0
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x10040ef5
test ebp, ebp
jle 0x10040d9b
mov eax, esi
sub ebx, esi
mov edi, ebp
lea esp, [esp]
mov dl, byte [ebx + eax]
xor byte [eax], dl
inc eax
sub edi, 1
jne 0x10040d90
mov eax, dword [esp + 0x14]
test eax, eax
je 0x10040db3
mov ecx, 8
sub ecx, eax
mov eax, 0xff
sar eax, cl
and byte [esi], al
xor ebx, ebx
cmp byte [esi], bl
jne 0x10040dcb
lea eax, [ebp - 1]
lea esp, [esp]
cmp ebx, eax
jge 0x10040dcb
inc ebx
cmp byte [ebx + esi], 0
je 0x10040dc0
mov cl, byte [ebx + esi]
inc ebx
cmp cl, 1
je 0x10040dde
mov edi, 0x18100059
jmp 0x10040ef5
mov eax, dword [esp + 0x8c]
test eax, eax
jl 0x10040dfb
mov edx, ebp
sub edx, ebx
cmp edx, eax
je 0x10040dfb
mov edi, 0x18100059
jmp 0x10040ef5
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
push ecx
push eax
call sym.inicrypto_v5.4.1.dll_ISC_Init_DIGEST
mov edi, eax
add esp, 8
test edi, edi
jne 0x10040ef5
xor edx, edx
cmp edx, 0x10099558
je 0x10040e44
mov edi, dword [esp + 0x10]
mov eax, dword [edi + 0xc]
mov ecx, dword [edi + 0x18]
push 8
push 0x10099558
push eax
call ecx
add esp, 0xc
test eax, eax
je 0x10040e4e
mov edi, 0xa02005b
jmp 0x10040ef5
mov edi, 0xa020049
jmp 0x10040ef5
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
push edx
push eax
push edi
call sym.inicrypto_v5.4.1.dll_ISC_Update_DIGEST
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x10040ef5
sub ebp, ebx
je 0x10040e86
mov ecx, dword [esp + 0x10]
push ebp
add ebx, esi
push ebx
push ecx
call sym.inicrypto_v5.4.1.dll_ISC_Update_DIGEST
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x10040ef5
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x34]
push eax
push ecx
call sym.inicrypto_v5.4.1.dll_ISC_Final_DIGEST
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x10040ef5
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
lea edi, [esp + 0x30]
cmp eax, 4
jb 0x10040ec8
mov edx, dword [edi]
cmp edx, dword [ecx]
jne 0x10040eec
sub eax, 4
add ecx, 4
add edi, 4
cmp eax, 4
jae 0x10040eb4
test eax, eax
je 0x10040ef3
mov dl, byte [ecx]
cmp dl, byte [edi]
jne 0x10040eec
cmp eax, 1
jbe 0x10040ef3
mov dl, byte [ecx + 1]
cmp dl, byte [edi + 1]
jne 0x10040eec
cmp eax, 2
jbe 0x10040ef3
mov al, byte [ecx + 2]
cmp al, byte [edi + 2]
je 0x10040ef3
mov edi, 0x18100059
jmp 0x10040ef5
xor edi, edi
test esi, esi
je 0x10040f02
push esi
call fcn.10087d88
add esp, 4
cmp dword [esp + 0x24], 0
je 0x10040f16
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.10087d88
add esp, 4
mov ecx, dword [esp + 0x70]
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.10087a66
add esp, 0x64
ret