Exploit databaseDownload repository ZIP
GH-7d1d061134d2f84a23cf4a0e171249e3
aabdeldayem1/ftc-2023
Sources for CVE-2019-11358
1,181 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files86
aabdeldayem1/ftc-2023Revision 7e849a22dcb6
- ↑..Parent directory
- images/
- samples/
- FtcBlocksProjects_common.js
- FtcBlocks_common.js
- acceleration.js
- acceleration_sensor.js
- analog_input.js
- analog_output.js
- android_accelerometer.js
- android_gyroscope.js
- android_orientation.js
- android_sound_pool.js
- android_text_to_speech.js
- angular_velocity.js
- bno055imu.js
- bno055imu_parameters.js
- clipboard_util.js
- color.js
- color_range_sensor.js
- color_sensor.js
- compass_sensor.js
- cr_servo.js
- dbg_log.js
- dc_motor.js
- digital_channel.js
- distance_sensor.js
- elapsed_time.js
- elapsed_time2.js
- file_manager.js
- gamepad.js
- gyro_sensor.js
- hardware_util.js
- images.css
- ir_seeker_sensor.js
- led.js
- led_effect.js
- light_sensor.js
- linear_op_mode.js
- locale.js
- magnetic_flux.js
- matrix_f.js
- misc.js
- mr_i2c_compass_sensor.js
- mr_i2c_range_sensor.js
- navigation.js
- open_gl_matrix.js
- optical_distance_sensor.js
- orientation.js
- pidf_coefficients.js
- position.js
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
TeamCode/build/intermediates/assets/debug/blocks/servo_controller.js
JavaScript · 8,440 bytes/**
* @license
* Copyright 2016 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview FTC robot blocks related to servo controller.
* @author lizlooney@google.com (Liz Looney)
*/
// The following are generated dynamically in HardwareUtil.fetchJavaScriptForHardware():
// createServoControllerDropdown
// The following are defined in vars.js:
// createNonEditableField
// functionColor
// getPropertyColor
Blockly.Blocks['servoController_getProperty'] = {
init: function() {
var PROPERTY_CHOICES = [
['PwmStatus', 'PwmStatus'],
];
this.setOutput(true); // no type, for compatibility
this.appendDummyInput()
.appendField(createServoControllerDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(new Blockly.FieldDropdown(PROPERTY_CHOICES), 'PROP');
this.setColour(getPropertyColor);
// Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this;
var TOOLTIPS = [
['PwmStatus', 'Returns the PwmStatus status of the set of servos connected to this ' +
'controller: ENABLED, DISABLED, or MIXED.'],
];
this.setTooltip(function() {
var key = thisBlock.getFieldValue('PROP');
for (var i = 0; i < TOOLTIPS.length; i++) {
if (TOOLTIPS[i][0] == key) {
return TOOLTIPS[i][1];
}
}
return '';
});
}
};
Blockly.JavaScript['servoController_getProperty'] = function(block) {
var identifier = block.getFieldValue('IDENTIFIER');
var property = block.getFieldValue('PROP');
var code = identifier + '.get' + property + '()';
return [code, Blockly.JavaScript.ORDER_FUNCTION_CALL];
};
Blockly.FtcJava['servoController_getProperty'] = function(block) {
var identifier = Blockly.FtcJava.importDeclareAssign_(block, 'IDENTIFIER', 'ServoController');
var property = block.getFieldValue('PROP');
var code = identifier + '.get' + property + '()';
return [code, Blockly.FtcJava.ORDER_FUNCTION_CALL];
};
Blockly.Blocks['servoController_getProperty_PwmStatus'] = {
init: function() {
var PROPERTY_CHOICES = [
['PwmStatus', 'PwmStatus'],
];
this.setOutput(true, 'ServoController.PwmStatus');
this.appendDummyInput()
.appendField(createServoControllerDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(new Blockly.FieldDropdown(PROPERTY_CHOICES), 'PROP');
this.setColour(getPropertyColor);
// Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this;
var TOOLTIPS = [
['PwmStatus', 'Returns the PwmStatus status of the set of servos connected to this ' +
'controller: ENABLED, DISABLED, or MIXED.'],
];
this.setTooltip(function() {
var key = thisBlock.getFieldValue('PROP');
for (var i = 0; i < TOOLTIPS.length; i++) {
if (TOOLTIPS[i][0] == key) {
return TOOLTIPS[i][1];
}
}
return '';
});
}
};
Blockly.JavaScript['servoController_getProperty_PwmStatus'] =
Blockly.JavaScript['servoController_getProperty'];
Blockly.FtcJava['servoController_getProperty_PwmStatus'] =
Blockly.FtcJava['servoController_getProperty'];
// Enums
Blockly.Blocks['servoController_enum_pwmStatus'] = {
init: function() {
var PWM_STATUS_CHOICES = [
['ENABLED', 'ENABLED'],
['DISABLED', 'DISABLED'],
['MIXED', 'MIXED'],
];
this.setOutput(true); // no type, for compatibility
this.appendDummyInput()
.appendField(createNonEditableField('PwmStatus'))
.appendField('.')
.appendField(new Blockly.FieldDropdown(PWM_STATUS_CHOICES), 'PWM_STATUS');
this.setColour(getPropertyColor);
// Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this;
var TOOLTIPS = [
['ENABLED', 'The PwmStatus value ENABLED.'],
['DISABLED', 'The PwmStatus value DISABLED.'],
['MIXED', 'The PwmStatus value MIXED.'],
];
this.setTooltip(function() {
var key = thisBlock.getFieldValue('PWM_STATUS');
for (var i = 0; i < TOOLTIPS.length; i++) {
if (TOOLTIPS[i][0] == key) {
return TOOLTIPS[i][1];
}
}
return '';
});
}
};
Blockly.JavaScript['servoController_enum_pwmStatus'] = function(block) {
var code = '"' + block.getFieldValue('PWM_STATUS') + '"';
return [code, Blockly.JavaScript.ORDER_ATOMIC];
};
Blockly.FtcJava['servoController_enum_pwmStatus'] = function(block) {
var code = 'ServoController.PwmStatus.' + block.getFieldValue('PWM_STATUS');
Blockly.FtcJava.generateImport_('ServoController');
return [code, Blockly.FtcJava.ORDER_MEMBER];
};
Blockly.Blocks['servoController_typedEnum_pwmStatus'] = {
init: function() {
var PWM_STATUS_CHOICES = [
['ENABLED', 'ENABLED'],
['DISABLED', 'DISABLED'],
['MIXED', 'MIXED'],
];
this.setOutput(true, 'ServoController.PwmStatus');
this.appendDummyInput()
.appendField(createNonEditableField('PwmStatus'))
.appendField('.')
.appendField(new Blockly.FieldDropdown(PWM_STATUS_CHOICES), 'PWM_STATUS');
this.setColour(getPropertyColor);
// Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this;
var TOOLTIPS = [
['ENABLED', 'The PwmStatus value ENABLED.'],
['DISABLED', 'The PwmStatus value DISABLED.'],
['MIXED', 'The PwmStatus value MIXED.'],
];
this.setTooltip(function() {
var key = thisBlock.getFieldValue('PWM_STATUS');
for (var i = 0; i < TOOLTIPS.length; i++) {
if (TOOLTIPS[i][0] == key) {
return TOOLTIPS[i][1];
}
}
return '';
});
}
};
Blockly.JavaScript['servoController_typedEnum_pwmStatus'] =
Blockly.JavaScript['servoController_enum_pwmStatus'];
Blockly.FtcJava['servoController_typedEnum_pwmStatus'] =
Blockly.FtcJava['servoController_enum_pwmStatus'];
// Functions
Blockly.Blocks['servoController_pwmEnable'] = {
init: function() {
this.appendDummyInput()
.appendField('call')
.appendField(createServoControllerDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(createNonEditableField('pwmEnable'));
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(functionColor);
this.setTooltip('Enables all of the servos connected to this controller.');
}
};
Blockly.JavaScript['servoController_pwmEnable'] = function(block) {
var identifier = block.getFieldValue('IDENTIFIER');
return identifier + '.pwmEnable();\n';
};
Blockly.FtcJava['servoController_pwmEnable'] = function(block) {
var identifier = Blockly.FtcJava.importDeclareAssign_(block, 'IDENTIFIER', 'ServoController');
return identifier + '.pwmEnable();\n';
};
Blockly.Blocks['servoController_pwmDisable'] = {
init: function() {
this.appendDummyInput()
.appendField('call')
.appendField(createServoControllerDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(createNonEditableField('pwmDisable'));
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(functionColor);
this.setTooltip('Disables all of the servos connected to this controller.');
}
};
Blockly.JavaScript['servoController_pwmDisable'] = function(block) {
var identifier = block.getFieldValue('IDENTIFIER');
return identifier + '.pwmDisable();\n';
};
Blockly.FtcJava['servoController_pwmDisable'] = function(block) {
var identifier = Blockly.FtcJava.importDeclareAssign_(block, 'IDENTIFIER', 'ServoController');
return identifier + '.pwmDisable();\n';
};