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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
mov eax, dword [0x1013b3dc]
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 0x100518cd
push eax
push 0x80
lea eax, [ebp - 0xd4]
push 1
push eax
call fcn.100cfe9a
add esp, 0x10
jmp 0x100518e5
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 0x10051efa
cmp dword [ebp - 0xd0], 0x7c
jne 0x10051efa
mov eax, dword [ebp - 0xcc]
and eax, 0x1007
cmp eax, 0x1007
jne 0x10051efa
cmp dword [ebp - 0x88], 0x20
jne 0x10051efa
mov edx, dword [ebp - 0x84]
test dl, 0x44
je 0x10051efa
mov eax, dword [ebp - 0x68]
test eax, 0x1000
je 0x10051efa
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 0x1005197f
cmp dword [ebp - 0xb8], 1
mov dword [ebp - 0xfc], 1
ja 0x10051989
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 0x10051d98
mov esi, dword [ebp - 0x80]
shr esi, 0x18
mov dword [ebp - 0xf8], esi
cmp esi, 0x31
jb 0x10051efa
cmp esi, 0x35
ja 0x10051efa
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.100d54d4
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 0x10051eef
nop dword [eax]
xor ecx, ecx
mov dword [ebp - 0xe0], ecx
cmp dword [ebp - 0xec], ecx
jle 0x10051c89
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 0x10051ae6
mov ecx, dword [ebx + 0x10]
test ecx, ecx
je 0x10051ac2
push ecx
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100cfe9a
add esp, 0x10
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x54]
call fcn.100512c0
jmp 0x10051bc4
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.100512c0
jmp 0x10051bc4
mov eax, dword [ebx + 0x10]
cmp ecx, 0x34
jae 0x10051b55
test eax, eax
je 0x10051b05
push eax
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100cfe9a
add esp, 0x10
jmp 0x10051b19
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 0x10051b20
jmp 0x10051b8b
test eax, eax
je 0x10051b6c
push eax
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100cfe9a
add esp, 0x10
jmp 0x10051b80
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.10051510
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x10051ba5
push eax
push 8
lea eax, [ebp - 0x10]
push 1
push eax
call fcn.100cfe9a
add esp, 0x10
jmp 0x10051bb9
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.100516a0
mov ecx, dword [ebx]
lea eax, [edi + 4]
cmp eax, ecx
jbe 0x10051bd1
mov esi, ecx
sub esi, edi
mov eax, dword [ebp - 0xf4]
mov edx, dword [ebx + 4]
add eax, 4
cmp eax, edx
jbe 0x10051bf3
sub edx, dword [ebp - 0xf4]
mov dword [ebp - 0xf0], edx
test edx, edx
jle 0x10051c64
jmp 0x10051bf9
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 0x10051c4e
push ebx
push esi
push edi
call fcn.100c7fd0
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 0x10051c33
mov ebx, dword [ebp - 0x108]
mov ecx, dword [ebp - 0xe0]
inc ecx
mov dword [ebp - 0xe0], ecx
cmp ecx, dword [ebp - 0xec]
jl 0x10051a64
mov esi, dword [ebp - 0xf8]
mov eax, dword [ebp - 0xe4]
cmp dword [ebp - 0xfc], 0
je 0x10051d04
xor eax, eax
cmp esi, 0x31
setne al
cmp dword [ebp - 0xb8], 1
lea eax, [eax*8 + 8]
mov dword [ebp - 0xe0], eax
jbe 0x10051cfe
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 0x10051cef
push 1
push ecx
push eax
call fcn.100d02ea
add esp, 0xc
jmp 0x10051cf2
add dword [ebx + 0x14], ecx
inc esi
lea eax, [esi - 2]
cmp eax, dword [ebp - 0xb8]
jb 0x10051cb7
mov eax, dword [ebp - 0xe4]
mov esi, dword [ebp - 0xf8]
inc eax
mov dword [ebp - 0xe4], eax
cmp eax, dword [ebp - 0xd8]
jl 0x10051a50
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 0x10051d6b
mov ecx, 3
cmp esi, ecx
jle 0x10051d85
test eax, eax
jne 0x10051d85
cmp byte [ecx + edi], 0xff
sbb eax, eax
add ecx, 4
neg eax
cmp ecx, esi
jl 0x10051d53
cmp edx, 4
je 0x10051d85
push dword [ebx + 4]
mov ecx, edi
push dword [ebx]
push 4
call fcn.1004a370
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.100c55b5
mov esp, ebp
pop ebp
ret
mov dword [ebx + 8], 3
mov eax, 3
test edx, edx
je 0x10051db4
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.100d54d4
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 0x10051eb9
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 0x10051e19
push ecx
push esi
push 1
push eax
call fcn.100cfe9a
add esp, 0x10
jmp 0x10051e29
push esi
push dword [ebx + 0x14]
push eax
call fcn.100c7fd0
add esp, 0xc
add dword [ebx + 0x14], esi
cmp dword [ebp - 0xfc], 0
je 0x10051e9a
mov edi, 1
cmp dword [ebp - 0xb8], edi
jbe 0x10051e94
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 0x10051e5c
mov esi, 1
mov eax, ecx
cmp edx, 1
jge 0x10051e68
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 0x10051e89
push 1
push ecx
push edx
call fcn.100d02ea
add esp, 0xc
lea eax, [ebx + 0x14]
jmp 0x10051e8b
add dword [eax], ecx
inc edi
cmp edi, dword [ebp - 0xb8]
jb 0x10051e42
mov edi, dword [ebp - 0xe8]
mov ecx, dword [ebp - 0xec]
inc ecx
mov dword [ebp - 0xec], ecx
cmp ecx, dword [ebp - 0xd8]
jl 0x10051df2
mov esi, dword [ebp - 0xdc]
xor edx, edx
test esi, esi
jle 0x10051d29
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 0x10051ed0
mov ebx, dword [ebp - 0x108]
jmp 0x10051d23
mov esi, dword [ebp - 0xdc]
jmp 0x10051d2f
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100c55b5
mov esp, ebp
pop ebp
ret