Exploit databaseDownload repository ZIP
GH-51374c4970287cfc6dca6abc44f73866
satheesh575555/system_bt_aosp10-r33_cve-2021-0397
Sources for CVE-2021-0397
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files38
satheesh575555/system_bt_aosp10-r33_cve-2021-0397Revision 0e5f2721b71b
- ↑..Parent directory
- beacon.cc
- beacon.h
- beacon_swarm.cc
- beacon_swarm.h
- broken_adv.cc
- broken_adv.h
- car_kit.cc
- car_kit.h
- classic.cc
- classic.h
- device.cc
- device.h
- device_properties.cc
- device_properties.h
- h4_packetizer.cc
- h4_packetizer.h
- h4_protocol.cc
- h4_protocol.h
- hci_packetizer.cc
- hci_packetizer.h
- hci_protocol.cc
- hci_protocol.h
- hci_socket_device.cc
- hci_socket_device.h
- keyboard.cc
- keyboard.h
- link_layer_socket_device.cc
- link_layer_socket_device.h
- loopback.cc
- loopback.h
- polled_socket.cc
- polled_socket.h
- remote_loopback_device.cc
- remote_loopback_device.h
- server_port_factory.cc
- server_port_factory.h
- sniffer.cc
- sniffer.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
vendor_libs/test_vendor_lib/model/devices/beacon_swarm.cc
Text · 2,131 bytes/*
* Copyright 2016 The Android Open Source Project
*
* 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
*
* http://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.
*/
#define LOG_TAG "beacon_swarm"
#include "beacon_swarm.h"
#include "model/setup/device_boutique.h"
using std::vector;
namespace test_vendor_lib {
bool BeaconSwarm::registered_ = DeviceBoutique::Register(LOG_TAG, &BeaconSwarm::Create);
BeaconSwarm::BeaconSwarm() {
advertising_interval_ms_ = std::chrono::milliseconds(1280);
properties_.SetLeAdvertisementType(BTM_BLE_NON_CONNECT_EVT);
properties_.SetLeAdvertisement({
0x15, // Length
BTM_BLE_AD_TYPE_NAME_CMPL,
'g',
'D',
'e',
'v',
'i',
'c',
'e',
'-',
'b',
'e',
'a',
'c',
'o',
'n',
'_',
's',
'w',
'a',
'r',
'm',
0x02, // Length
BTM_BLE_AD_TYPE_FLAG,
BTM_BLE_BREDR_NOT_SPT | BTM_BLE_GEN_DISC_FLAG,
});
properties_.SetLeScanResponse({0x06, // Length
BTM_BLE_AD_TYPE_NAME_SHORT, 'c', 'b', 'e', 'a', 'c'});
}
void BeaconSwarm::Initialize(const vector<std::string>& args) {
if (args.size() < 2) return;
Address addr;
if (Address::FromString(args[1], addr)) properties_.SetLeAddress(addr);
if (args.size() < 3) return;
SetAdvertisementInterval(std::chrono::milliseconds(std::stoi(args[2])));
}
void BeaconSwarm::TimerTick() {
Address beacon_addr = properties_.GetLeAddress();
uint8_t* low_order_byte = (uint8_t*)(&beacon_addr);
*low_order_byte += 1;
properties_.SetLeAddress(beacon_addr);
Beacon::TimerTick();
}
} // namespace test_vendor_lib