An information processing program to be executed by a computer of a game system that includes a plurality of types of sub devices (6,7,8) and a main device capable of being attached to and detached from any of the sub devices and that executes a game application, wherein the main device includes an image-capturing device, and each of the sub devices includes a detected portion (612-614, 711-712, 811-813) of which an image can be captured by the image-capturing device of the main device that is attached to the sub device; the information processing program causing the computer to function as: a determination unit configured to determine, based on at least one of a position, a shape and an orientation of a first detected portion image representing at least a portion of the detected portion included in a captured image that is captured by the image-capturing device, the type of the sub device to which the main device is attached while the game application is being executed; and a game process execution unit (S9-S12) configured to execute a game process of the game application based on a game operation performed by using the main device and/or the sub device to which the main device is attached while the game application is being executed, wherein the game process execution unit is configured to execute the game process depending on the type of the sub device determined by the determination unit; the detected portion of at least one of the sub devices includes a first portion (612, 711, 811) and a second portion (613, 614, 712, 812, 813); the information processing program: causes the computer to further function as a recognition unit configured to recognize the first portion and recognize the second portion based on the captured image; the determination unit: is configured to determine the type of the sub device to which the main device is attached based on at least one of a position, a shape and an orientation of a first portion image representing the first portion; and as a state of the main device attached to the sub device, is configured to determine a first state where the first portion is recognized and the second portion is not recognized, and a second state where the first portion and the second portion are recognized. a determination unit configured to determine, based on at least one of a position, a shape and an orientation of a first detected portion image representing at least a portion of the detected portion included in a captured image that is captured by the image-capturing device, the type of the sub device to which the main device is attached while the game application is being executed; and a game process execution unit (S9-S12) configured to execute a game process of the game application based on a game operation performed by using the main device and/or the sub device to which the main device is attached while the game application is being executed, wherein the game process execution unit is configured to execute the game process depending on the type of the sub device determined by the determination unit; the detected portion of at least one of the sub devices includes a first portion (612, 711, 811) and a second portion (613, 614, 712, 812, 813); the information processing program: causes the computer to further function as a recognition unit configured to recognize the first portion and recognize the second portion based on the captured image; the determination unit: is configured to determine the type of the sub device to which the main device is attached based on at least one of a position, a shape and an orientation of a first portion image representing the first portion; and as a state of the main device attached to the sub device, is configured to determine a first state where the first portion is recognized and the second portion is not recognized, and a second state where the first portion and the second portion are recognized. is configured to determine the type of the sub device to which the main device is attached based on at least one of a position, a shape and an orientation of a first portion image representing the first portion; and as a state of the main device attached to the sub device, is configured to determine a first state where the first portion is recognized and the second portion is not recognized, and a second state where the first portion and the second portion are recognized.