Function at 0x180114c60
Capabilities:
Encode data using xor

Disassembly:
push rbx
push rdi
sub rsp, 0x38
mov rbx, rcx
mov rdi, rdx
mov rcx, qword [rcx + 0x248]
test rcx, rcx
je 0x180115842
mov eax, dword [rbx + 0x168]
and eax, 0x4040
cmp eax, 0x4000
je 0x180115852
mov qword [rsp + 0x50], rbp
lea rbp, [rbx + 0x16c]
mov eax, dword [rbp]
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x60], r12
mov r12d, 4
mov qword [rsp + 0x68], r14
mov r14, rbp
mov qword [rsp + 0x30], r15
mov r15d, 7
bt eax, 0xc
jae 0x180114edb
movzx r8d, byte [rdx + 0x10]
movzx edx, word [rbx + 0x280]
cmp r8b, 3
jne 0x180114d0c
mov rax, qword [rbx + 0x308]
lea r8, [rcx + 1]
mov r9, qword [rbx + 0x270]
mov rcx, rbx
mov dword [rsp + 0x28], edx
mov rdx, rdi
mov qword [rsp + 0x20], rax
call fcn.180113e80
jmp 0x180114edb
test dx, dx
je 0x180114d36
bt eax, 0x19
jae 0x180114d2f
lea rdx, [rcx + 1]
mov rcx, rdi
lea r8, [rbx + 0x310]
call fcn.180113970
jmp 0x180114edb
lea r14, [rbx + 0x16c]
mov r11d, dword [rdi]
lea rdx, [rcx + 1]
test r8b, r8b
jne 0x180114edb
movzx eax, byte [rdi + 0x11]
cmp al, 8
jae 0x180114edb
mov ecx, eax
sub ecx, 1
je 0x180114e5f
sub ecx, 1
je 0x180114de1
cmp ecx, 2
jne 0x180114ec8
lea eax, [r11 - 1]
mov r9d, r12d
mov r8d, eax
lea r10, [r11 - 1]
and eax, 1
shr r8, 1
shl eax, 2
add r8, rdx
sub r9d, eax
add r10, rdx
mov esi, r11d
test r11d, r11d
je 0x180114ec8
nop word [rax + rax]
movzx edx, byte [r8]
lea r10, [r10 - 1]
movzx ecx, r9b
shr dl, cl
movzx eax, dl
shl dl, 4
and al, 0xf
xor al, dl
mov byte [r10 + 1], al
cmp r9d, r12d
lea rax, [r8 - 1]
cmovne rax, r8
mov r8, rax
xor eax, eax
cmp r9d, r12d
cmovne eax, r12d
mov r9d, eax
sub rsi, 1
jne 0x180114da0
jmp 0x180114ec8
lea eax, [r11 - 1]
mov r8d, 6
mov r9d, eax
lea r10, [r11 - 1]
and eax, 3
shr r9, 2
add eax, eax
add r9, rdx
sub r8d, eax
add r10, rdx
mov rsi, r11
test r11d, r11d
je 0x180114ec8
movzx edx, byte [r9]
lea r10, [r10 - 1]
movzx ecx, r8b
shr dl, cl
lea ecx, [r8 + 2]
and dl, 3
movzx eax, dl
shl al, 2
or al, dl
shl al, 2
or al, dl
shl al, 2
or al, dl
cmp r8d, 6
mov byte [r10 + 1], al
lea rax, [r9 - 1]
cmovne rax, r9
mov r9, rax
mov eax, r8d
xor r8d, r8d
cmp eax, 6
cmovne r8d, ecx
sub rsi, 1
jne 0x180114e10
jmp 0x180114ec8
lea eax, [r11 - 1]
mov r9, r11
mov r8d, eax
lea r10, [r11 - 1]
add r10, rdx
shr r8, 3
add r8, rdx
and eax, r15d
mov edx, r15d
sub edx, eax
test r11d, r11d
je 0x180114ec8
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [r8]
lea r10, [r10 - 1]
movzx ecx, dl
shr al, cl
lea ecx, [rdx + 1]
and al, 1
neg al
sbb al, al
cmp edx, r15d
mov byte [r10 + 1], al
lea rax, [r8 - 1]
cmovne rax, r8
mov r8, rax
mov eax, edx
xor edx, edx
cmp eax, r15d
cmovne edx, ecx
sub r9, 1
jne 0x180114e90
mov byte [rdi + 0x11], 8
lea r14, [rbx + 0x16c]
mov byte [rdi + 0x13], 8
mov qword [rdi + 8], r11
mov eax, dword [rbp]
mov rsi, r14
and eax, 0x40080
cmp eax, 0x40000
jne 0x180114f16
movzx eax, byte [rdi + 0x10]
cmp al, 6
je 0x180114f01
cmp al, r12b
jne 0x180114f16
lea rsi, [rbx + 0x16c]
mov rdx, qword [rbx + 0x248]
xor r8d, r8d
inc rdx
mov rcx, rdi
call fcn.180117500
test dword [r14], 0x600000
mov rbp, rsi
je 0x180114f79
mov r8, qword [rbx + 0x248]
mov rdx, rdi
inc r8
mov rcx, rbx
call fcn.180115890
test eax, eax
je 0x180114f79
mov eax, dword [r14]
and eax, 0x600000
mov byte [rbx + 0x3f0], 1
cmp eax, 0x400000
jne 0x180114f67
lea rdx, str.png_do_rgb_to_gray_found_nongray_pixel
mov rcx, rbx
call fcn.18010ebf0
lea rbp, [rbx + 0x16c]
mov eax, dword [rsi]
and eax, 0x600000
cmp eax, 0x200000
je 0x180115862
test dword [rsi], 0x4000
je 0x180114fa2
test dword [rbx + 0x164], 0x800
mov rsi, rbp
jne 0x180114fa2
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.180114620
test byte [rsi], 0x80
je 0x180114fbc
mov rdx, qword [rbx + 0x248]
mov r8, rbx
inc rdx
mov rcx, rdi
call fcn.180112760
mov ecx, dword [rsi]
mov r14, rsi
mov eax, ecx
and eax, 0x602000
cmp eax, 0x2000
jne 0x18011500b
test cl, cl
jns 0x180114fed
cmp word [rbx + 0x280], 0
jne 0x18011500b
test byte [rbx + 0x287], r12b
jne 0x18011500b
lea r14, [rbx + 0x16c]
cmp byte [rbx + 0x287], 3
je 0x18011500b
mov rdx, qword [rbx + 0x248]
mov r8, rbx
inc rdx
mov rcx, rdi
call fcn.180114180
mov eax, dword [r14]
and eax, 0x40080
cmp eax, 0x40080
jne 0x18011503a
movzx eax, byte [rdi + 0x10]
sub al, r12b
test al, 0xfd
jne 0x18011503a
mov rdx, qword [rbx + 0x248]
xor r8d, r8d
inc rdx
mov rcx, rdi
call fcn.180117500
test dword [r14], 0x800000
mov esi, 3
je 0x18011512f
movzx eax, byte [rdi + 0x10]
test r12b, al
je 0x18011512f
movzx ecx, byte [rdi + 0x11]
mov rbp, qword [rbx + 0x248]
mov r8d, dword [rdi]
cmp cl, 8
jne 0x1801150b5
mov r10, qword [rbx + 0x2d8]
test r10, r10
je 0x180115120
and al, 2
mov r9d, 2
mov edx, r9d
cmovne rdx, r12
add rdx, rbp
test r8d, r8d
je 0x18011512f
test al, al
cmovne r9, r12
nop dword [rax]
movzx eax, byte [rdx]
movzx ecx, byte [rax + r10]
mov byte [rdx], cl
add rdx, r9
add r8d, 0xffffffff
jne 0x1801150a0
jmp 0x18011512f
cmp cl, 0x10
jne 0x180115120
mov r11, qword [rbx + 0x2e8]
test r11, r11
je 0x180115120
and al, 2
mov r9, rsi
cmovne r9, r15
add r9, rbp
test r8d, r8d
je 0x18011512f
movzx ebp, byte [rbx + 0x2c0]
test al, al
mov r10, r12
mov ecx, 8
cmovne r10, rcx
nop dword [rax]
movzx eax, byte [r9 + 1]
mov rcx, rbp
shr rax, cl
movzx ecx, byte [r9]
mov rax, qword [r11 + rax*8]
movzx edx, word [rax + rcx*2]
movzx eax, dx
mov byte [r9 + 1], dl
shr ax, 8
mov byte [r9], al
add r9, r10
add r8d, 0xffffffff
jne 0x1801150f0
jmp 0x18011512f
lea rdx, str.png_do_encode_alpha:_unexpected_call
mov rcx, rbx
call fcn.18010ebf0
mov ecx, dword [rbx + 0x16c]
mov r9d, ecx
bt ecx, 0x1a
jae 0x1801151a9
cmp byte [rdi + 0x11], 0x10
jne 0x1801151a9
mov rdx, qword [rbx + 0x248]
mov r10, qword [rdi + 8]
inc rdx
add r10, rdx
mov r8, rdx
cmp rdx, r10
jae 0x18011518f
nop dword [rax]
movzx ecx, byte [rdx]
lea r8, [r8 + 1]
movzx eax, byte [rdx + 1]
add rdx, 2
sub eax, ecx
sub eax, 0xffffff80
imul eax, eax, 0xffff
sar eax, 0x18
add ecx, eax
mov byte [r8 - 1], cl
cmp rdx, r10
jb 0x180115160
mov r9d, dword [rbx + 0x16c]
movzx ecx, byte [rdi + 0x12]
movzx eax, cl
mov byte [rdi + 0x11], 8
shl al, 3
imul ecx, dword [rdi]
mov byte [rdi + 0x13], al
mov eax, ecx
mov qword [rdi + 8], rax
mov r10d, r9d
bt r9d, 0xa
jae 0x180115213
cmp byte [rdi + 0x11], 0x10
jne 0x180115213
mov rcx, qword [rbx + 0x248]
mov r8, qword [rdi + 8]
inc rcx
add r8, rcx
mov rdx, rcx
cmp rcx, r8
jae 0x1801151f9
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [rcx]
add rcx, 2
mov byte [rdx], al
lea rdx, [rdx + 1]
cmp rcx, r8
jb 0x1801151e0
mov r10d, dword [rbx + 0x16c]
movzx ecx, byte [rdi + 0x12]
movzx eax, cl
mov byte [rdi + 0x11], 8
shl al, 3
imul ecx, dword [rdi]
mov byte [rdi + 0x13], al
mov eax, ecx
mov qword [rdi + 8], rax
test r10b, 0x40
je 0x180115244
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
mov r9, qword [rbx + 0x3a0]
inc rdx
mov r8, qword [rbx + 0x398]
call fcn.1801147e0
cmp qword [rdi + 8], 0
je 0x180115872
mov r9d, dword [rbx + 0x16c]
mov ecx, r9d
bt r9d, 9
jae 0x1801152b5
cmp byte [rdi + 0x11], 8
jne 0x1801152b5
cmp byte [rdi + 0x10], sil
je 0x1801152b5
mov rcx, qword [rdi + 8]
lea r8, [rcx + 1]
add r8, qword [rbx + 0x248]
lea rdx, [rcx + r8]
mov ecx, r9d
cmp rdx, r8
jbe 0x18011529c
nop dword [rax]
movzx eax, byte [r8 - 1]
dec r8
mov byte [rdx - 1], al
add rdx, 0xfffffffffffffffe
mov byte [rdx], al
cmp rdx, r8
ja 0x180115280
mov ecx, dword [rbx + 0x16c]
mov rax, qword [rdi + 8]
add rax, rax
mov byte [rdi + 0x11], reloc.WS2_32.dll_recv
mov qword [rdi + 8], rax
movzx eax, byte [rdi + 0x12]
shl al, 4
mov byte [rdi + 0x13], al
bt ecx, 0xe
jae 0x1801152d9
test dword [rbx + 0x164], 0x800
je 0x1801152d9
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.180114620
test byte [rbx + 0x16c], 0x20
je 0x1801152f4
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1801173a0
test dword [rbx + 0x16c], 0x80000
je 0x1801153fe
mov rcx, qword [rbx + 0x248]
movzx eax, byte [rdi + 0x10]
inc rcx
mov r8d, dword [rdi]
cmp al, 6
jne 0x180115391
add rcx, qword [rdi + 8]
cmp byte [rdi + 0x11], 8
jne 0x18011535b
mov r9, rcx
test r8d, r8d
je 0x1801153fe
mov edx, r8d
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [rcx - 1]
sub rcx, r12
not al
mov byte [r9 - 1], al
mov r9, rcx
sub rdx, 1
jne 0x180115340
jmp 0x1801153fe
mov rdx, rcx
test r8d, r8d
je 0x1801153fe
mov r9, r8
nop word [rax + rax]
movzx eax, byte [rcx - 1]
not al
mov byte [rdx - 1], al
movzx eax, byte [rcx - 2]
sub rcx, 8
not al
mov byte [rdx - 2], al
mov rdx, rcx
sub r9, 1
jne 0x180115370
jmp 0x1801153fe
cmp al, r12b
jne 0x1801153fe
mov rax, qword [rdi + 8]
add rcx, rax
cmp byte [rdi + 0x11], 8
mov rdx, rcx
jne 0x1801153ce
test r8d, r8d
je 0x1801153fe
mov r9, r8
nop
movzx eax, byte [rcx - 1]
lea rcx, [rcx - 2]
lea rdx, [rdx - 2]
not al
mov byte [rdx + 1], al
movzx eax, byte [rcx]
mov byte [rdx], al
sub r9, 1
jne 0x1801153b0
jmp 0x1801153fe
test r8d, r8d
je 0x1801153fe
mov r9, r8
nop word [rax + rax]
movzx eax, byte [rcx - 1]
not al
mov byte [rdx - 1], al
movzx eax, byte [rcx - 2]
sub rcx, r12
not al
mov byte [rdx - 2], al
mov rdx, rcx
sub r9, 1
jne 0x1801153e0
test byte [rbx + 0x16c], 8
je 0x180115420
mov rdx, qword [rbx + 0x248]
lea r8, [rbx + 0x2fd]
inc rdx
mov rcx, rdi
call fcn.180115dc0
test byte [rbx + 0x16c], r12b
je 0x1801155a3
mov r8, qword [rbx + 0x248]
movzx eax, byte [rdi + 0x11]
inc r8
cmp al, 8
jae 0x1801155a3
mov r10d, dword [rdi]
mov ecx, eax
sub ecx, 1
je 0x180115526
sub ecx, 1
je 0x1801154c8
cmp ecx, 2
jne 0x180115588
lea eax, [r10 - 1]
mov r11d, r10d
mov edx, eax
lea r9, [r10 - 1]
add r9, r8
shr rdx, 1
add rdx, r8
and eax, 1
mov r8d, 1
sub r8d, eax
shl r8d, 2
test r10d, r10d
je 0x180115588
nop
movzx eax, byte [rdx]
lea r9, [r9 - 1]
movzx ecx, r8b
shr al, cl
and al, 0xf
mov byte [r9 + 1], al
cmp r8d, r12d
lea rax, [rdx - 1]
cmovne rax, rdx
mov rdx, rax
xor eax, eax
cmp r8d, r12d
cmovne eax, r12d
mov r8d, eax
sub r11, 1
jne 0x180115490
jmp 0x180115588
lea eax, [r10 - 1]
mov r9, r10
mov edx, eax
and eax, esi
shr rdx, 2
sub esi, eax
add rdx, r8
add esi, esi
dec r8
add r8, r10
test r10d, r10d
je 0x180115588
nop dword [rax]
movzx eax, byte [rdx]
lea r8, [r8 - 1]
movzx ecx, sil
shr al, cl
and al, 3
mov byte [r8 + 1], al
cmp esi, 6
lea rax, [rdx - 1]
cmovne rax, rdx
xor ecx, ecx
cmp esi, 6
mov rdx, rax
lea eax, [rsi + 2]
cmovne ecx, eax
mov esi, ecx
sub r9, 1
jne 0x1801154f0
jmp 0x180115588
lea eax, [r10 - 1]
mov r9, r10
mov edx, eax
and eax, r15d
shr rdx, 3
sub r15d, eax
add rdx, r8
dec r8
add r8, r10
test r10d, r10d
je 0x180115588
nop word [rax + rax]
movzx eax, byte [rdx]
lea r8, [r8 - 1]
movzx ecx, r15b
shr al, cl
and al, 1
mov byte [r8 + 1], al
cmp r15d, 7
lea rax, [rdx - 1]
cmovne rax, rdx
xor ecx, ecx
cmp r15d, 7
mov rdx, rax
lea eax, [r15 + 1]
cmovne ecx, eax
mov r15d, ecx
sub r9, 1
jne 0x180115550
movzx ecx, byte [rdi + 0x12]
movzx eax, cl
mov byte [rdi + 0x11], 8
shl al, 3
imul ecx, r10d
mov byte [rdi + 0x13], al
mov eax, ecx
mov qword [rdi + 8], rax
cmp byte [rdi + 0x10], 3
lea rsi, [rdi + 0x10]
jne 0x1801155c5
cmp dword [rbx + 0x27c], 0
jl 0x1801155c5
mov rdx, rdi
mov rcx, rbx
call fcn.180117200
lea rsi, [rdi + 0x10]
test byte [rbx + 0x16c], 1
je 0x1801155e0
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.180117100
test dword [rbx + 0x16c], 0x10000
mov rbp, rsi
je 0x180115605
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.180117490
lea rbp, [rdi + 0x10]
test dword [rbx + 0x16c], 0x8000
je 0x180115635
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
movzx r8d, word [rbx + 0x292]
inc rdx
mov r9d, dword [rbx + 0x168]
call fcn.180114940
mov rsi, rbp
test dword [rbx + 0x16c], 0x20000
je 0x180115790
mov rdx, qword [rbx + 0x248]
movzx eax, byte [rsi]
inc rdx
mov ecx, dword [rdi]
cmp al, 6
jne 0x180115712
mov rax, qword [rdi + 8]
add rax, rdx
cmp byte [rdi + 0x11], 8
jne 0x1801156b1
mov r8, rax
test ecx, ecx
je 0x180115790
mov r9d, ecx
nop word [rax + rax]
movzx ecx, byte [rax - 2]
lea r8, [r8 - 4]
movzx edx, byte [rax - 1]
lea rax, [rax - 4]
mov byte [r8 + 3], cl
movzx ecx, byte [rax + 1]
mov byte [r8 + 2], cl
movzx ecx, byte [rax]
mov byte [r8 + 1], cl
mov byte [r8], dl
sub r9, 1
jne 0x180115680
jmp 0x180115790
mov r9, rax
test ecx, ecx
je 0x180115790
mov r10, rcx
nop
movzx ecx, byte [rax - 3]
lea r9, [r9 - 8]
movzx edx, byte [rax - 1]
movzx r8d, byte [rax - 2]
lea rax, [rax - 8]
mov byte [r9 + 7], cl
movzx ecx, byte [rax + 4]
mov byte [r9 + 6], cl
movzx ecx, byte [rax + 3]
mov byte [r9 + 5], cl
movzx ecx, byte [rax + 2]
mov byte [r9 + 4], cl
movzx ecx, byte [rax + 1]
mov byte [r9 + 3], cl
movzx ecx, byte [rax]
mov byte [r9 + 2], cl
mov byte [r9 + 1], dl
mov byte [r9], r8b
sub r10, 1
jne 0x1801156c0
jmp 0x180115790
cmp al, r12b
jne 0x180115790
cmp byte [rdi + 0x11], 8
mov rax, qword [rdi + 8]
jne 0x18011574e
add rdx, rax
mov r8, rdx
test ecx, ecx
je 0x180115790
mov r9, rcx
nop
movzx ecx, byte [rdx - 1]
lea rdx, [rdx - 2]
movzx eax, byte [rdx]
mov byte [r8 - 1], al
lea r8, [r8 - 2]
mov byte [r8], cl
sub r9, 1
jne 0x180115730
jmp 0x180115790
lea r8, [rax + rdx]
mov r9, r8
test ecx, ecx
je 0x180115790
mov r10, rcx
nop dword [rax]
movzx eax, byte [r8 - 3]
lea r9, [r9 - 4]
movzx ecx, byte [r8 - 1]
movzx edx, byte [r8 - 2]
lea r8, [r8 - 4]
mov byte [r9 + 3], al
movzx eax, byte [r8]
mov byte [r9 + 2], al
mov byte [r9 + 1], cl
mov byte [r9], dl
sub r10, 1
jne 0x180115760
test byte [rbx + 0x16c], 0x10
je 0x1801157ab
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1801176b0
test dword [rbx + 0x16c], 0x100000
je 0x180115822
mov rax, qword [rbx + 0x148]
test rax, rax
je 0x1801157d5
mov r8, qword [rbx + 0x248]
mov rdx, rdi
inc r8
mov rcx, rbx
call rax
movzx eax, byte [rbx + 0x160]
test al, al
je 0x1801157e3
mov byte [rdi + 0x11], al
movzx eax, byte [rbx + 0x161]
test al, al
je 0x1801157f1
mov byte [rdi + 0x12], al
movzx eax, byte [rdi + 0x12]
movzx ecx, byte [rdi + 0x11]
imul ecx, eax
movzx eax, cl
mov ecx, dword [rdi]
mov byte [rdi + 0x13], al
cmp al, 8
jb 0x180115812
shr rax, 3
imul rax, rcx
jmp 0x18011581e
imul rax, rcx
add rax, 7
shr rax, 3
mov qword [rdi + 8], rax
mov r14, qword [rsp + 0x68]
mov r12, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x50]
mov r15, qword [rsp + 0x30]
add rsp, 0x38
pop rdi
pop rbx
ret
lea rdx, str.NULL_row_buffer
mov rcx, rbx
call fcn.18010e620
int3
lea rdx, str.Uninitialized_row
mov rcx, rbx
call fcn.18010e620
int3
lea rdx, str.png_do_rgb_to_gray_found_nongray_pixel
mov rcx, rbx
call fcn.18010e620
int3
lea rdx, str.png_do_quantize_returned_rowbytes0
mov rcx, rbx
call fcn.18010e620
int3