Code: Select all
if found != -1 :
print
print 'Suitable Location Found for Script injection on Image Offset :', location+found
var = raw_input("Enable Telnet or Advanced Mode or nothing on image( T/a/n )? ")
print 'Patching File...'
ifile.seek( location + found )
if var == 'a' or var == 'A':
ifile.write( ';/mtd_rwarea/SamyGO.sh&' )
print "TV will initiate '/mtd_rwarea/SamyGO.sh' script on each start."
print
if var == 'n' or var == 'N':
print "Telnet patch skipped."
print
return False
else:
ifile.write( ';/etc/telnetd_start.sh&' )
print "Telnet Enabled on image."
print
ifile.close()
return True