Function at 0x10051480
Capabilities:
Encrypt data using rc4 ksa
Read file on windows

Disassembly:
sub esp, 0x100
mov eax, dword [0x10106024]
xor eax, esp
mov dword [esp + 0xfc], eax
mov eax, dword [esp + 0x104]
push ebx
mov ebx, ecx
mov dword [esp + 0x2c], eax
push ebp
push esi
push edi
mov eax, dword [ebx + 0x10]
mov dword [esp + 0x28], edx
test eax, eax
je 0x100514c7
push eax
push 0x80
lea eax, [esp + 0x48]
push 1
push eax
call fcn.100b5976
add esp, 0x10
jmp 0x100514dd
mov eax, dword [ebx + 0x14]
lea edi, [esp + 0x40]
mov esi, eax
mov ecx, 0x20
sub eax, 0xffffff80
rep movsd dword es:[edi], dword [esi]
mov dword [ebx + 0x14], eax
cmp dword [esp + 0x40], 0x20534444
jne 0x10051a5d
cmp dword [esp + 0x44], 0x7c
jne 0x10051a5d
mov eax, dword [esp + 0x48]
and eax, 0x1007
cmp eax, 0x1007
jne 0x10051a5d
cmp dword [esp + 0x8c], 0x20
jne 0x10051a5d
mov edx, dword [esp + 0x90]
test dl, 0x44
je 0x10051a5d
mov eax, dword [esp + 0xac]
test eax, 0x1000
je 0x10051a5d
mov edi, dword [esp + 0x50]
mov esi, edx
mov ebp, dword [esp + 0x4c]
and edx, 1
shr esi, 2
and esi, 1
mov dword [ebx], edi
mov dword [ebx + 4], ebp
mov dword [ebx + 8], 4
test eax, 0x400000
je 0x1005156f
cmp dword [esp + 0x5c], 1
mov dword [esp + 0x30], 1
ja 0x10051577
mov dword [esp + 0x30], 0
mov eax, dword [esp + 0xb0]
xor ecx, ecx
cmp edi, ebp
sete cl
shr eax, 9
and ecx, eax
lea eax, [ecx*4 + 1]
add eax, ecx
lea ecx, [edi + 3]
mov dword [esp + 0x10], eax
lea eax, [ebp + 3]
shr ecx, 2
shr eax, 2
imul eax, ecx
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
mov dword [eax], edi
mov eax, dword [ebx + 4]
mov dword [ecx], eax
xor ecx, ecx
mov eax, dword [ebx + 8]
mov dword [ecx], eax
test esi, esi
je 0x10051901
mov ebp, dword [esp + 0x94]
shr ebp, 0x18
mov dword [esp + 0x2c], ebp
cmp ebp, 0x31
jb 0x10051a5d
cmp ebp, 0x35
ja 0x10051a5d
mov eax, dword [ebx]
mov esi, dword [esp + 0x10]
imul eax, esi
imul eax, dword [ebx + 4]
shl eax, 2
push eax
call fcn.100aeb03
xor ecx, ecx
add esp, 4
mov dword [esp + 0x20], ecx
mov edi, eax
mov dword [esp + 0x24], edi
test esi, esi
je 0x10051a28
nop dword [eax]
xor eax, eax
mov dword [esp + 0x28], eax
cmp dword [esp + 0x14], eax
jle 0x10051870
cdq
mov ebp, 4
idiv dword [esp + 0x3c]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x1c], ebp
lea esi, [eax*4]
mov eax, dword [ebx + 0x10]
mov dword [esp + 0x18], esi
lea edi, [edx*4]
cmp ecx, 0x31
jne 0x100516c1
test eax, eax
je 0x1005168d
push eax
push 8
lea eax, [esp + 0xc8]
push 1
push eax
call fcn.100b5976
add esp, 0x10
lea edx, [esp + 0xc0]
lea ecx, [esp + 0xc8]
call fcn.10050eb0
jmp 0x100517d2
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [esp + 0xc0], eax
lea eax, [edx + 8]
mov dword [esp + 0xc4], ecx
lea edx, [esp + 0xc0]
lea ecx, [esp + 0xc8]
mov dword [ebx + 0x14], eax
call fcn.10050eb0
jmp 0x100517d2
cmp ecx, 0x34
jae 0x1005173b
test eax, eax
je 0x100516e1
push eax
push 8
lea eax, [esp + 0xc8]
push 1
push eax
call fcn.100b5976
add esp, 0x10
jmp 0x100516fd
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [esp + 0xc0], eax
lea eax, [edx + 8]
mov dword [esp + 0xc4], ecx
mov dword [ebx + 0x14], eax
xor edx, edx
nop
mov eax, edx
movzx ecx, dl
sar eax, 3
and ecx, 7
movzx eax, byte [esp + eax + 0xc0]
shr eax, cl
and eax, 0xf
imul eax, eax, 0xff
add eax, 8
mov ecx, eax
shr ecx, 4
add ecx, eax
shr ecx, 4
mov byte [esp + edx + 0xcb], cl
add edx, ebp
cmp edx, 0x3d
jl 0x10051700
jmp 0x10051785
test eax, eax
je 0x10051756
push eax
push 8
lea eax, [esp + 0xc8]
push 1
push eax
call fcn.100b5976
add esp, 0x10
jmp 0x10051772
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [esp + 0xc0], eax
lea eax, [edx + 8]
mov dword [esp + 0xc4], ecx
mov dword [ebx + 0x14], eax
lea edx, [esp + 0xc0]
lea ecx, [esp + 0xc8]
call fcn.100510f0
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x100517a3
push eax
push 8
lea eax, [esp + 0xc8]
push 1
push eax
call fcn.100b5976
add esp, 0x10
jmp 0x100517bf
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [esp + 0xc0], eax
lea eax, [edx + 8]
mov dword [ebx + 0x14], eax
mov dword [esp + 0xc4], ecx
lea edx, [esp + 0xc0]
lea ecx, [esp + 0xc8]
call fcn.100512a0
mov ecx, dword [ebx]
lea eax, [edi + 4]
cmp eax, ecx
jbe 0x100517df
mov ebp, ecx
sub ebp, edi
mov edx, dword [ebx + 4]
lea eax, [esi + 4]
cmp eax, edx
jbe 0x100517f5
sub edx, esi
mov dword [esp + 0x1c], edx
test edx, edx
jle 0x10051855
jmp 0x100517f9
mov edx, dword [esp + 0x1c]
lea eax, [ecx*4]
shl ebp, 2
mov dword [esp + 0x34], eax
lea esi, [esp + 0xc8]
mov eax, ecx
imul eax, dword [esp + 0x20]
add eax, dword [esp + 0x18]
imul eax, ecx
mov ecx, dword [esp + 0x24]
add eax, edi
lea edi, [ecx + eax*4]
mov eax, dword [esp + 0x34]
nop dword [eax]
test ebp, ebp
jle 0x10051847
push ebp
push esi
push edi
call fcn.100abd30
mov edx, dword [esp + 0x28]
add esp, 0xc
mov eax, dword [esp + 0x34]
add edi, eax
add esi, 0x10
sub edx, 1
mov dword [esp + 0x1c], edx
jne 0x10051830
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cmp eax, dword [esp + 0x14]
jl 0x10051630
mov ebp, dword [esp + 0x2c]
mov ecx, dword [esp + 0x20]
cmp dword [esp + 0x30], 0
je 0x100518e9
xor eax, eax
cmp ebp, 0x31
setne al
cmp dword [esp + 0x5c], 1
lea eax, [eax*8 + 8]
mov dword [esp + 0x18], eax
jbe 0x100518e9
mov esi, 3
mov edi, eax
lea ebp, [esi - 2]
nop dword [eax + eax]
mov edx, dword [ebx]
mov ecx, esi
mov eax, dword [ebx + 4]
shr edx, cl
shr eax, cl
cmp edx, 1
mov ecx, edi
cmovl edx, ebp
cmp eax, 1
cmovl eax, ebp
imul ecx, eax
mov eax, dword [ebx + 0x10]
imul ecx, edx
test eax, eax
je 0x100518d4
push 1
push ecx
push eax
call fcn.100b4fb9
add esp, 0xc
jmp 0x100518d7
add dword [ebx + 0x14], ecx
inc esi
lea eax, [esi - 2]
cmp eax, dword [esp + 0x5c]
jb 0x100518a0
mov ebp, dword [esp + 0x2c]
mov ecx, dword [esp + 0x20]
inc ecx
mov dword [esp + 0x20], ecx
cmp ecx, dword [esp + 0x10]
jl 0x10051620
mov edi, dword [esp + 0x24]
jmp 0x10051a24
mov dword [ebx + 8], 3
mov eax, 3
test edx, edx
je 0x1005191d
mov dword [ebx + 8], 4
mov eax, 4
mov dword [ecx], eax
mov ebp, dword [ebx + 8]
imul ebp, dword [ebx]
imul ebp, dword [esp + 0x10]
imul ebp, dword [ebx + 4]
push ebp
mov dword [esp + 0x1c], ebp
call fcn.100aeb03
xor ecx, ecx
add esp, 4
mov edi, eax
mov dword [esp + 0x14], ecx
mov dword [esp + 0x24], edi
cmp dword [esp + 0x10], ecx
jbe 0x10051a02
mov esi, dword [ebx + 8]
imul esi, dword [ebx]
imul esi, dword [ebx + 4]
mov eax, esi
imul eax, ecx
mov ecx, dword [ebx + 0x10]
add eax, edi
test ecx, ecx
je 0x10051978
push ecx
push esi
push 1
push eax
call fcn.100b5976
add esp, 0x10
jmp 0x10051988
push esi
push dword [ebx + 0x14]
push eax
call fcn.100abd30
add esp, 0xc
add dword [ebx + 0x14], esi
cmp dword [esp + 0x30], 0
je 0x100519eb
mov ebp, dword [esp + 0x5c]
mov esi, 1
cmp ebp, esi
jbe 0x100519eb
mov edi, dword [ebx + 4]
nop
mov edx, dword [ebx]
mov ecx, esi
shr edx, cl
mov eax, edi
shr eax, cl
cmp edx, 1
mov ecx, 1
cmovl edx, ecx
cmp eax, ecx
cmovl eax, ecx
mov ecx, dword [ebx + 8]
imul ecx, eax
mov eax, dword [ebx + 0x10]
imul ecx, edx
test eax, eax
je 0x100519df
push 1
push ecx
push eax
call fcn.100b4fb9
mov edi, dword [ebx + 4]
add esp, 0xc
mov ebp, dword [esp + 0x5c]
jmp 0x100519e2
add dword [ebx + 0x14], ecx
inc esi
cmp esi, ebp
jb 0x100519a0
mov edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
inc ecx
mov dword [esp + 0x14], ecx
cmp ecx, dword [esp + 0x10]
jl 0x10051951
mov ebp, dword [esp + 0x18]
xor edx, edx
test ebp, ebp
jle 0x10051a24
mov esi, dword [ebx + 8]
nop dword [eax + eax]
mov cl, byte [edx + edi]
mov al, byte [edx + edi + 2]
mov byte [edx + edi], al
mov byte [edx + edi + 2], cl
add edx, esi
cmp edx, ebp
jl 0x10051a10
mov esi, dword [esp + 0x10]
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x38]
imul eax, esi
mov dword [ebx + 4], eax
mov dword [ecx], eax
mov edx, dword [ebx + 8]
cmp edx, 4
je 0x10051a59
push dword [ebx + 4]
mov ecx, edi
push dword [ebx]
push 4
call fcn.100496e0
add esp, 0xc
mov edi, eax
mov eax, dword [ebx + 8]
xor ecx, ecx
mov dword [ecx], eax
mov eax, edi
jmp 0x10051a5f
xor eax, eax
mov ecx, dword [esp + 0x10c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.100aa00f
add esp, 0x100
ret