Function at 0x10016b70
Capabilities:
Access peb ldr_data
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10084ee6
mov eax, dword fs:[0]
push eax
sub esp, 0xc44
mov eax, dword [0x100bae20]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 8]
mov edi, dword [eax + 0x10]
mov esi, ecx
mov ecx, dword [eax]
mov ebx, dword [esi + 0xc]
sar ecx, 3
xor edx, edx
and ecx, 0x1ff
inc ecx
cmp ecx, 1
setg dl
mov ecx, ebx
and ecx, 7
add ecx, ecx
add ecx, ecx
mov dword [ebp - 0xc50], eax
mov eax, dword [eax + 0x30]
mov dword [ebp - 0xc40], edx
mov edx, 0x48442211
shr edx, cl
mov ecx, dword [esi + 4]
mov dword [ebp - 0xc4c], eax
mov eax, ecx
and edx, 0xf
add edx, edx
add edx, edx
add edx, edx
imul eax, edx
imul eax, dword [esi + 0x4a8]
mov dword [ebp - 0xc3c], edx
cdq
and edx, 7
add eax, edx
sar ebx, 3
sar eax, 3
and ebx, 0x1ff
add eax, 7
inc ebx
imul ecx, ebx
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp dword [esi + 0x4ac], 0
mov dword [ebp - 0xc34], edi
mov byte [ebp - 0xc25], 0
mov dword [ebp - 0xc48], eax
mov dword [ebp - 0xc44], ecx
jl 0x100171aa
lea ecx, [esi + 0x84]
call fcn.10010bb0
test al, al
je 0x100171aa
mov ebx, dword [ebp - 0xc48]
add ebx, 0x20
lea eax, [ebp - 0xc1c]
mov dword [ebp - 0xc24], eax
mov dword [ebp - 0xc20], 0x400
cmp ebx, 0x400
jbe 0x10016c9a
push ebx
call fcn.1007ced2
add esp, 4
mov dword [ebp - 0xc24], eax
mov dword [ebp - 0xc20], ebx
lea ecx, [ebp - 0x814]
mov dword [ebp - 4], 0
mov ebx, eax
mov dword [ebp - 0x81c], ecx
mov dword [ebp - 0x818], 0x400
cmp dword [ebp - 0xc3c], 8
mov edx, ecx
mov byte [ebp - 4], 1
mov dword [ebp - 0xc38], edx
jne 0x10016d68
mov eax, dword [esi + 0x4b4]
inc eax
push eax
lea ecx, [ebp - 0x81c]
call sym.opencv_highgui220.dll_public:_void___thiscall_cv::AutoBuffer_unsigned_char__1024_::allocate_unsigned_int_
mov ecx, dword [ebp - 0x81c]
mov dword [ebp - 0xc38], ecx
mov ecx, dword [esi + 0x4b4]
xor edi, edi
test ecx, ecx
js 0x10016d39
mov dword [ebp - 0xc2c], edi
mov eax, dword [ebp - 0xc2c]
cdq
idiv ecx
cmp dword [esi + 0x4a8], 1
mov ecx, dword [ebp - 0xc38]
setne dl
add dword [ebp - 0xc2c], 0xff
dec dl
inc edi
xor al, dl
mov byte [edi + ecx - 1], al
mov ecx, dword [esi + 0x4b4]
cmp edi, ecx
jle 0x10016d03
mov eax, dword [esi + 0x4a8]
cmp eax, 1
sete dl
dec eax
neg eax
movzx ecx, dl
sbb eax, eax
and eax, 7
push ecx
inc eax
push eax
lea edx, [ebp - 0x414]
push edx
call fcn.1000c0d0
mov edi, dword [ebp - 0xc34]
add esp, 0xc
mov eax, dword [esi + 0x4ac]
push eax
lea ecx, [esi + 0x84]
mov byte [ebp - 4], 2
call fcn.10010c80
mov eax, dword [esi + 0x4a8]
dec eax
je 0x1001700a
sub eax, 7
je 0x10016d99
sub eax, 0x10
jne 0x10017154
mov dword [ebp - 0xc30], 0
jmp 0x10016db0
mov ecx, dword [ebp - 0xc30]
cmp ecx, dword [esi + 8]
jge 0x1001714d
cmp byte [esi + 0x4b0], 0
jne 0x10016e44
mov dword [ebp - 0xc2c], 0
mov ecx, dword [ebp - 0xc44]
cmp dword [ebp - 0xc2c], ecx
jge 0x10016e81
push 0x7fffffff
lea edi, [esi + 0x84]
call fcn.10016590
mov ecx, dword [esi + 0x4b4]
add esp, 4
cmp eax, ecx
jbe 0x10016e03
mov eax, ecx
cmp dword [ebp - 0xc3c], 8
jne 0x10016e2c
mov edx, dword [ebp - 0xc38]
mov ecx, dword [ebp - 0xc2c]
mov al, byte [eax + edx]
inc dword [ebp - 0xc2c]
mov edi, dword [ebp - 0xc34]
mov byte [ecx + ebx], al
jmp 0x10016dd2
mov edx, dword [ebp - 0xc2c]
inc dword [ebp - 0xc2c]
mov edi, dword [ebp - 0xc34]
mov word [ebx + edx*2], ax
jmp 0x10016dd2
mov eax, dword [ebp - 0xc48]
push eax
push ebx
lea ecx, [esi + 0x84]
call fcn.10010d00
cmp dword [ebp - 0xc3c], 0x10
jne 0x10016e7b
xor eax, eax
cmp eax, dword [ebp - 0xc44]
jge 0x10016e7b
mov cl, byte [ebx + eax*2]
mov dl, byte [ebx + eax*2 + 1]
mov byte [ebx + eax*2], dl
mov byte [ebx + eax*2 + 1], cl
inc eax
jmp 0x10016e62
mov ecx, dword [ebp - 0xc44]
mov edx, dword [ebp - 0xc50]
test byte [edx], 7
jne 0x10016eab
cmp dword [ebp - 0xc3c], 0x10
jne 0x10016eab
xor eax, eax
cmp eax, ecx
jge 0x10016eab
mov dl, byte [ebx + eax*2 + 1]
mov byte [eax + ebx], dl
mov edx, dword [ebp - 0xc50]
inc eax
jmp 0x10016e97
cmp dword [esi + 0x4a8], 8
jne 0x10016f57
cmp dword [ebp - 0xc40], 0
je 0x10016f22
test byte [edx], 7
mov ecx, dword [esi + 4]
mov eax, edi
mov edx, ebx
jne 0x10016ef3
add ecx, ebx
mov dword [ebp - 0xc34], ecx
cmp edx, ecx
jae 0x10016ff3
mov cl, byte [edx]
mov byte [eax + 2], cl
mov byte [eax + 1], cl
mov byte [eax], cl
mov ecx, dword [ebp - 0xc34]
add eax, 3
inc edx
jmp 0x10016ed5
lea ecx, [ebx + ecx*2]
mov dword [ebp - 0xc34], ecx
lea esp, [esp]
cmp edx, dword [ebp - 0xc34]
jae 0x10016ff3
movzx ecx, word [edx]
mov word [eax + 4], cx
mov word [eax + 2], cx
mov word [eax], cx
add edx, 2
add eax, 6
jmp 0x10016f00
mov eax, dword [ebp - 0xc3c]
cdq
and edx, 7
add eax, edx
sar eax, 3
imul eax, dword [esi + 4]
push eax
push ebx
push edi
call sub.MSVCR100.dll_memcpy
inc dword [ebp - 0xc30]
add esp, 0xc
add edi, dword [ebp - 0xc4c]
mov dword [ebp - 0xc34], edi
jmp 0x10016db0
cmp dword [ebp - 0xc40], 0
mov eax, dword [esi + 4]
mov ecx, 1
je 0x10016fb3
test byte [edx], 7
push ecx
push eax
push 0
push edi
push 0
push ebx
jne 0x10016f94
call fcn.1000bc90
inc dword [ebp - 0xc30]
add esp, 0x18
add edi, dword [ebp - 0xc4c]
mov dword [ebp - 0xc34], edi
jmp 0x10016db0
call fcn.1000bd10
inc dword [ebp - 0xc30]
add esp, 0x18
add edi, dword [ebp - 0xc4c]
mov dword [ebp - 0xc34], edi
jmp 0x10016db0
test byte [edx], 7
push 2
jne 0x10016fe1
push ecx
push eax
push 0
push edi
push 0
push ebx
call fcn.1000b810
inc dword [ebp - 0xc30]
add esp, 0x1c
add edi, dword [ebp - 0xc4c]
mov dword [ebp - 0xc34], edi
jmp 0x10016db0
push 3
push ecx
push eax
push 0
push edi
push 0
push ebx
call fcn.1000b8a0
add esp, 0x20
inc dword [ebp - 0xc30]
add edi, dword [ebp - 0xc4c]
mov dword [ebp - 0xc34], edi
jmp 0x10016db0
cmp byte [esi + 0x4b0], 0
mov dword [ebp - 0xc30], 0
jne 0x100170e0
mov edx, dword [ebp - 0xc30]
cmp edx, dword [esi + 8]
jge 0x1001714d
mov dword [ebp - 0xc2c], 0
lea ebx, [ebx]
mov eax, dword [ebp - 0xc2c]
cmp eax, dword [esi + 4]
jge 0x10017078
push 1
lea edi, [esi + 0x84]
call fcn.10016590
mov edi, dword [ebp - 0xc34]
add esp, 4
test eax, eax
mov eax, dword [ebp - 0xc2c]
setne cl
mov byte [eax + ebx], cl
inc eax
mov dword [ebp - 0xc2c], eax
jmp 0x10017040
cmp dword [ebp - 0xc40], 0
je 0x100170ad
mov eax, dword [esi + 4]
lea edx, [ebp - 0x414]
push edx
push eax
push ebx
push edi
call fcn.1000c250
inc dword [ebp - 0xc30]
add esp, 0x10
add edi, dword [ebp - 0xc4c]
mov dword [ebp - 0xc34], edi
jmp 0x10017021
mov ecx, dword [ebp - 0xc38]
mov edx, dword [esi + 4]
push ecx
push edx
push ebx
push edi
call fcn.1000c2a0
inc dword [ebp - 0xc30]
add esp, 0x10
add edi, dword [ebp - 0xc4c]
mov dword [ebp - 0xc34], edi
jmp 0x10017021
mov eax, dword [ebp - 0xc30]
cmp eax, dword [esi + 8]
jge 0x1001714d
mov ecx, dword [ebp - 0xc48]
push ecx
push ebx
lea ecx, [esi + 0x84]
call fcn.10010d00
cmp dword [ebp - 0xc40], 0
je 0x1001712a
mov eax, dword [esi + 4]
lea edx, [ebp - 0x414]
push edx
push eax
push ebx
push edi
call fcn.1000c3d0
inc dword [ebp - 0xc30]
add esp, 0x10
add edi, dword [ebp - 0xc4c]
jmp 0x100170e0
mov ecx, dword [ebp - 0xc38]
mov edx, dword [esi + 4]
push ecx
push edx
push ebx
push edi
call fcn.1000c4a0
inc dword [ebp - 0xc30]
add esp, 0x10
add edi, dword [ebp - 0xc4c]
jmp 0x100170e0
mov byte [ebp - 0xc25], 1
mov eax, dword [ebp - 0x81c]
lea ecx, [ebp - 0x814]
cmp eax, ecx
je 0x10017183
push eax
call sub.MSVCR100.dll_void___cdecl_operator_delete___void__
lea edx, [ebp - 0x814]
add esp, 4
mov dword [ebp - 0x81c], edx
mov dword [ebp - 0x818], 0x400
mov eax, dword [ebp - 0xc24]
lea ecx, [ebp - 0xc1c]
cmp eax, ecx
je 0x1001719c
push eax
call sub.MSVCR100.dll_void___cdecl_operator_delete___void__
add esp, 4
mov al, byte [ebp - 0xc25]
jmp 0x100171ac
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.1007cee0
mov esp, ebp
pop ebp
ret 4