Function at 0x10059100
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov dword [ebp - 4], edx
xor edx, edx
cmp dword [ebp + 0x18], 0x10
push ebx
sete dl
mov ebx, ecx
inc edx
mov ecx, edx
imul ecx, dword [ebp + 0xc]
push esi
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 8], edi
mov eax, ecx
imul eax, edi
mov dword [ebp - 0x34], eax
mov eax, dword [ebx]
mov eax, dword [eax + 8]
mov dword [ebp - 0x1c], eax
imul eax, edx
mov dword [ebp - 0xc], eax
test edi, edi
js 0x10059a63
cmp dword [ebp + 0x14], 0
jl 0x10059a63
mov eax, dword [ebp + 0x14]
mov esi, 0x7fffffff
test eax, eax
je 0x1005916a
xor edx, edx
mov eax, esi
div dword [ebp + 0x14]
cmp edi, eax
jg 0x10059a63
mov eax, dword [ebp + 0x14]
imul edi, eax
test edi, edi
js 0x10059a63
test ecx, ecx
js 0x10059a63
je 0x1005918c
mov eax, esi
cdq
idiv ecx
cmp edi, eax
jg 0x10059a63
mov eax, dword [ebp - 0x34]
imul eax, dword [ebp + 0x14]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push eax
call edi
add esp, 4
mov dword [ebx + 0xc], eax
test eax, eax
je 0x10059a6a
mov eax, dword [ebp - 0x1c]
test eax, eax
js 0x10059a41
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x100591ce
xor edx, edx
mov eax, esi
div ecx
cmp dword [ebp - 0x1c], eax
jg 0x10059a41
mov eax, dword [ebp - 0x1c]
mov ecx, eax
imul ecx, dword [ebp + 0x10]
mov dword [ebp - 0x14], ecx
test ecx, ecx
js 0x10059a41
mov eax, dword [ebp + 0x18]
test eax, eax
js 0x10059a41
je 0x100591fb
xor edx, edx
mov eax, esi
div dword [ebp + 0x18]
cmp ecx, eax
jg 0x10059a41
mov eax, ecx
imul eax, dword [ebp + 0x18]
cmp eax, 0x7ffffff8
jg 0x10059a41
mov edx, dword [ebp + 0x14]
lea ecx, [eax + 7]
shr ecx, 3
mov dword [ebp - 0x30], ecx
test edx, edx
je 0x1005922e
xor edx, edx
mov eax, esi
div dword [ebp + 0x14]
cmp ecx, eax
jg 0x10059a41
mov edx, dword [ebp + 0x14]
mov eax, ecx
sub esi, ecx
imul eax, edx
cmp eax, esi
jg 0x10059a41
lea eax, [ecx + 1]
imul eax, edx
cmp dword [ebp + 8], eax
jae 0x1005926a
mov ecx, dword [0x10265504]
mov eax, dword fs:[0x2c]
pop edi
pop esi
pop ebx
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.not_enough_pixels
xor eax, eax
mov esp, ebp
pop ebp
ret
lea eax, [ecx + ecx]
push eax
call edi
mov esi, eax
add esp, 4
mov dword [ebp - 0x28], esi
test esi, esi
je 0x10059a6a
cmp dword [ebp + 0x18], 8
jge 0x10059293
mov eax, dword [ebp - 0x30]
mov ecx, 1
mov dword [ebp - 0xc], ecx
jmp 0x10059299
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0xc]
xor edx, edx
mov dword [ebp - 0x2c], edx
cmp dword [ebp + 0x14], edx
jbe 0x10059a2b
mov ebx, dword [ebx + 0xc]
mov edi, dword [ebp - 4]
imul eax, ecx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 8], eax
jmp 0x100592bb
mov esi, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x28]
mov eax, edx
and eax, 1
mov dword [ebp - 0x18], edi
imul eax, dword [ebp - 0x30]
add esi, eax
mov eax, edx
imul edx, dword [ebp - 0x34]
not eax
and eax, 1
mov dword [ebp - 0x24], esi
imul eax, dword [ebp - 0x30]
add edx, dword [ebp - 0x40]
mov dword [ebp - 0x10], edx
add ebx, eax
movzx eax, byte [edi]
inc edi
mov dword [ebp - 0x20], ebx
mov dword [ebp - 4], edi
cmp eax, 4
ja 0x100599fd
cmp dword [ebp - 0x2c], 0
jne switch.0x1005930f
movzx eax, byte [eax + 0x10259954]
cmp eax, 5
ja 0x10059717
jmp dword [eax*4 + 0x10059a8c]
push dword [ebp - 8]
push edi
push esi
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
jmp 0x10059714
mov edx, dword [ebp - 0x10]
mov edi, dword [ebp - 0x18]
mov eax, dword [ebp + 0x18]
inc edi
add edi, dword [ebp - 8]
mov dword [ebp - 4], edi
cmp eax, 8
jge 0x10059878
cmp dword [ebp + 0x1c], 0
jne 0x1005973b
mov bh, byte [eax + 0x102598cc]
jmp 0x1005973d
mov bh, 1
xor bl, bl
xor edi, edi
cmp eax, 4
jne 0x10059784
cmp dword [ebp - 0x14], edi
jbe 0x10059801
nop
mov eax, edi
and eax, 1
mov dword [ebp - 0x4c], eax
jne 0x1005975c
mov bl, byte [esi]
mov cl, bl
movzx eax, bh
shr cl, 4
movzx ecx, cl
imul ecx, eax
lea eax, [esi + 1]
shl bl, 4
mov byte [edi + edx], cl
inc edi
cmp dword [ebp - 0x4c], 0
cmovne eax, esi
mov esi, eax
cmp edi, dword [ebp - 0x14]
jb 0x10059750
jmp 0x10059801
cmp eax, 2
jne 0x100597c4
cmp dword [ebp - 0x14], edi
jbe 0x10059801
nop
mov eax, edi
and eax, 3
mov dword [ebp - 0x4c], eax
jne 0x1005979c
mov bl, byte [esi]
mov cl, bl
movzx eax, bh
shr cl, 6
movzx ecx, cl
imul ecx, eax
lea eax, [esi + 1]
shl bl, 2
mov byte [edi + edx], cl
inc edi
cmp dword [ebp - 0x4c], 0
cmovne eax, esi
mov esi, eax
cmp edi, dword [ebp - 0x14]
jb 0x10059790
jmp 0x10059801
cmp dword [ebp - 0x14], edi
jbe 0x10059801
nop dword [eax]
mov eax, edi
and eax, 7
mov dword [ebp - 0x4c], eax
jne 0x100597dc
mov bl, byte [esi]
mov cl, bl
movzx eax, bh
shr cl, 7
add bl, bl
movzx ecx, cl
imul ecx, eax
lea eax, [esi + 1]
mov byte [edi + edx], cl
inc edi
cmp dword [ebp - 0x4c], 0
cmovne eax, esi
mov esi, eax
cmp edi, dword [ebp - 0x14]
jb 0x100597d0
mov ebx, dword [ebp - 0x1c]
cmp ebx, dword [ebp + 0xc]
je 0x100599cf
mov ecx, dword [ebp + 0x10]
dec ecx
cmp ebx, 1
jne 0x10059835
test ecx, ecx
js 0x100599cf
nop
mov byte [edx + ecx*2 + 1], 0xff
mov al, byte [ecx + edx]
mov byte [edx + ecx*2], al
sub ecx, 1
jns 0x10059820
jmp 0x100599cf
test ecx, ecx
js 0x100599cf
lea esi, [ecx*2 + 1]
add esi, edx
lea edx, [edx + ecx*4]
add esi, ecx
add edx, 2
nop
sub ecx, 1
mov byte [edx + 1], 0xff
movzx eax, byte [esi + 1]
lea esi, [esi - 3]
mov byte [edx], al
lea edx, [edx - 4]
movzx eax, byte [esi + 3]
mov byte [edx + 3], al
movzx eax, byte [esi + 2]
mov byte [edx + 2], al
jns 0x10059850
jmp 0x100599cf
jne 0x100598f8
mov ebx, dword [ebp - 0x1c]
cmp ebx, dword [ebp + 0xc]
jne 0x10059894
push dword [ebp - 0x14]
push esi
push edx
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
jmp 0x100599d2
mov ecx, dword [ebp + 0x10]
dec ecx
cmp ebx, 1
jne 0x100598ba
test ecx, ecx
js 0x100599d2
mov byte [edx + ecx*2 + 1], 0xff
mov al, byte [ecx + esi]
mov byte [edx + ecx*2], al
sub ecx, 1
jns 0x100598a5
jmp 0x100599d2
test ecx, ecx
js 0x100599d2
lea esi, [esi + ecx*2]
inc esi
lea edx, [edx + ecx*4]
add esi, ecx
add edx, 2
nop
sub ecx, 1
mov byte [edx + 1], 0xff
movzx eax, byte [esi + 1]
lea esi, [esi - 3]
mov byte [edx], al
lea edx, [edx - 4]
movzx eax, byte [esi + 3]
mov byte [edx + 3], al
movzx eax, byte [esi + 2]
mov byte [edx + 2], al
jns 0x100598d0
jmp 0x100599d2
cmp eax, 0x10
jne 0x100599d2
mov ebx, dword [ebp - 0x1c]
cmp ebx, dword [ebp + 0xc]
jne 0x10059940
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x100599d2
sub edx, esi
mov edi, eax
nop dword [eax + eax]
movzx ecx, byte [esi]
lea esi, [esi + 2]
movzx eax, byte [esi - 1]
shl cx, 8
or cx, ax
mov word [edx + esi - 2], cx
sub edi, 1
jne 0x10059920
jmp 0x100599cf
mov eax, dword [ebp + 0x10]
cmp ebx, 1
jne 0x1005997a
test eax, eax
je 0x100599d2
mov edi, eax
movzx ecx, byte [esi]
lea edx, [edx + 4]
movzx eax, byte [esi + 1]
lea esi, [esi + 2]
shl cx, 8
or cx, ax
mov eax, 0xffff
mov word [edx - 4], cx
mov word [edx - 2], ax
sub edi, 1
jne 0x10059952
jmp 0x100599cf
test eax, eax
je 0x100599d2
add edx, 4
mov edi, eax
movzx ecx, byte [esi]
lea edx, [edx + 8]
movzx eax, byte [esi + 1]
lea esi, [esi + 6]
shl cx, 8
or cx, ax
mov word [edx - 0xc], cx
movzx ecx, byte [esi - 4]
movzx eax, byte [esi - 3]
shl cx, 8
or cx, ax
mov word [edx - 0xa], cx
movzx ecx, byte [esi - 2]
movzx eax, byte [esi - 1]
shl cx, 8
or cx, ax
mov eax, 0xffff
mov word [edx - 8], cx
mov word [edx - 6], ax
sub edi, 1
jne 0x10059983
mov edi, dword [ebp - 4]
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0xc]
inc edx
mov dword [ebp - 0x2c], edx
cmp edx, dword [ebp + 0x14]
jb 0x100592b8
push dword [ebp - 0x28]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x10265504]
mov eax, dword fs:[0x2c]
push dword [ebp - 0x28]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.invalid_filter
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x10265504]
mov eax, dword fs:[0x2c]
pop edi
pop esi
pop ebx
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.too_large
xor eax, eax
mov esp, ebp
pop ebp
ret
mov dword [ebx + 0xc], 0
mov ecx, dword [0x10265504]
mov eax, dword fs:[0x2c]
pop edi
pop esi
pop ebx
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.outofmem
xor eax, eax
mov esp, ebp
pop ebp
ret