Function at 0x519c1a
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, 0x61836c
call fcn.005d1d1c
sub esp, 0xb4
mov eax, dword [ebp + 0x18]
push ebx
and eax, 2
push esi
cmp al, 2
push edi
sete byte [ebp - 0x38]
xor ebx, ebx
mov edi, ecx
cmp byte [ebp - 0x38], bl
mov dword [ebp - 0x20], edi
jne 0x519c55
cmp dword [ebp + 0x14], ebx
jne 0x519c55
mov dword [edi], 5
jmp 0x51a260
mov eax, dword [ebp + 0x10]
mov dword [edi], ebx
mov esi, dword [ebp + 8]
mov dword [ebp - 0x84], ebx
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x7c], ebx
mov dword [ebp - 0x80], ebx
mov dword [eax], ebx
mov al, byte [ebp + 0x18]
and al, 1
mov dword [ebp - 0x8e], ebx
mov byte [ebp - 0x11], al
lea eax, [ebp - 0x74]
push eax
push 0x102
push esi
mov dword [ebp - 0x74], ebx
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x64], ebx
call fcn.005321ef
add esp, 0xc
cmp word [ebp - 0x74], 1
je 0x519cae
mov dword [edi], 0x1c
jmp 0x51a260
lea eax, [ebp - 0x78]
push eax
push 0x115
push esi
call fcn.005321ef
lea eax, [ebp - 0x84]
push eax
lea eax, [ebp - 0x7c]
push eax
push 0x152
push esi
call fcn.005321ef
movzx eax, word [ebp - 0x78]
movzx ecx, word [ebp - 0x7c]
sub eax, ecx
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x8e]
push eax
push 0x103
push esi
call fcn.005321ef
lea eax, [ebp - 0x80]
push eax
push 0x11c
push esi
call fcn.005321ef
lea eax, [ebp - 0x64]
push eax
push 0x106
push esi
call fcn.0052f361
add esp, 0x40
test eax, eax
jne 0x519d40
mov eax, dword [ebp - 0x40]
dec eax
je 0x519d30
push str.Cant_determine_TIFF_photometric
push 3
call fcn.005cee82
pop ecx
pop ecx
jmp 0x519ca3
push esi
mov ecx, edi
call fcn.0051a3db
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x64], eax
lea eax, [ebp - 0x1c]
push eax
push 0x100
push esi
call fcn.0052f361
lea eax, [ebp - 0x10]
push eax
push 0x101
push esi
call fcn.0052f361
lea eax, [ebp - 0x4c]
push eax
push 0x112
push esi
call fcn.005321ef
add esp, 0x24
cmp byte [ebp - 0x11], bl
je 0x519d7c
mov dword [ebp - 0x4c], 1
lea eax, [ebp - 0x70]
mov ecx, edi
push eax
lea eax, [ebp - 0x66]
push eax
lea eax, [ebp - 0x65]
push eax
movzx eax, word [ebp - 0x4c]
push eax
call fcn.0051903d
lea eax, [ebp - 0x8a]
push eax
push pe_nt_image_headers32
push esi
call fcn.0052f361
lea eax, [ebp - 0xa4]
push eax
push 0x11a
push esi
call fcn.0052f361
lea eax, [ebp - 0xa0]
push eax
push 0x11b
push esi
call fcn.0052f361
add esp, 0x24
cmp word [ebp - 0x80], 2
jne 0x519dde
cmp dword [ebp - 0x40], 1
jg 0x519ca3
push esi
mov byte [ebp - 0x11], bl
call fcn.005390ad
test eax, eax
pop ecx
je 0x519df0
mov byte [ebp - 0x11], 1
lea ecx, [ebp - 0x88]
call fcn.00524cad
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x44], ebx
lea esi, [eax + 7]
shr esi, 3
cmp byte [ebp - 0x38], bl
je 0x519e1c
lea esi, [eax + 0x1f]
mov dword [ebp - 0x44], 0x30
shr esi, 5
shl esi, 2
mov eax, esi
mov dword [ebp - 0x54], esi
imul eax, dword [ebp - 0x10]
add eax, dword [ebp - 0x44]
cmp dword [ebp - 0x70], 0xffffffff
mov ecx, eax
je 0x519e5b
mov edx, dword [ebp - 0x10]
lea ecx, [edx + 7]
shr ecx, 3
cmp byte [ebp - 0x38], bl
mov dword [ebp - 0x54], ecx
je 0x519e4d
lea ecx, [edx + 0x1f]
shr ecx, 5
shl ecx, 2
mov dword [ebp - 0x54], ecx
imul ecx, dword [ebp - 0x1c]
add ecx, dword [ebp - 0x44]
mov dword [ebp - 0x40], eax
cmp eax, ecx
ja 0x519e5e
mov dword [ebp - 0x40], ecx
lea ecx, [ebp - 0x60]
call fcn.0051a511
push dword [ebp - 0x40]
lea ecx, [ebp - 0x60]
call fcn.0051a51d
mov eax, dword [ebp - 0x58]
cmp eax, ebx
jne 0x519e83
mov dword [edi], 1
jmp 0x51a260
cmp byte [ebp - 0x38], bl
mov dword [ebp - 0x24], eax
je 0x519e93
mov ecx, dword [ebp - 0x44]
add eax, ecx
mov dword [ebp - 0x24], eax
push dword [ebp - 0x10]
mov ecx, edi
push 1
call fcn.0051a3b7
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x18]
shr eax, 3
and al, 1
cmp byte [ebp - 0x11], bl
mov byte [ebp + 0x1b], al
jne 0x51a02c
mov eax, dword [ebp - 0x1c]
push dword [ebp + 8]
mov dword [ebp - 0x28], eax
mov eax, esi
neg eax
add eax, eax
mov dword [ebp - 0x6c], eax
call fcn.00538b8d
push eax
call fcn.00537d12
pop ecx
cmp eax, ebx
pop ecx
mov dword [ebp - 0x3c], eax
jne 0x519efd
push str.No_space_for_strip_buffer
push dword [ebp + 8]
call fcn.005390a6
pop ecx
push eax
call fcn.00538c2a
pop ecx
mov dword [edi], 1
pop ecx
jmp 0x51a1a3
lea eax, [ebp - 0x50]
push eax
push 0x116
push dword [ebp + 8]
call fcn.005321ef
push dword [ebp + 8]
call fcn.00538bd4
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x28]
mov ecx, eax
add esp, 0x10
sub ecx, dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], eax
sbb eax, eax
and eax, ecx
cmp byte [ebp + 0x1b], bl
mov dword [ebp - 0x30], eax
je 0x519f36
mov dword [ebp - 0x6c], ebx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x18], ebx
cmp eax, ebx
jbe 0x51a18f
mov ecx, dword [ebp - 0x50]
mov edi, 0x6a13a0
mov edx, dword [ebp - 0x18]
add edx, ecx
cmp edx, eax
jbe 0x519f5d
sub eax, dword [ebp - 0x18]
mov dword [ebp - 0x28], eax
jmp 0x519f60
mov dword [ebp - 0x28], ecx
mov eax, dword [ebp - 0x28]
imul eax, dword [ebp - 0x48]
push eax
push dword [ebp - 0x3c]
push ebx
push dword [ebp - 0x18]
push dword [ebp + 8]
call fcn.005389b1
add esp, 0xc
push eax
push dword [ebp + 8]
call fcn.00537d71
add esp, 0x10
test eax, eax
jge 0x519f93
mov eax, dword [ebp - 0x20]
mov dword [eax], 0x14
mov eax, dword [ebp - 0x2c]
imul eax, esi
add eax, dword [ebp - 0x24]
cmp byte [ebp + 0x1b], bl
je 0x519fae
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x2c]
dec eax
imul eax, esi
add eax, dword [ebp - 0x24]
push dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x20]
push dword [ebp - 0x6c]
push dword [ebp - 0x30]
push dword [ebp - 0x28]
push esi
push dword [ebp - 0x48]
push eax
call fcn.0051a361
mov eax, dword [ebp - 0x28]
mov ecx, edi
sub dword [ebp - 0x2c], eax
call fcn.00506673
cmp dword [eax + 4], 1
jne 0x51a00b
mov ecx, edi
call fcn.00506673
cmp dword [eax], ebx
je 0x51a00b
mov ecx, edi
call fcn.00506673
mov ecx, edi
mov dword [ebp - 0x28], eax
call fcn.00506673
push dword [eax + 8]
mov eax, dword [ebp - 0x28]
push dword [ebp - 0x10]
push dword [ebp - 0x18]
call dword [eax]
neg eax
sbb eax, eax
inc eax
jmp 0x51a00d
xor eax, eax
cmp eax, ebx
jne 0x51a183
mov ecx, dword [ebp - 0x50]
mov eax, dword [ebp - 0x10]
add dword [ebp - 0x18], ecx
cmp dword [ebp - 0x18], eax
jb 0x519f4c
jmp 0x51a18c
lea ecx, [ebp - 0xc0]
call fcn.0051d241
lea eax, [ebp - 0x50]
push eax
push 0x142
push dword [ebp + 8]
call fcn.0052f361
lea eax, [ebp - 0x2c]
push eax
push 0x143
push dword [ebp + 8]
call fcn.0052f361
push dword [ebp + 8]
call fcn.00538962
push eax
call fcn.00537d12
add esp, 0x20
cmp eax, ebx
mov dword [ebp - 0x3c], eax
jne 0x51a07b
push str.No_space_for_tile_buffer
jmp 0x519ee1
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x18], ebx
cmp ecx, ebx
jbe 0x51a18f
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp - 0x2c]
xor edx, edx
div edi
mov eax, dword [ebp - 0x18]
sub edi, edx
lea edx, [edi + eax]
cmp edx, ecx
jbe 0x51a0a6
sub ecx, eax
mov dword [ebp - 0x48], ecx
jmp 0x51a0a9
mov dword [ebp - 0x48], edi
xor edi, edi
cmp dword [ebp - 0x1c], ebx
jbe 0x51a124
mov al, byte [ebp + 0x1b]
neg al
sbb eax, eax
and al, 0xf8
add eax, 8
mov dword [ebp - 0x30], eax
push ebx
push ebx
push dword [ebp - 0x18]
push edi
push dword [ebp - 0x3c]
push dword [ebp + 8]
call fcn.00538097
add esp, 0x18
test eax, eax
jge 0x51a0e0
mov eax, dword [ebp - 0x20]
mov dword [eax], 0x14
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0x2c]
cmp byte [ebp + 0x1b], bl
je 0x51a0f1
mov eax, dword [ebp - 0x18]
push dword [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x50]
push edi
lea ecx, [eax + 7]
shr ecx, 3
push ecx
lea ecx, [ebp - 0xc0]
push dword [ebp - 0x2c]
push eax
push dword [ebp - 0x3c]
push esi
push dword [ebp - 0x10]
push dword [ebp - 0x1c]
push dword [ebp - 0x24]
call fcn.0051d590
add edi, dword [ebp - 0x50]
cmp edi, dword [ebp - 0x1c]
jb 0x51a0bf
mov edi, 0x6a13a0
mov ecx, edi
call fcn.00506673
cmp dword [eax + 4], 1
jne 0x51a167
mov ecx, edi
call fcn.00506673
cmp dword [eax], ebx
je 0x51a167
mov ecx, edi
call fcn.00506673
mov ecx, edi
mov dword [ebp - 0x30], eax
call fcn.00506673
push dword [eax + 8]
mov eax, dword [ebp - 0x30]
push dword [ebp - 0x10]
push dword [ebp - 0x18]
call dword [eax]
neg eax
sbb eax, eax
inc eax
jmp 0x51a169
xor eax, eax
cmp eax, ebx
jne 0x51a183
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
add eax, dword [ebp - 0x48]
cmp eax, ecx
mov dword [ebp - 0x18], eax
jb 0x51a089
jmp 0x51a18c
mov eax, dword [ebp - 0x20]
mov dword [eax], 0xe
mov edi, dword [ebp - 0x20]
push dword [ebp - 0x3c]
call fcn.00537d17
mov eax, dword [edi]
pop ecx
cmp eax, ebx
je 0x51a1b0
cmp eax, 0x14
je 0x51a1b0
lea ecx, [ebp - 0x60]
call fcn.0051a61a
jmp 0x51a348
cmp dword [ebp - 0x70], 0xffffffff
jne 0x51a1d5
push dword [ebp - 0x38]
lea eax, [ebp - 0x10]
mov ecx, edi
push esi
push 1
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x4c]
call fcn.005190d6
mov dword [edi], eax
jmp 0x51a254
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], ebx
mov eax, dword [ebp - 0x40]
lea ecx, [ebp - 0x34]
sub eax, dword [ebp - 0x44]
mov dword [ebp - 4], ebx
push eax
mov dword [ebp + 0x18], eax
call fcn.0050702f
xor eax, eax
cmp dword [ebp - 0x34], ebx
jle 0x51a203
mov ecx, dword [ebp - 0x30]
mov byte [ecx + eax], bl
inc eax
cmp eax, dword [ebp - 0x34]
jl 0x51a1f7
cmp dword [ebp - 0x30], ebx
jne 0x51a210
mov dword [edi], 1
jmp 0x51a248
push dword [ebp - 0x38]
lea eax, [ebp - 0x10]
mov ecx, edi
push dword [ebp - 0x54]
push esi
push 1
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x30]
push dword [ebp - 0x24]
push dword [ebp - 0x4c]
call fcn.00519261
push dword [ebp + 0x18]
mov dword [edi], eax
push dword [ebp - 0x30]
push dword [ebp - 0x24]
call dword [0x6a1344]
mov esi, dword [ebp - 0x54]
add esp, 0xc
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x34]
call fcn.00521530
cmp dword [edi], ebx
je 0x51a267
lea ecx, [ebp - 0x60]
call fcn.0051a61a
xor eax, eax
jmp 0x51a350
cmp word [ebp - 0x64], 1
jne 0x51a290
mov eax, esi
xor ecx, ecx
imul eax, dword [ebp - 0x10]
test eax, eax
jbe 0x51a290
mov eax, dword [ebp - 0x24]
or dl, 0xff
sub dl, byte [eax]
mov byte [eax], dl
mov edx, esi
imul edx, dword [ebp - 0x10]
inc eax
inc ecx
cmp ecx, edx
jb 0x51a27d
cmp byte [ebp - 0x38], bl
je 0x51a321
lea eax, [ebp - 0x9c]
mov ecx, edi
push eax
push dword [ebp + 8]
call fcn.00519433
push 4
lea eax, [ebp - 0x9c]
push 1
push eax
lea ecx, [ebp - 0x88]
call fcn.0050b040
mov eax, dword [ebp - 0x58]
mov dword [eax], 0x28
mov ecx, dword [ebp - 0x1c]
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x10]
mov dword [eax + 8], ecx
mov word [eax + 0xc], 1
mov word [eax + 0xe], 1
mov dword [eax + 0x10], ebx
imul esi, dword [ebp - 0x10]
mov dword [eax + 0x14], esi
mov ecx, dword [ebp - 0x9c]
mov dword [eax + 0x18], ecx
mov ecx, dword [ebp - 0x98]
mov dword [eax + 0x1c], ecx
mov dword [eax + 0x20], 2
mov dword [eax + 0x24], ebx
mov eax, dword [ebp - 0x58]
or byte [eax + 0x28], 0xff
or byte [eax + 0x29], 0xff
or byte [eax + 0x2a], 0xff
mov byte [eax + 0x2c], bl
mov byte [eax + 0x2d], bl
mov byte [eax + 0x2e], bl
jmp 0x51a338
mov eax, dword [ebp + 0x14]
or byte [eax], 0xff
or byte [eax + 1], 0xff
or byte [eax + 2], 0xff
mov byte [eax + 4], bl
mov byte [eax + 5], bl
mov byte [eax + 6], bl
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x1c]
mov dword [ecx], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x10]
mov dword [eax], ecx
lea ecx, [ebp - 0x60]
call fcn.0051a67e
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 0x14