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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
mov eax, dword [0x101383dc]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [ebp - 0x10c], eax
push esi
push edi
mov dword [ebp - 0xe0], edx
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x108], ebx
test eax, eax
je 0x100515bd
push eax
push 0x80
lea eax, [ebp - 0xd4]
push 1
push eax
call fcn.100ce3e9
add esp, 0x10
jmp 0x100515d5
mov eax, dword [ebx + 0x14]
lea edi, [ebp - 0xd4]
mov esi, eax
mov ecx, 0x20
sub eax, 0xffffff80
rep movsd dword es:[edi], dword [esi]
mov dword [ebx + 0x14], eax
cmp dword [ebp - 0xd4], 0x20534444
jne 0x10051bea
cmp dword [ebp - 0xd0], 0x7c
jne 0x10051bea
mov eax, dword [ebp - 0xcc]
and eax, 0x1007
cmp eax, 0x1007
jne 0x10051bea
cmp dword [ebp - 0x88], 0x20
jne 0x10051bea
mov edx, dword [ebp - 0x84]
test dl, 0x44
je 0x10051bea
mov eax, dword [ebp - 0x68]
test eax, 0x1000
je 0x10051bea
mov edi, dword [ebp - 0xc4]
mov esi, edx
mov ecx, dword [ebp - 0xc8]
and edx, 1
shr esi, 2
and esi, 1
mov dword [ebx], edi
mov dword [ebx + 4], ecx
mov dword [ebx + 8], 4
test eax, 0x400000
je 0x1005166f
cmp dword [ebp - 0xb8], 1
mov dword [ebp - 0xfc], 1
ja 0x10051679
mov dword [ebp - 0xfc], 0
mov eax, dword [ebp - 0x64]
xor ecx, ecx
cmp edi, dword [ebp - 0xc8]
sete cl
shr eax, 9
and ecx, eax
lea eax, [ecx*4 + 1]
add eax, ecx
lea ecx, [edi + 3]
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp - 0xc8]
add eax, 3
shr ecx, 2
shr eax, 2
imul eax, ecx
mov dword [ebp - 0x100], ecx
mov ecx, dword [ebp - 0x10c]
mov dword [ebp - 0xec], eax
mov eax, dword [ebp - 0xe0]
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 0x10051a88
mov esi, dword [ebp - 0x80]
shr esi, 0x18
mov dword [ebp - 0xf8], esi
cmp esi, 0x31
jb 0x10051bea
cmp esi, 0x35
ja 0x10051bea
mov eax, dword [ebx + 4]
imul eax, dword [ebx]
imul eax, dword [ebp - 0xd8]
shl eax, 2
push eax
mov dword [ebp - 0xdc], eax
call fcn.100d397d
mov ecx, dword [ebp - 0xd8]
mov edi, eax
xor eax, eax
mov dword [ebp - 0xe8], edi
add esp, 4
mov dword [ebp - 0xe4], eax
test ecx, ecx
je 0x10051bdf
nop dword [eax]
xor ecx, ecx
mov dword [ebp - 0xe0], ecx
cmp dword [ebp - 0xec], ecx
jle 0x10051979
mov eax, ecx
mov esi, 4
cdq
idiv dword [ebp - 0x100]
mov eax, ecx
mov dword [ebp - 0xf0], esi
mov edi, edx
mov ecx, dword [ebp - 0xf8]
cdq
idiv dword [ebp - 0x100]
shl edi, 2
shl eax, 2
mov dword [ebp - 0xf4], eax
cmp ecx, 0x31
jne 0x100517d6
mov ecx, dword [ebx + 0x10]
test ecx, ecx
je 0x100517b2
push ecx
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100ce3e9
add esp, 0x10
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x54]
call fcn.10050fb0
jmp 0x100518b4
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [ebp - 0x10], eax
lea eax, [edx + 8]
mov dword [ebp - 0xc], ecx
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x54]
mov dword [ebx + 0x14], eax
call fcn.10050fb0
jmp 0x100518b4
mov eax, dword [ebx + 0x10]
cmp ecx, 0x34
jae 0x10051845
test eax, eax
je 0x100517f5
push eax
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100ce3e9
add esp, 0x10
jmp 0x10051809
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [ebp - 0x10], eax
lea eax, [edx + 8]
mov dword [ebp - 0xc], ecx
mov dword [ebx + 0x14], eax
xor edx, edx
nop dword [eax + eax]
mov eax, edx
movzx ecx, dl
sar eax, 3
and ecx, 7
movzx eax, byte [ebp + eax - 0x10]
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 [ebp + edx - 0x51], cl
add edx, esi
cmp edx, 0x3d
jl 0x10051810
jmp 0x1005187b
test eax, eax
je 0x1005185c
push eax
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100ce3e9
add esp, 0x10
jmp 0x10051870
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [ebp - 0x10], eax
lea eax, [edx + 8]
mov dword [ebp - 0xc], ecx
mov dword [ebx + 0x14], eax
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x54]
call fcn.10051200
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x10051895
push eax
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100ce3e9
add esp, 0x10
jmp 0x100518a9
mov edx, dword [ebx + 0x14]
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov dword [ebp - 0x10], eax
lea eax, [edx + 8]
mov dword [ebx + 0x14], eax
mov dword [ebp - 0xc], ecx
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x54]
call fcn.10051390
mov ecx, dword [ebx]
lea eax, [edi + 4]
cmp eax, ecx
jbe 0x100518c1
mov esi, ecx
sub esi, edi
mov eax, dword [ebp - 0xf4]
mov edx, dword [ebx + 4]
add eax, 4
cmp eax, edx
jbe 0x100518e3
sub edx, dword [ebp - 0xf4]
mov dword [ebp - 0xf0], edx
test edx, edx
jle 0x10051954
jmp 0x100518e9
mov edx, dword [ebp - 0xf0]
lea eax, [ecx*4]
mov dword [ebp - 0x104], eax
lea ebx, [esi*4]
mov eax, ecx
lea esi, [ebp - 0x54]
imul eax, dword [ebp - 0xe4]
add eax, dword [ebp - 0xf4]
imul eax, ecx
mov ecx, dword [ebp - 0xe8]
add eax, edi
lea edi, [ecx + eax*4]
mov eax, dword [ebp - 0x104]
test ebx, ebx
jle 0x1005193e
push ebx
push esi
push edi
call fcn.100c58f0
mov edx, dword [ebp - 0xf0]
add esp, 0xc
mov eax, dword [ebp - 0x104]
add edi, eax
add esi, 0x10
sub edx, 1
mov dword [ebp - 0xf0], edx
jne 0x10051923
mov ebx, dword [ebp - 0x108]
mov ecx, dword [ebp - 0xe0]
inc ecx
mov dword [ebp - 0xe0], ecx
cmp ecx, dword [ebp - 0xec]
jl 0x10051754
mov esi, dword [ebp - 0xf8]
mov eax, dword [ebp - 0xe4]
cmp dword [ebp - 0xfc], 0
je 0x100519f4
xor eax, eax
cmp esi, 0x31
setne al
cmp dword [ebp - 0xb8], 1
lea eax, [eax*8 + 8]
mov dword [ebp - 0xe0], eax
jbe 0x100519ee
mov esi, 3
mov edi, eax
mov edx, dword [ebx]
mov ecx, esi
mov eax, dword [ebx + 4]
shr edx, cl
shr eax, cl
cmp edx, 1
mov ecx, 1
cmovl edx, ecx
cmp eax, ecx
cmovl eax, ecx
mov ecx, edi
imul ecx, eax
mov eax, dword [ebx + 0x10]
imul ecx, edx
test eax, eax
je 0x100519df
push 1
push ecx
push eax
call fcn.100ce839
add esp, 0xc
jmp 0x100519e2
add dword [ebx + 0x14], ecx
inc esi
lea eax, [esi - 2]
cmp eax, dword [ebp - 0xb8]
jb 0x100519a7
mov eax, dword [ebp - 0xe4]
mov esi, dword [ebp - 0xf8]
inc eax
mov dword [ebp - 0xe4], eax
cmp eax, dword [ebp - 0xd8]
jl 0x10051740
mov edi, dword [ebp - 0xe8]
mov esi, dword [ebp - 0xdc]
mov ecx, dword [ebp - 0xd8]
mov eax, dword [ebx + 4]
imul eax, ecx
mov ecx, dword [ebp - 0x10c]
mov dword [ebx + 4], eax
mov dword [ecx], eax
xor eax, eax
mov edx, dword [ebx + 8]
cmp edx, 4
jne 0x10051a5b
mov ecx, 3
cmp esi, ecx
jle 0x10051a75
test eax, eax
jne 0x10051a75
cmp byte [ecx + edi], 0xff
sbb eax, eax
add ecx, 4
neg eax
cmp ecx, esi
jl 0x10051a43
cmp edx, 4
je 0x10051a75
push dword [ebx + 4]
mov ecx, edi
push dword [ebx]
push 4
call fcn.1004a060
add esp, 0xc
mov edi, eax
mov eax, dword [ebx + 8]
xor ecx, ecx
mov dword [ecx], eax
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.100c2ed5
mov esp, ebp
pop ebp
ret
mov dword [ebx + 8], 3
mov eax, 3
test edx, edx
je 0x10051aa4
mov dword [ebx + 8], 4
mov eax, 4
mov dword [ecx], eax
mov esi, dword [ebx + 8]
imul esi, dword [ebx + 4]
imul esi, dword [ebx]
imul esi, dword [ebp - 0xd8]
push esi
mov dword [ebp - 0xdc], esi
call fcn.100d397d
xor ecx, ecx
add esp, 4
mov edi, eax
mov dword [ebp - 0xec], ecx
mov dword [ebp - 0xe8], edi
cmp dword [ebp - 0xd8], ecx
jbe 0x10051ba9
mov esi, dword [ebx + 8]
imul esi, dword [ebx + 4]
imul esi, dword [ebx]
mov eax, esi
imul eax, ecx
mov ecx, dword [ebx + 0x10]
add eax, edi
test ecx, ecx
je 0x10051b09
push ecx
push esi
push 1
push eax
call fcn.100ce3e9
add esp, 0x10
jmp 0x10051b19
push esi
push dword [ebx + 0x14]
push eax
call fcn.100c58f0
add esp, 0xc
add dword [ebx + 0x14], esi
cmp dword [ebp - 0xfc], 0
je 0x10051b8a
mov edi, 1
cmp dword [ebp - 0xb8], edi
jbe 0x10051b84
lea eax, [ebx + 0x14]
mov esi, dword [ebx]
mov ecx, edi
mov edx, dword [ebx + 4]
shr esi, cl
shr edx, cl
lea ecx, [ebx + 0x14]
cmp esi, 1
jge 0x10051b4c
mov esi, 1
mov eax, ecx
cmp edx, 1
jge 0x10051b58
mov edx, 1
mov eax, ecx
mov ecx, dword [ebx + 8]
imul ecx, edx
mov edx, dword [ebx + 0x10]
imul ecx, esi
test edx, edx
je 0x10051b79
push 1
push ecx
push edx
call fcn.100ce839
add esp, 0xc
lea eax, [ebx + 0x14]
jmp 0x10051b7b
add dword [eax], ecx
inc edi
cmp edi, dword [ebp - 0xb8]
jb 0x10051b32
mov edi, dword [ebp - 0xe8]
mov ecx, dword [ebp - 0xec]
inc ecx
mov dword [ebp - 0xec], ecx
cmp ecx, dword [ebp - 0xd8]
jl 0x10051ae2
mov esi, dword [ebp - 0xdc]
xor edx, edx
test esi, esi
jle 0x10051a19
mov esi, dword [ebx + 8]
mov ebx, dword [ebp - 0xdc]
nop dword [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, ebx
jl 0x10051bc0
mov ebx, dword [ebp - 0x108]
jmp 0x10051a13
mov esi, dword [ebp - 0xdc]
jmp 0x10051a1f
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100c2ed5
mov esp, ebp
pop ebp
ret