Function at 0x406df9
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.0040c1c4
push 0x440570
lea eax, [ebp - 0x5c]
push esi
push eax
call fcn.0041bb07
add esp, 0xc
test eax, eax
jne 0x4073d6
imul ecx, dword [edi + 0xa0018], 0x4c
mov edx, dword [edi + 0xa0014]
or dword [ebp - 0x7c], 0xffffffff
push 0
movzx eax, byte [ecx + edi + 0x299]
movzx esi, byte [ecx + edi + 0x298]
mov dword [ebp - 0x88], eax
imul eax, edx, 0x120
movzx ecx, byte [ecx + edi + 0x296]
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x8c], ecx
mov ebx, dword [eax + edi + 0xc08]
mov dword [ebp - 0x94], ebx
mov ebx, dword [eax + edi + 0xc00]
imul ebx, esi
mov dword [ebp - 0x70], ebx
xor ebx, ebx
mov dword [ebp - 0x90], ebx
movzx ebx, byte [eax + edi + 0xc14]
mov dword [ebp - 0xa4], ebx
mov ebx, dword [eax + edi + 0xc18]
test ebx, ebx
movzx eax, byte [eax + edi + 0xc0c]
cmove ebx, dword [ebp - 0x7c]
mov dword [ebp - 0xa0], ebx
mov dword [ebp - 0xb4], eax
pop ebx
test eax, eax
je 0x406efb
mov edx, 0x8008
mov esi, eax
imul eax, dword [edi + 0xa0018], 0x4c
mov ecx, dword [edi + 0x8fb5c]
mov eax, dword [eax + edi + 0x288]
mov dword [edx + ecx], eax
lea edx, [edx + 4]
sub esi, 1
jne 0x406ed3
mov edx, dword [edi + 0xa0014]
mov esi, dword [ebp - 0x60]
imul eax, edx, 0x120
mov ecx, edi
mov dword [ebp - 0x98], esi
mov dword [ebp - 0x80], ebx
mov dword [ebp - 0x6c], ebx
mov eax, dword [eax + edi + 0xcc0]
mov dword [ebp - 0x84], eax
call fcn.004088c9
test al, al
je 0x406f4c
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 - 0xa8], eax
imul eax, dword [edi + 0xa0014], 0x120
mov eax, dword [eax + edi + 0xc00]
sub eax, dword [ebp - 0x84]
mov dword [ebp - 0xb0], eax
lea eax, [ebp - 0x54]
push eax
call fcn.004133c0
push dword [ebp - 0x5c]
call fcn.0041bcf0
add esp, 0x10
jmp 0x40738b
push dword [ebp - 0x5c]
lea eax, [ebp - 0x54]
push 0x50
push eax
call fcn.0041b7ab
add esp, 0xc
test eax, eax
je 0x4073b8
cmp byte [ebp - 0x54], 0x3a
jne 0x407382
lea eax, [ebp - 0x54]
push eax
call fcn.00417b90
pop ecx
cmp eax, 0xb
jb 0x407382
push 2
lea eax, [ebp - 0x53]
push eax
call fcn.004074cc
mov dword [ebp - 0x78], eax
lea eax, [ebp - 0x51]
push 4
push eax
call fcn.004074cc
add eax, ebx
mov dword [ebp - 0x58], eax
lea eax, [ebp - 0x4d]
push 2
push eax
call fcn.004074cc
mov esi, eax
test esi, esi
jne 0x407335
lea eax, [ebp - 0x54]
push eax
call fcn.00417b90
mov edx, dword [ebp - 0x78]
pop ecx
lea ecx, [edx*2 + 0xb]
cmp eax, ecx
jl 0x407382
test edx, edx
jle 0x407382
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 - 0xac], ecx
sub eax, edx
mov ecx, edx
mov dword [ebp - 0x7c], ebx
sub ecx, dword [ebp - 0xa0]
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.004074cc
mov ebx, eax
mov eax, dword [ebp - 0x64]
or ebx, 0xffffff00
test eax, eax
jle 0x407095
shl ebx, 8
or ebx, 0xff
sub eax, 1
jne 0x407087
cmp esi, dword [ebp - 0x70]
jge 0x4070ad
cmp esi, dword [ebp - 0x80]
jl 0x4070ad
mov eax, dword [edi + 0x8fb5c]
mov ecx, dword [ebp - 0x74]
mov eax, dword [eax]
and dword [eax + ecx*4], ebx
cmp dword [ebp - 0x84], 0
jbe 0x4070e7
cmp esi, dword [ebp - 0x6c]
jl 0x4070e7
cmp esi, dword [ebp - 0xa8]
jge 0x4070e7
mov eax, dword [ebp - 0x68]
xor edx, edx
add eax, dword [ebp - 0xac]
div dword [ebp - 0x60]
mov ecx, eax
mov eax, dword [edi + 0x8fb5c]
add ecx, dword [ebp - 0xb0]
mov dword [ebp - 0x74], ecx
mov eax, dword [eax]
and dword [eax + ecx*4], ebx
mov eax, dword [ebp - 0x94]
cmp esi, eax
jl 0x40714f
test eax, eax
je 0x40714f
imul eax, dword [edi + 0xa0014], 0x120
movzx esi, word [eax + edi + 0xc04]
test si, si
je 0x40714c
mov eax, dword [ebp - 0x68]
cdq
idiv dword [ebp - 0x88]
mov ecx, eax
cmp ecx, esi
jge 0x40714c
mov eax, dword [ebp - 0x88]
cmp eax, dword [ebp - 0x60]
je 0x407142
mov eax, dword [ebp - 0x64]
cdq
idiv dword [ebp - 0x88]
mov eax, dword [ebp - 0x64]
sub eax, edx
test eax, eax
jle 0x407142
shr ebx, 8
sub eax, 1
jne 0x40713a
mov eax, dword [edi + 0x8fb5c]
and dword [eax + ecx*4 + 8], ebx
mov esi, dword [ebp - 0x58]
imul eax, dword [edi + 0xa0014], 0x120
mov dword [ebp - 0x9c], eax
mov ecx, dword [eax + edi + 0xc10]
cmp esi, ecx
jl 0x4072ab
cmp dword [ebp - 0xb4], 0
jbe 0x4072ab
mov eax, esi
sub eax, ecx
mov ecx, dword [ebp - 0x98]
cdq
idiv ecx
mov edx, eax
mov eax, dword [ebp - 0x9c]
mov al, byte [eax + edi + 0xc9c]
and al, 0xf0
cmp al, 0xa0
je 0x4071a1
cmp al, 0xb0
jne 0x4071c3
lea eax, [edx - 1]
cmp eax, 6
jbe 0x4071ae
test dl, 1
je 0x4071b5
mov edx, 0xff
jmp 0x4071c3
test edx, edx
jle 0x4071c3
lea eax, [edx - 6]
cdq
sub eax, edx
mov edx, eax
sar edx, 1
cmp ecx, dword [ebp - 0x60]
je 0x4071e3
cmp dword [ebp - 0x64], 1
jle 0x4071e3
imul eax, dword [edi + 0xa0018], 0x4c
mov ecx, ebx
shr ecx, 0x10
mov ebx, dword [eax + edi + 0x288]
and ebx, ecx
mov eax, dword [ebp - 0x9c]
movzx eax, byte [eax + edi + 0xc0c]
cmp edx, eax
jge 0x4072ab
mov eax, dword [edi + 0x8fb5c]
lea ecx, [eax + edx*4]
imul eax, dword [edi + 0xa0014], 0x90
add eax, edx
movzx eax, word [edi + eax*2 + 0xc20]
and eax, ebx
and dword [ecx + 0x8008], eax
cmp esi, dword [ebp - 0x70]
jge 0x4072ab
mov eax, dword [edi + 0x8fb5c]
mov esi, dword [ebp - 0x74]
shl esi, 2
mov ecx, dword [eax]
imul eax, dword [edi + 0xa0014], 0x90
add eax, edx
movzx eax, word [edi + eax*2 + 0xc20]
and eax, ebx
and dword [ecx + esi], eax
mov eax, dword [edi + 0x8fb5c]
mov ecx, dword [eax]
imul eax, dword [edi + 0xa0018], 0x4c
add ecx, esi
cmp dword [eax + edi + 0x288], 0xffff
jne 0x407274
or dword [ecx], 0xf000
jmp 0x4072a8
or dword [ecx], 0xff0000
imul eax, dword [edi + 0xa0014], 0x90
add edx, eax
mov eax, dword [edi + 0x8fb5c]
mov esi, dword [eax]
movzx ecx, word [edi + edx*2 + 0xc20]
movzx eax, word [edi + edx*2 + 0xc44]
not ecx
and ecx, eax
mov eax, dword [ebp - 0x74]
or dword [esi + eax*4], ecx
mov esi, dword [ebp - 0x58]
cmp dword [ebp - 0xa4], 0
jbe 0x407309
cmp esi, dword [ebp - 0xa0]
jl 0x407309
mov eax, dword [ebp - 0x68]
add eax, dword [ebp - 0xb8]
cdq
idiv dword [ebp - 0x8c]
mov ecx, eax
cmp ecx, dword [ebp - 0xa4]
jge 0x407309
mov eax, dword [ebp - 0x8c]
cmp eax, dword [ebp - 0x60]
je 0x4072fc
mov eax, dword [ebp - 0x64]
cdq
idiv dword [ebp - 0x8c]
mov eax, dword [ebp - 0x64]
sub eax, edx
test eax, eax
jle 0x4072fc
shr ebx, 8
sub eax, 1
jne 0x4072f4
mov eax, dword [edi + 0x8fb5c]
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 0x40705e
mov ebx, dword [ebp - 0x90]
jmp 0x407382
cmp esi, 2
je 0x40733f
cmp esi, 4
jne 0x40737d
lea eax, [ebp - 0x54]
push eax
call fcn.00417b90
mov edx, dword [ebp - 0x78]
pop ecx
lea ecx, [edx*2 + 0xb]
cmp eax, ecx
jl 0x407364
push 4
lea eax, [ebp - 0x4b]
push eax
call fcn.004074cc
mov ebx, eax
cmp esi, 2
jne 0x407374
shl ebx, 4
mov dword [ebp - 0x90], ebx
jmp 0x407382
shl ebx, 0x10
mov dword [ebp - 0x90], ebx
cmp esi, 1
je 0x407393
push dword [ebp - 0x5c]
call fcn.0041bcf0
pop ecx
test eax, eax
je 0x406f97
xor ebx, ebx
inc ebx
cmp dword [ebp - 0x5c], 0
je 0x4073a5
push dword [ebp - 0x5c]
call fcn.0041b666
pop ecx
mov al, bl
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041254c
leave
ret 8
push str._n_Error_reading_hex_file._n
call fcn.00401036
cmp dword [ebp - 0x5c], 0
pop ecx
je 0x4073d2
push dword [ebp - 0x5c]
call fcn.0041b666
pop ecx
xor al, al
jmp 0x4073a7
push str._n_Hex_file_not_found._n
call fcn.00401036
pop ecx
xor bl, bl
jmp 0x407396