Function at 0x406b33
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xbc
mov eax, dword [0x442008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
mov ecx, edi
call fcn.0040bd31
push 0x4401e0
lea eax, [ebp - 0x5c]
push esi
push eax
call fcn.0041b497
add esp, 0xc
test eax, eax
jne 0x4070d1
imul ecx, dword [edi + 0x92d14], 0x4c
mov edx, dword [edi + 0x92d10]
or dword [ebp - 0x7c], 0xffffffff
push 0
movzx eax, byte [ecx + edi + 0x285]
movzx esi, byte [ecx + edi + 0x284]
mov dword [ebp - 0x88], eax
imul eax, edx, 0xfc
movzx ecx, byte [ecx + edi + 0x282]
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x8c], ecx
mov ebx, dword [eax + edi + 0xbf4]
mov dword [ebp - 0x94], ebx
mov ebx, dword [eax + edi + 0xbec]
imul ebx, esi
mov dword [ebp - 0x70], ebx
xor ebx, ebx
mov dword [ebp - 0x90], ebx
movzx ebx, byte [eax + edi + 0xc00]
mov dword [ebp - 0xa0], ebx
mov ebx, dword [eax + edi + 0xc04]
test ebx, ebx
movzx eax, byte [eax + edi + 0xbf8]
cmove ebx, dword [ebp - 0x7c]
mov dword [ebp - 0x9c], ebx
mov dword [ebp - 0xb0], eax
pop ebx
test eax, eax
je 0x406c35
mov edx, 0x8008
mov esi, eax
imul eax, dword [edi + 0x92d14], 0x4c
mov ecx, dword [edi + 0x82858]
mov eax, dword [eax + edi + 0x274]
mov dword [edx + ecx], eax
lea edx, [edx + 4]
sub esi, 1
jne 0x406c0d
mov edx, dword [edi + 0x92d10]
mov esi, dword [ebp - 0x60]
imul eax, edx, 0xfc
mov ecx, edi
mov dword [ebp - 0x98], esi
mov dword [ebp - 0x80], ebx
mov dword [ebp - 0x6c], ebx
mov eax, dword [eax + edi + 0xc88]
mov dword [ebp - 0x84], eax
call fcn.0040858d
test al, al
je 0x406c86
mov ecx, dword [ebp - 0x84]
mov eax, 0x1d000000
imul ecx, esi
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x6c], 0x1fc00000
mov dword [ebp - 0x98], 2
sub eax, ecx
add dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x84]
imul eax, esi
push 0x50
push ebx
add eax, dword [ebp - 0x6c]
mov dword [ebp - 0xa4], eax
imul eax, dword [edi + 0x92d10], 0xfc
mov eax, dword [eax + edi + 0xbec]
sub eax, dword [ebp - 0x84]
mov dword [ebp - 0xac], eax
lea eax, [ebp - 0x54]
push eax
call fcn.00412d50
push dword [ebp - 0x5c]
call fcn.0041b680
add esp, 0x10
jmp 0x407086
push dword [ebp - 0x5c]
lea eax, [ebp - 0x54]
push 0x50
push eax
call fcn.0041b13b
add esp, 0xc
test eax, eax
je 0x4070b3
cmp byte [ebp - 0x54], 0x3a
jne 0x40707d
lea eax, [ebp - 0x54]
push eax
call fcn.00417520
pop ecx
cmp eax, 0xb
jb 0x40707d
push 2
lea eax, [ebp - 0x53]
push eax
call fcn.004071c7
mov dword [ebp - 0x78], eax
lea eax, [ebp - 0x51]
push 4
push eax
call fcn.004071c7
add eax, ebx
mov dword [ebp - 0x58], eax
lea eax, [ebp - 0x4d]
push 2
push eax
call fcn.004071c7
mov esi, eax
test esi, esi
jne 0x407030
lea eax, [ebp - 0x54]
push eax
call fcn.00417520
mov edx, dword [ebp - 0x78]
pop ecx
lea ecx, [edx*2 + 0xb]
cmp eax, ecx
jl 0x40707d
test edx, edx
jle 0x40707d
mov edx, dword [ebp - 0x94]
lea ebx, [ebp - 0x4b]
mov esi, dword [ebp - 0x58]
mov ecx, edx
sub ecx, dword [ebp - 0x6c]
mov eax, esi
mov dword [ebp - 0xa8], ecx
sub eax, edx
mov ecx, edx
mov dword [ebp - 0x7c], ebx
sub ecx, dword [ebp - 0x9c]
mov dword [ebp - 0xb8], ecx
mov ecx, edx
sub ecx, dword [ebp - 0x80]
mov dword [ebp - 0x68], eax
mov dword [ebp - 0xbc], ecx
add eax, ecx
cdq
idiv dword [ebp - 0x60]
push 2
mov dword [ebp - 0x74], eax
mov eax, esi
cdq
idiv dword [ebp - 0x60]
push ebx
mov dword [ebp - 0x64], edx
call fcn.004071c7
mov ebx, eax
mov eax, dword [ebp - 0x64]
or ebx, 0xffffff00
test eax, eax
jle 0x406dcf
shl ebx, 8
or ebx, 0xff
sub eax, 1
jne 0x406dc1
cmp esi, dword [ebp - 0x70]
jge 0x406de7
cmp esi, dword [ebp - 0x80]
jl 0x406de7
mov eax, dword [edi + 0x82858]
mov ecx, dword [ebp - 0x74]
mov eax, dword [eax]
and dword [eax + ecx*4], ebx
cmp dword [ebp - 0x84], 0
jbe 0x406e21
cmp esi, dword [ebp - 0x6c]
jl 0x406e21
cmp esi, dword [ebp - 0xa4]
jge 0x406e21
mov eax, dword [ebp - 0x68]
xor edx, edx
add eax, dword [ebp - 0xa8]
div dword [ebp - 0x60]
mov ecx, eax
mov eax, dword [edi + 0x82858]
add ecx, dword [ebp - 0xac]
mov dword [ebp - 0x74], ecx
mov eax, dword [eax]
and dword [eax + ecx*4], ebx
mov eax, dword [ebp - 0x94]
cmp esi, eax
jl 0x406e89
test eax, eax
je 0x406e89
imul eax, dword [edi + 0x92d10], 0xfc
movzx esi, word [eax + edi + 0xbf0]
test si, si
je 0x406e86
mov eax, dword [ebp - 0x68]
cdq
idiv dword [ebp - 0x88]
mov ecx, eax
cmp ecx, esi
jge 0x406e86
mov eax, dword [ebp - 0x88]
cmp eax, dword [ebp - 0x60]
je 0x406e7c
mov eax, dword [ebp - 0x64]
cdq
idiv dword [ebp - 0x88]
mov eax, dword [ebp - 0x64]
sub eax, edx
test eax, eax
jle 0x406e7c
shr ebx, 8
sub eax, 1
jne 0x406e74
mov eax, dword [edi + 0x82858]
and dword [eax + ecx*4 + 8], ebx
mov esi, dword [ebp - 0x58]
imul eax, dword [edi + 0x92d10], 0xfc
mov dword [ebp - 0xb4], eax
mov ecx, dword [eax + edi + 0xbfc]
cmp esi, ecx
jl 0x406fa6
cmp dword [ebp - 0xb0], 0
jbe 0x406fa6
mov eax, esi
sub eax, ecx
mov ecx, dword [ebp - 0x98]
cdq
idiv ecx
mov edx, eax
cmp ecx, dword [ebp - 0x60]
je 0x406ee4
cmp dword [ebp - 0x64], 1
jle 0x406ee4
imul eax, dword [edi + 0x92d14], 0x4c
mov ecx, ebx
shr ecx, 0x10
mov ebx, dword [eax + edi + 0x274]
and ebx, ecx
mov eax, dword [ebp - 0xb4]
movzx eax, byte [eax + edi + 0xbf8]
cmp edx, eax
jge 0x406fa6
imul eax, dword [edi + 0x92d10], 0x7e
mov ecx, dword [edi + 0x82858]
add eax, edx
movzx eax, word [edi + eax*2 + 0xc0c]
and eax, ebx
and dword [ecx + edx*4 + 0x8008], eax
cmp esi, dword [ebp - 0x70]
jge 0x406fa6
mov eax, dword [edi + 0x82858]
mov esi, dword [ebp - 0x74]
mov ecx, dword [eax]
imul eax, dword [edi + 0x92d10], 0x7e
add eax, edx
movzx eax, word [edi + eax*2 + 0xc0c]
and eax, ebx
and dword [ecx + esi*4], eax
mov eax, dword [edi + 0x82858]
mov ecx, dword [eax]
mov eax, esi
mov esi, dword [ebp - 0x58]
shl eax, 2
add ecx, eax
imul eax, dword [edi + 0x92d14], 0x4c
cmp dword [eax + edi + 0x274], 0xffff
jne 0x406f72
or dword [ecx], 0xf000
jmp 0x406fa6
or dword [ecx], 0xff0000
imul eax, dword [edi + 0x92d10], 0x7e
add edx, eax
mov eax, dword [edi + 0x82858]
mov esi, dword [eax]
movzx ecx, word [edi + edx*2 + 0xc0c]
movzx eax, word [edi + edx*2 + 0xc1e]
not ecx
and ecx, eax
mov eax, dword [ebp - 0x74]
or dword [esi + eax*4], ecx
mov esi, dword [ebp - 0x58]
cmp dword [ebp - 0xa0], 0
jbe 0x407004
cmp esi, dword [ebp - 0x9c]
jl 0x407004
mov eax, dword [ebp - 0x68]
add eax, dword [ebp - 0xb8]
cdq
idiv dword [ebp - 0x8c]
mov ecx, eax
cmp ecx, dword [ebp - 0xa0]
jge 0x407004
mov eax, dword [ebp - 0x8c]
cmp eax, dword [ebp - 0x60]
je 0x406ff7
mov eax, dword [ebp - 0x64]
cdq
idiv dword [ebp - 0x8c]
mov eax, dword [ebp - 0x64]
sub eax, edx
test eax, eax
jle 0x406ff7
shr ebx, 8
sub eax, 1
jne 0x406fef
mov eax, dword [edi + 0x82858]
and dword [eax + ecx*4 + 0x8050], ebx
mov eax, dword [ebp - 0x68]
inc esi
mov ebx, dword [ebp - 0x7c]
inc eax
mov ecx, dword [ebp - 0xbc]
add ebx, 2
sub dword [ebp - 0x78], 1
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x7c], ebx
jne 0x406d98
mov ebx, dword [ebp - 0x90]
jmp 0x40707d
cmp esi, 2
je 0x40703a
cmp esi, 4
jne 0x407078
lea eax, [ebp - 0x54]
push eax
call fcn.00417520
mov edx, dword [ebp - 0x78]
pop ecx
lea ecx, [edx*2 + 0xb]
cmp eax, ecx
jl 0x40705f
push 4
lea eax, [ebp - 0x4b]
push eax
call fcn.004071c7
mov ebx, eax
cmp esi, 2
jne 0x40706f
shl ebx, 4
mov dword [ebp - 0x90], ebx
jmp 0x40707d
shl ebx, 0x10
mov dword [ebp - 0x90], ebx
cmp esi, 1
je 0x40708e
push dword [ebp - 0x5c]
call fcn.0041b680
pop ecx
test eax, eax
je 0x406cd1
xor ebx, ebx
inc ebx
cmp dword [ebp - 0x5c], 0
je 0x4070a0
push dword [ebp - 0x5c]
call fcn.0041aff6
pop ecx
mov al, bl
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00411edf
leave
ret 8
push str._n_Error_reading_hex_file._n
call fcn.00401036
cmp dword [ebp - 0x5c], 0
pop ecx
je 0x4070cd
push dword [ebp - 0x5c]
call fcn.0041aff6
pop ecx
xor al, al
jmp 0x4070a2
push str._n_Hex_file_not_found._n
call fcn.00401036
pop ecx
xor bl, bl
jmp 0x407091