Extract device main code