Function at 0x401650
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x8018
call fcn.00406860
mov eax, dword [0x41153c]
push ebx
push ebp
push esi
push edi
push 0xc
push eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov ecx, eax
and eax, 0xffff
imul eax, dword [0x4113e8]
add eax, 0x1f
mov dword [esp + 0x1c], ecx
cdq
and edx, 0x1f
add eax, edx
mov ebx, eax
sar ebx, 5
shl ebx, 2
cmp cx, 0x10
jae 0x40169d
mov dword [esp + 0x1c], 0x10
mov ebp, dword [0x4113dc]
imul ebp, ebx
add ebp, 0x28
push ebp
call fcn.004067e8
mov edi, eax
xor esi, esi
add esp, 4
cmp edi, esi
mov dword [esp + 0x10], edi
je 0x401a3b
push ebp
call fcn.004067e8
mov ebp, eax
add esp, 4
cmp ebp, esi
jne 0x4016e7
push edi
call fcn.004067b9
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8018
ret
mov dword [edi], 0x28
mov ecx, dword [0x4113e8]
mov dword [edi + 4], ecx
mov edx, dword [0x4113dc]
mov cx, word [esp + 0x1c]
mov dword [edi + 8], edx
mov word [edi + 0xc], 1
mov word [edi + 0xe], cx
mov dword [edi + 0x10], esi
mov edx, dword [0x4113dc]
imul edx, ebx
lea eax, [edi + 0x28]
push esi
push edi
mov dword [esp + 0x20], eax
mov dword [edi + 0x14], edx
mov dword [edi + 0x18], esi
mov dword [edi + 0x1c], esi
mov dword [edi + 0x20], esi
mov dword [edi + 0x24], esi
mov ecx, dword [0x411530]
mov edx, dword [0x41153c]
push eax
mov eax, dword [0x4113dc]
push eax
push esi
push ecx
push edx
call dword [sym.imp.GDI32.dll_GetDIBits]
test eax, eax
jne 0x401758
push edi
jmp 0x401a2d
mov dword [ebp], 0x28
mov eax, dword [edi + 4]
mov dword [ebp + 4], eax
mov ecx, dword [edi + 8]
mov dword [ebp + 8], ecx
mov ecx, dword [esp + 0x18]
mov word [ebp + 0xc], 1
mov dx, word [edi + 0xe]
mov word [ebp + 0xe], dx
mov dword [ebp + 0x10], 0x78637372
mov dword [ebp + 0x14], esi
mov dword [ebp + 0x18], esi
mov dword [ebp + 0x1c], esi
mov dword [ebp + 0x20], esi
mov dword [ebp + 0x24], esi
mov eax, dword [edi + 0x14]
mov dword [esp + 0x20], eax
xor ebx, ebx
mov bl, byte [ecx]
mov eax, ecx
xor edx, edx
and ebx, 0x1ff
mov dl, byte [eax + 1]
mov ecx, 0x2000
shl ebx, 5
and edx, 0x3fff
lea edi, [esp + 0x28]
xor ebx, edx
xor edx, edx
xor eax, eax
mov dword [esp + 0x14], esi
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x10]
and ebx, 0x1ff
shl ebx, 5
mov al, byte [ecx + edx + 0x2a]
lea edi, [ecx + 0x28]
and eax, 0xff
mov ecx, edx
and eax, 0x3fff
and ecx, 0xffff0000
xor ebx, eax
xor eax, eax
mov ax, word [esp + ebx*2 + 0x28]
mov word [esp + ebx*2 + 0x28], dx
add eax, ecx
cmp eax, edx
jb 0x401817
cmp eax, 0x10000
jb 0x40180f
sub eax, 0x10000
cmp eax, edx
jae 0x401980
mov cl, byte [eax + edi]
mov edi, dword [esp + 0x10]
add edi, 0x28
cmp cl, byte [edx + edi]
jne 0x401980
mov edi, edx
sub edi, eax
dec edi
cmp edi, 0x1fff
mov dword [esp + 0x1c], edi
ja 0x401980
mov edi, dword [esp + 0x20]
lea ecx, [edx + 4]
cmp ecx, edi
jae 0x401980
mov ecx, dword [esp + 0x10]
lea edi, [ecx + 0x28]
mov cl, byte [ecx + eax + 0x29]
mov edi, dword [esp + 0x10]
add edi, 0x28
cmp cl, byte [edi + edx + 1]
jne 0x401980
mov ecx, dword [esp + 0x10]
lea edi, [ecx + 0x28]
mov cl, byte [ecx + edx + 0x2a]
cmp byte [edi + eax + 2], cl
jne 0x401980
mov ecx, dword [esp + 0x20]
sub ecx, edx
sub ecx, 2
cmp ecx, 0x108
mov dword [esp + 0x24], ecx
jbe 0x40189c
mov dword [esp + 0x24], 0x108
mov edi, dword [esp + 0x10]
mov ecx, 2
add edi, 0x28
sub eax, edx
lea edi, [edx + edi + 2]
inc ecx
inc edi
cmp ecx, dword [esp + 0x24]
mov dword [esp + 0x18], ecx
je 0x4018c5
mov cl, byte [edi]
cmp cl, byte [eax + edi]
mov ecx, dword [esp + 0x18]
je 0x4018ae
mov eax, dword [esp + 0x14]
lea edi, [eax + esi + 5]
cmp edi, dword [esp + 0x20]
jae 0x401a28
test eax, eax
je 0x40190a
mov cl, al
mov edi, edx
add cl, 0x1f
sub edi, eax
shl cl, 3
mov byte [esi + ebp + 0x28], cl
mov ecx, dword [esp + 0x10]
add ecx, 0x28
inc esi
add edi, ecx
mov cl, byte [edi]
mov byte [esi + ebp + 0x28], cl
inc esi
dec eax
inc edi
test eax, eax
jne 0x4018f5
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1c]
sub ecx, 2
cmp ecx, 6
ja 0x40191f
shr eax, 5
and al, 0xf8
or al, cl
jmp 0x40192d
shr eax, 5
or al, 7
mov byte [esi + ebp + 0x28], al
mov al, cl
inc esi
sub al, 7
mov edi, dword [esp + 0x10]
mov byte [esi + ebp + 0x28], al
mov al, byte [esp + 0x1c]
inc esi
add edi, 0x28
and ebx, 0x1ff
mov byte [esi + ebp + 0x28], al
inc esi
inc edx
xor eax, eax
shl ebx, 5
mov al, byte [edi + edx + 2]
and eax, 0x3fff
xor ebx, eax
mov word [esp + ebx*2 + 0x28], dx
inc edx
xor eax, eax
and ebx, 0x1ff
mov al, byte [edi + edx + 2]
and eax, 0x3fff
shl ebx, 5
xor ebx, eax
mov word [esp + ebx*2 + 0x28], dx
inc edx
dec ecx
jne 0x40195f
jmp 0x4019c8
mov eax, dword [esp + 0x14]
inc edx
inc eax
cmp eax, 0x20
mov dword [esp + 0x14], eax
jne 0x4019c8
mov eax, dword [esp + 0x20]
lea ecx, [esi + 0x22]
cmp ecx, eax
jae 0x401a28
mov eax, dword [esp + 0x10]
mov byte [esi + ebp + 0x28], 0xf8
inc esi
add eax, 0x28
lea edi, [edx + eax - 0x20]
mov eax, 0x20
mov cl, byte [edi]
mov byte [esi + ebp + 0x28], cl
mov ecx, dword [esp + 0x14]
inc esi
dec ecx
inc edi
dec eax
mov dword [esp + 0x14], ecx
jne 0x4019b4
cmp edx, dword [esp + 0x20]
jb 0x4017c9
mov eax, dword [esp + 0x14]
test eax, eax
je 0x401a0b
mov edi, dword [esp + 0x20]
lea ecx, [eax + esi + 3]
cmp ecx, edi
jae 0x401a28
mov cl, al
sub edx, eax
add cl, 0x1f
shl cl, 3
mov byte [esi + ebp + 0x28], cl
mov ecx, dword [esp + 0x10]
add ecx, 0x28
inc esi
add edx, ecx
mov cl, byte [edx]
mov byte [esi + ebp + 0x28], cl
inc esi
dec eax
inc edx
test eax, eax
jne 0x4019fe
mov eax, dword [esp + 0x10]
mov dword [ebp + 0x14], esi
push eax
call fcn.004067b9
add esp, 4
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8018
ret
mov edx, dword [esp + 0x10]
push edx
call fcn.004067b9
push ebp
call fcn.004067b9
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x8018
ret