Exploit database

GH-2adfaeecad917f650fe46a6c164ff0a6

24pparikh/techintel2020-2021

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2019-11358

1,181 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files10

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/teamcode/libraries/AutoTest.java

Java · 16,032 bytes
package org.firstinspires.ftc.teamcode.teamcode.libraries;//package org.firstinspires.ftc.teamcode.libraries;
//
//import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
//import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
//
//import org.firstinspires.ftc.robotcore.external.ClassFactory;
//import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName;
//import org.firstinspires.ftc.robotcore.external.matrices.OpenGLMatrix;
//import org.firstinspires.ftc.robotcore.external.matrices.VectorF;
//import org.firstinspires.ftc.robotcore.external.navigation.Orientation;
//import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer;
//import org.firstinspires.ftc.robotcore.external.navigation.VuforiaTrackable;
//import org.firstinspires.ftc.robotcore.external.navigation.VuforiaTrackableDefaultListener;
//import org.firstinspires.ftc.robotcore.external.navigation.VuforiaTrackables;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import static org.firstinspires.ftc.robotcore.external.navigation.AngleUnit.DEGREES;
//import static org.firstinspires.ftc.robotcore.external.navigation.AxesOrder.XYZ;
//import static org.firstinspires.ftc.robotcore.external.navigation.AxesOrder.YZX;
//import static org.firstinspires.ftc.robotcore.external.navigation.AxesReference.EXTRINSIC;
//import static org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer.CameraDirection.BACK;
//import static org.firstinspires.ftc.teamcode.libraries.Constants.VUFORIA_KEY;
//
//@Autonomous(name = "AutoTest", group = "Concept")
//
//public class AutoTest extends LinearOpMode {
//
//    private static final VuforiaLocalizer.CameraDirection CAMERA_CHOICE = BACK;
//    private static final boolean PHONE_IS_PORTRAIT = false;
//
//
////    private static final String VUFORIA_KEY = "ARSzhHP/////AAABmQ3dyIKKfkcipjZh0HtnoDEkjuCn18CTNUWRN7PTFoedxZLS+QZmpkyXpQnQXFpQ5ol//l0ZwTejVrGRQ4i/kQBrrFJ8E0C7ckr4lzf5bLCvi1/E9x8anPwt2D0UToZ3MB5jPx4T6s/EOs575BtxjL7uv5jrCbQDsXebm2PROU4zC/Dj7+AYFkKCqD3YYLbGPGV4YoSgp9Ihoe+ZF/eae0FLG8K/o4eyfZj0B3aXkRvYi3dC5LY+c76aU72bKTrQ2PDYSxDG8xCaY1JyEyfDA6XqjHjYMvh0BBbb8bAQvPgG6/G50+5L+c/a8u6sbYJLbvVtXdMtrG1EA4CglbnsDs7GyyJmH5AusSwIDb9DQnTA";
//
//
//    // Since ImageTarget trackables use mm to specifiy their dimensions, we must use mm for all the physical dimension.
//    // We will define some constants and conversions here
//    private static final float mmPerInch = 25.4f;
//    private static final float mmTargetHeight = (6) * mmPerInch;          // the height of the center of the target image above the floor
//
//    // Constant for Stone Target
//    private static final float stoneZ = 2.00f * mmPerInch;
//
//    // Constants for the center support targets
//    private static final float bridgeZ = 6.42f * mmPerInch;
//    private static final float bridgeY = 23 * mmPerInch;
//    private static final float bridgeX = 5.18f * mmPerInch;
//    private static final float bridgeRotY = 59;                                 // Units are degrees
//    private static final float bridgeRotZ = 180;
//
//    // Constants for perimeter targets
//    private static final float halfField = 72 * mmPerInch;
//    private static final float quadField = 36 * mmPerInch;
//
//    String positionSkystone = "";
//    double yPosition = 0;
//    double xPosition = 0;
//    boolean startIdentify = true;
//    float distanceToDepot = 75;    //115
//    float distanceToCenterLine = 5.5f;
//    float forwardDistanceSkystone = 28f;
//    float turningDegree = -50;
//
//    // Class Members
//    private OpenGLMatrix lastLocation = null;
//    private VuforiaLocalizer vuforia = null;
//
//
//    WebcamName webcamName = null;
//
//    private boolean targetVisible = false;
//    private float phoneXRotate = 0;
//    private float phoneYRotate = 0;
//    private float phoneZRotate = 0;
//    private AutoLib autoLib;
//
//
//    @Override
//    public void runOpMode() throws InterruptedException {
//        initialize();
//
//        /*
//         * Retrieve the camera we are to use.
//         */
//
//
//        webcamName = hardwareMap.get(WebcamName.class, "Webcam1");
//
//
//        int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName());
//        VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters(cameraMonitorViewId);
//
//        parameters.vuforiaLicenseKey = VUFORIA_KEY;
//
//        parameters.cameraName = webcamName;
//
//        vuforia = ClassFactory.getInstance().createVuforia(parameters);
//
//        VuforiaTrackables targetsSkyStone = this.vuforia.loadTrackablesFromAsset("Skystone");
//
//        VuforiaTrackable stoneTarget = targetsSkyStone.get(0);
//        stoneTarget.setName("Stone Target");
//        VuforiaTrackable blueRearBridge = targetsSkyStone.get(1);
//        blueRearBridge.setName("Blue Rear Bridge");
//        VuforiaTrackable redRearBridge = targetsSkyStone.get(2);
//        redRearBridge.setName("Red Rear Bridge");
//        VuforiaTrackable redFrontBridge = targetsSkyStone.get(3);
//        redFrontBridge.setName("Red Front Bridge");
//        VuforiaTrackable blueFrontBridge = targetsSkyStone.get(4);
//        blueFrontBridge.setName("Blue Front Bridge");
//        VuforiaTrackable red1 = targetsSkyStone.get(5);
//        red1.setName("Red Perimeter 1");
//        VuforiaTrackable red2 = targetsSkyStone.get(6);
//        red2.setName("Red Perimeter 2");
//        VuforiaTrackable front1 = targetsSkyStone.get(7);
//        front1.setName("Front Perimeter 1");
//        VuforiaTrackable front2 = targetsSkyStone.get(8);
//        front2.setName("Front Perimeter 2");
//        VuforiaTrackable blue1 = targetsSkyStone.get(9);
//        blue1.setName("Blue Perimeter 1");
//        VuforiaTrackable blue2 = targetsSkyStone.get(10);
//        blue2.setName("Blue Perimeter 2");
//        VuforiaTrackable rear1 = targetsSkyStone.get(11);
//        rear1.setName("Rear Perimeter 1");
//        VuforiaTrackable rear2 = targetsSkyStone.get(12);
//        rear2.setName("Rear Perimeter 2");
//
//        List<VuforiaTrackable> allTrackables = new ArrayList<VuforiaTrackable>();
//        allTrackables.addAll(targetsSkyStone);
//
//        stoneTarget.setLocation(OpenGLMatrix
//                .translation(0, 0, stoneZ)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, -90)));
//
//        blueFrontBridge.setLocation(OpenGLMatrix
//                .translation(-bridgeX, bridgeY, bridgeZ)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 0, bridgeRotY, bridgeRotZ)));
//
//        blueRearBridge.setLocation(OpenGLMatrix
//                .translation(-bridgeX, bridgeY, bridgeZ)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 0, -bridgeRotY, bridgeRotZ)));
//
//        redFrontBridge.setLocation(OpenGLMatrix
//                .translation(-bridgeX, -bridgeY, bridgeZ)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 0, -bridgeRotY, 0)));
//
//        redRearBridge.setLocation(OpenGLMatrix
//                .translation(bridgeX, -bridgeY, bridgeZ)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 0, bridgeRotY, 0)));
//
//        //Set the position of the perimeter targets with relation to origin (center of field)
//        red1.setLocation(OpenGLMatrix
//                .translation(quadField, -halfField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 180)));
//
//        red2.setLocation(OpenGLMatrix
//                .translation(-quadField, -halfField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 180)));
//
//        front1.setLocation(OpenGLMatrix
//                .translation(-halfField, -quadField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 90)));
//
//        front2.setLocation(OpenGLMatrix
//                .translation(-halfField, quadField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 90)));
//
//        blue1.setLocation(OpenGLMatrix
//                .translation(-quadField, halfField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 0)));
//
//        blue2.setLocation(OpenGLMatrix
//                .translation(quadField, halfField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 0)));
//
//        rear1.setLocation(OpenGLMatrix
//                .translation(halfField, quadField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, -90)));
//
//        rear2.setLocation(OpenGLMatrix
//                .translation(halfField, -quadField, mmTargetHeight)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, -90)));
//
//        if (CAMERA_CHOICE == BACK) {
//            phoneYRotate = -90;
//        } else {
//            phoneYRotate = 90;
//        }
//
//        if (PHONE_IS_PORTRAIT) {
//            phoneXRotate = 90;
//        }
//
//        final float CAMERA_FORWARD_DISPLACEMENT = 4.0f * mmPerInch;   // eg: Camera is 4 Inches in front of robot-center
//        final float CAMERA_VERTICAL_DISPLACEMENT = 8.0f * mmPerInch;   // eg: Camera is 8 Inches above ground
//        final float CAMERA_LEFT_DISPLACEMENT = 0;     // eg: Camera is ON the robot's center line
//
//        OpenGLMatrix robotFromCamera = OpenGLMatrix
//                .translation(CAMERA_FORWARD_DISPLACEMENT, CAMERA_LEFT_DISPLACEMENT, CAMERA_VERTICAL_DISPLACEMENT)
//                .multiplied(Orientation.getRotationMatrix(EXTRINSIC, YZX, DEGREES, phoneYRotate, phoneZRotate, phoneXRotate));
//
//        for (VuforiaTrackable trackable : allTrackables) {
//            ((VuforiaTrackableDefaultListener) trackable.getListener()).setPhoneInformation(robotFromCamera, parameters.cameraDirection);
//        }
//
//        targetsSkyStone.activate();
//        if (startIdentify) {
//            autoLib.calcMove(44, .8f, Constants.Direction.BACKWARD);
//            autoLib.calcMove(15,.7f, Constants.Direction.LEFT);
//            autoLib.calcMove(4, .2f, Constants.Direction.BACKWARD);
//            Thread.sleep(300);
////            autoLib.latchServoFoundation();
//            Thread.sleep(1000);
//            autoLib.calcMove(50, 1f, Constants.Direction.FORWARD);
//            autoLib.calcTurn(-90,1f);
//            autoLib.restServoFoundation();
//            autoLib.calcMove(100, 1f, Constants.Direction.FORWARD);
//            autoLib.calcTurn(48,1f);
//            Thread.sleep(1000);
//            while (!isStopRequested() && startIdentify) {
//
//                targetVisible = false;
//                for (VuforiaTrackable trackable : allTrackables) {
//                    if (((VuforiaTrackableDefaultListener) trackable.getListener()).isVisible()) {
//                        telemetry.addData("Visible Target", trackable.getName());
//                        targetVisible = true;
//
//                        OpenGLMatrix robotLocationTransform = ((VuforiaTrackableDefaultListener) trackable.getListener()).getUpdatedRobotLocation();
//                        if (robotLocationTransform != null) {
//                            lastLocation = robotLocationTransform;
//                        }
//                        break;
//                    }
//                }
//
////            String positionSkystone = "";
////            double yPosition = 0;
////            double xPosition = 0;
//                if (targetVisible) {
//                    // express position (translation) of robot in inches.
//                    VectorF translation = lastLocation.getTranslation();
//                    telemetry.addData("Pos (in)", "{X, Y, Z} = %.1f, %.1f, %.1f",
//                            translation.get(0) / mmPerInch, translation.get(1) / mmPerInch, translation.get(2) / mmPerInch);
//
//                    yPosition = translation.get(1);
//                    xPosition = translation.get(0);
//                    if (yPosition < 0) {
//                        positionSkystone = "Left";
////                        autoLib.calcMove(1, .7f, Constants.Direction.LEFT);
//                        finalMove(-xPosition, yPosition);
//                        distanceToDepot = distanceToCenterLine + 6;
//                    } else {
//                        positionSkystone = "Center";
//                        //if (xPosition <= -25) {
//                        distanceToDepot = distanceToDepot + 20f;
//                        forwardDistanceSkystone = forwardDistanceSkystone + 3;
//                        turningDegree = turningDegree - 3f;
//                        sleep(1000);
//                        yPosition = translation.get(1);
//                        xPosition = translation.get(0);
//                        finalMove(-xPosition, yPosition);
//                        break;
////                        } else {
////                            telemetry.addData("Final Position Reached", "none");
////                        }
//                    }
//
//                    // express the rotation of the robot in degrees.
//                    Orientation rotation = Orientation.getOrientation(lastLocation, EXTRINSIC, XYZ, DEGREES);
//                    telemetry.addData("Rot (deg)", "{Roll, Pitch, Heading} = %.0f, %.0f, %.0f", rotation.firstAngle, rotation.secondAngle, rotation.thirdAngle);
//                } else {
//                    positionSkystone = "Right";
//                    telemetry.addData("Visible Target", "none");
//
//                    distanceToDepot = distanceToDepot + 150;
//                    distanceToDepot = distanceToCenterLine - 2;
//                    forwardDistanceSkystone = forwardDistanceSkystone - 1;
//
//                    autoLib.calcMove(10, .7f, Constants.Direction.RIGHT);
//
//                }
//                telemetry.addData("Skystone Position", positionSkystone);
//                telemetry.update();
//            }
//        }
//
//        targetsSkyStone.deactivate();
//    }
//
//    private void finalMove(double xPosition, double yPosition) throws InterruptedException {
//        telemetry.addData("Final Position Reached", "none");
//        telemetry.addData("X Position ", xPosition);
//        telemetry.addData("Y Position ", yPosition);
//// go near skystone
//
//        autoLib.calcMove((float) (yPosition / 10) + distanceToCenterLine, .9f, Constants.Direction.RIGHT); //when decreased- moves to the left
//        autoLib.calcMove((float) (-xPosition / 10) + forwardDistanceSkystone, .6f, Constants.Direction.FORWARD);   //when increased-moves back
//        autoLib.calcMove(3.5f, .7f, Constants.Direction.BACKWARD);
//        Thread.sleep(500);
////        autoLib.armGrab();
//        Thread.sleep(500);
//        autoLib.calcMove(30f, .8f, Constants.Direction.FORWARD);    //16
//        autoLib.calcTurn((int) turningDegree, .7f); //53
////        if (distanceToDepot > 120) {//195
////            distanceToDepot = 130;//205
////        }
////        autoLib.moveArmUpSeconds();
//        autoLib.calcMove(distanceToDepot, 1f, Constants.Direction.BACKWARD);
////        autoLib.scoreServo();
//        autoLib.calcMove(50, .15f, Constants.Direction.BACKWARD);
//    }
//
//    private void initialize() {
//        telemetry.addData("Status", "Initializing...");
//        telemetry.update();
//
//        autoLib = new AutoLib(this);
//
//        telemetry.addData("Status", "Ready");
//        telemetry.update();
//        waitForStart();
//
//        telemetry.addData("Status", "Running");
//        telemetry.update();
//    }
//}