Function at 0x512f00
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6463ae
mov eax, dword fs:[0]
push eax
sub esp, 0x464
mov eax, dword [0x6ae654]
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 ebx, dword [ebp + 8]
lea eax, [ebp - 0x470]
push eax
mov ecx, ebx
mov dword [ebp - 0x434], ebx
mov dword [ebp - 4], 0
call fcn.0050fd90
mov esi, eax
mov eax, dword [ebp - 0x470]
cdq
mov ecx, esi
push edx
push eax
call fcn.0052c7f0
lea eax, [ebp - 0x418]
push eax
call sub.jpeg62.dll_Ordinal_89
push 0x1b0
mov dword [ebp - 0x394], eax
lea eax, [ebp - 0x394]
push 0x3e
push eax
mov dword [ebp - 0x418], 0x512930
call sub.jpeg62.dll_Ordinal_31
add esp, 0x10
lea ecx, [ebp - 0x40]
call fcn.00524180
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 1
push eax
push 2
lea eax, [ebp - 0x394]
push esi
push eax
call fcn.00514100
add esp, 0x10
lea eax, [ebp - 0x394]
push 1
push eax
call sub.jpeg62.dll_Ordinal_75
add esp, 8
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x64]
call fcn.00522a20
mov ecx, 0x6c3904
mov byte [ebp - 4], 3
call fcn.0043e8b0
lea ecx, [ebp - 0x64]
push ecx
push eax
call fcn.0051c420
add esp, 8
lea eax, [ebp - 0x64]
push eax
call fcn.0052a160
add esp, 4
test eax, eax
je 0x513110
lea eax, [ebp - 0x64]
push eax
call fcn.0052a410
add esp, 4
test eax, eax
je 0x513110
lea ecx, [ebp - 0x88]
call fcn.00522a20
push 0x6c3760
push 0x6c373c
lea eax, [ebp - 0x64]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x88]
push eax
call fcn.0052a9e0
add esp, 0x10
lea ecx, [ebp - 0x40]
call fcn.0046ee30
mov esi, eax
test esi, esi
jle 0x513105
push 0x48
call fcn.005a4b81
add esp, 4
mov dword [ebp - 0x43c], eax
mov byte [ebp - 4], 5
test eax, eax
je 0x513081
push 0
push 2
push 3
lea ecx, [ebp - 0x88]
push ecx
mov ecx, eax
call fcn.0052b190
jmp 0x513083
xor eax, eax
push eax
lea ecx, [ebp - 0x464]
mov byte [ebp - 4], 4
call fcn.0048e6d0
mov eax, dword [ebp - 0x464]
sub esp, 8
mov ecx, esp
mov byte [ebp - 4], 6
mov dword [ecx], eax
mov eax, dword [ebp - 0x460]
mov dword [ecx + 4], eax
test eax, eax
je 0x5130bd
mov ecx, 1
add eax, 4
lock xadd dword [eax], ecx
lea ecx, [ebp - 0x1e4]
call fcn.00524ee0
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 7
call fcn.00522e30
push esi
push eax
lea ecx, [ebp - 0x1e4]
call fcn.00525310
mov eax, dword [ebx]
lea ecx, [ebp - 0x88]
push ecx
mov ecx, ebx
call dword [eax + 8]
lea ecx, [ebp - 0x1e4]
call fcn.00525070
lea ecx, [ebp - 0x464]
call fcn.004113b0
lea ecx, [ebp - 0x88]
call fcn.00522a50
lea ecx, [ebp - 0x64]
call fcn.00522a50
jmp 0x513126
lea eax, [ebp - 0x394]
mov dword [ebp - 4], 1
push eax
call sub.jpeg62.dll_Ordinal_87
add esp, 4
mov ecx, ebx
call fcn.00446840
mov edi, eax
mov ecx, ebx
mov dword [ebp - 0x454], edi
call fcn.0041d290
mov ecx, eax
mov ebx, edi
mov eax, dword [ebp - 0x32c]
mov esi, 0x100
imul ebx, eax
cmp ecx, esi
mov dword [ebp - 0x440], ecx
cmovl esi, ecx
mov dword [ebp - 0x448], eax
lea ecx, [ebp - 0xa4]
mov dword [ebp - 0x420], ebx
imul esi, ebx
call fcn.00524180
push esi
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 9
call fcn.00524c30
mov ecx, dword [ebp - 0x434]
mov dword [ebp - 0x444], eax
call fcn.004471e0
push eax
lea ecx, [ebp - 0x19c]
call fcn.0057e300
mov esi, dword [ebp - 0x440]
lea eax, [ebp - 0x24]
push eax
push 1
lea ecx, [ebp - 0x19c]
mov byte [ebp - 4], 0xa
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], esi
call fcn.0057e5f0
mov eax, esi
mov esi, 0x100
cdq
idiv esi
test edx, edx
lea ecx, [eax + 1]
cmove ecx, eax
mov eax, edi
cdq
idiv esi
mov dword [ebp - 0x43c], ecx
test edx, edx
lea esi, [eax + 1]
cmove esi, eax
xor edx, edx
mov dword [ebp - 0x458], esi
xor eax, eax
mov dword [ebp - 0x430], edx
mov dword [ebp - 0x45c], eax
cmp eax, ecx
jge 0x51355e
lea ecx, [edx + 0x100]
cmp ecx, dword [ebp - 0x440]
cmovg ecx, dword [ebp - 0x440]
sub ecx, edx
mov dword [ebp - 0x42c], ecx
test ecx, ecx
jle 0x513287
mov esi, dword [ebp - 0x444]
mov edi, ecx
nop
push 1
lea eax, [ebp - 0x468]
mov dword [ebp - 0x468], esi
push eax
lea eax, [ebp - 0x394]
push eax
call sub.jpeg62.dll_Ordinal_77
add esp, 0xc
add esi, ebx
sub edi, 1
jne 0x513250
mov edx, dword [ebp - 0x430]
mov edi, dword [ebp - 0x454]
mov esi, dword [ebp - 0x458]
xor eax, eax
xor ecx, ecx
mov dword [ebp - 0x450], ecx
cmp ecx, esi
jge 0x51352b
lea ecx, [eax + 0x100]
cmp ecx, edi
mov dword [ebp - 0x460], ecx
mov esi, ecx
lea ecx, [ebp - 0x19c]
cmovg esi, edi
mov edi, eax
imul edi, dword [ebp - 0x448]
sub esi, eax
push edx
push eax
mov dword [ebp - 0x438], esi
add edi, dword [ebp - 0x444]
call fcn.0057e5d0
mov eax, dword [ebp - 0x448]
sub eax, 1
je 0x51345e
sub eax, 2
je 0x5133bd
sub eax, 1
jne 0x5134a9
lea ecx, [ebp - 0x19c]
call fcn.0041d290
mov esi, eax
lea ecx, [ebp - 0x19c]
mov dword [ebp - 0x424], esi
call fcn.004ad4e0
mov ecx, dword [ebp - 0x438]
mov dword [ebp - 0x44c], eax
mov eax, dword [ebp - 0x42c]
shl ecx, 2
mov dword [ebp - 0x41c], ecx
test eax, eax
jle 0x5134a9
mov edx, dword [ebp - 0x44c]
mov dword [ebp - 0x428], eax
nop
test ecx, ecx
jle 0x5133a3
lea eax, [esi + 1]
mov ebx, edi
sub ebx, esi
lea edx, [edi + 3]
lea esi, [ecx - 1]
shr esi, 2
inc esi
movzx ecx, byte [edx - 3]
lea edx, [edx + 4]
lea eax, [eax + 4]
not cl
mov byte [eax - 5], cl
movzx ecx, byte [ebx + eax - 4]
not cl
mov byte [eax - 4], cl
movzx ecx, byte [edx - 5]
not cl
mov byte [eax - 3], cl
movzx ecx, byte [edx - 4]
not cl
mov byte [eax - 2], cl
sub esi, 1
jne 0x513355
mov esi, dword [ebp - 0x424]
mov eax, dword [ebp - 0x428]
mov ecx, dword [ebp - 0x41c]
mov edx, dword [ebp - 0x44c]
mov ebx, dword [ebp - 0x420]
add esi, edx
add edi, ebx
sub eax, 1
mov dword [ebp - 0x424], esi
mov dword [ebp - 0x428], eax
jne 0x513340
jmp 0x5134a9
lea ecx, [ebp - 0x19c]
call fcn.0041d290
lea ecx, [ebp - 0x19c]
mov ebx, eax
call fcn.004ad4e0
mov dword [ebp - 0x428], eax
mov eax, dword [ebp - 0x42c]
shl esi, 2
mov dword [ebp - 0x41c], esi
test eax, eax
jle 0x5134a9
mov ecx, dword [ebp - 0x428]
inc edi
mov edx, dword [ebp - 0x420]
add ebx, 2
mov dword [ebp - 0x424], eax
test esi, esi
jle 0x51344d
dec esi
mov ecx, ebx
shr esi, 2
mov edx, edi
inc esi
movzx eax, byte [edx + 1]
lea edx, [edx + 3]
mov byte [ecx - 2], al
lea ecx, [ecx + 4]
movzx eax, byte [edx - 3]
mov byte [ecx - 5], al
movzx eax, byte [edx - 4]
mov byte [ecx - 4], al
sub esi, 1
jne 0x513415
mov eax, dword [ebp - 0x424]
mov esi, dword [ebp - 0x41c]
mov ecx, dword [ebp - 0x428]
mov edx, dword [ebp - 0x420]
add ebx, ecx
add edi, edx
sub eax, 1
mov dword [ebp - 0x424], eax
jne 0x513408
jmp 0x5134a9
lea ecx, [ebp - 0x19c]
call fcn.0041d290
lea ecx, [ebp - 0x19c]
mov esi, eax
call fcn.004ad4e0
mov dword [ebp - 0x41c], eax
mov eax, dword [ebp - 0x42c]
test eax, eax
jle 0x5134a9
mov ebx, eax
push dword [ebp - 0x438]
push edi
push esi
call sub.VCRUNTIME140.dll_memcpy
add esi, dword [ebp - 0x41c]
add esp, 0xc
add edi, dword [ebp - 0x420]
sub ebx, 1
jne 0x513488
lea ecx, [ebp - 0x19c]
call fcn.00446840
lea ecx, [ebp - 0x19c]
mov esi, eax
call fcn.0057e5b0
lea ecx, [ebp - 0x19c]
mov dword [ebp - 0x41c], eax
call fcn.0057e5a0
mov ecx, dword [ebp - 0x42c]
mov ebx, eax
imul ebx, dword [ebp - 0x438]
test ecx, ecx
jle 0x513501
mov edi, ecx
push ebx
push 0xff
push esi
call sub.VCRUNTIME140.dll_memset
add esi, dword [ebp - 0x41c]
add esp, 0xc
sub edi, 1
jne 0x5134e7
mov ecx, dword [ebp - 0x450]
mov eax, dword [ebp - 0x460]
inc ecx
mov ebx, dword [ebp - 0x420]
mov edx, dword [ebp - 0x430]
mov edi, dword [ebp - 0x454]
mov esi, dword [ebp - 0x458]
jmp 0x51328b
mov ecx, dword [ebp - 0x434]
add edx, 0x100
mov dword [ebp - 0x430], edx
call fcn.0050fc30
test eax, eax
je 0x51355e
mov eax, dword [ebp - 0x45c]
mov edx, dword [ebp - 0x430]
inc eax
mov ecx, dword [ebp - 0x43c]
jmp 0x51321a
mov ecx, dword [ebp - 0x434]
call fcn.0050fed0
test eax, eax
jne 0x51357c
lea eax, [ebp - 0x394]
push eax
call sub.jpeg62.dll_Ordinal_50
add esp, 4
lea eax, [ebp - 0x394]
push eax
call sub.jpeg62.dll_Ordinal_44
add esp, 4
lea ecx, [ebp - 0x19c]
call fcn.0057e360
lea ecx, [ebp - 0xa4]
call fcn.005241b0
lea ecx, [ebp - 0x40]
call fcn.005241b0
mov eax, 1
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.005a4e1e
mov esp, ebp
pop ebp
ret 4