Acts on maltooligosaccharides that have a degree of polymerization (DP) of 4 or more, amylose, and soluble or raw starch to produce glucose and maltooligosaccharides up to DP5 by a hydrolysis reaction. Also acts on maltooligosyl trehaloses that have DP5 or more to produce trehalose as the major hydrolysis product. Endohydrolysis of (1->4)-alpha-D-glucosidic linkages in polysaccharides containing three or more (1->4)-alpha-linked D-glucose units. Optimum pH is 6.0. Optimum temperature is 40 degrees Celsius. Belongs to the glycosyl hydrolase 119 (GH119) family.