diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f55cb91 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.1) + +project(googerteller VERSION 1.0 + DESCRIPTION "Audible feedback on Google communications" + LANGUAGES CXX) + + +set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use") +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS ON) + +#add_library(support STATIC ext/powerblog/h2o-pp.cc +# ext/powerblog/ext/simplesocket/swrappers.cc +# ext/powerblog/ext/simplesocket/comboaddress.cc +# ext/powerblog/ext/simplesocket/sclasses.cc +# ext/fmt-7.1.3/src/format.cc) + + + +#target_include_directories(support PUBLIC ext/powerblog/ext/simplesocket ext/powerblog/ext ext/fmt-7.1.3/include/) +#target_link_libraries(support PUBLIC -lh2o-evloop -lssl -lcrypto Threads::Threads) + +add_executable(teller teller.cc ) +target_link_libraries(teller -lpcaudio) + +#enable_testing() +#add_test(testname testrunner) diff --git a/README.md b/README.md index db338ee..134b95a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ # googerteller audible feedback on just how much your browsing feeds into google + +## How to compile +First install libpcaudio, then: + +``` +cmake . +make +``` + +## How to run: + +``` +sudo tcpdump -n -l dst net 1.2.3.4/32 $(for a in $(jq .prefixes < goog.json | grep ipv4Prefix | cut -f2 -d: | sed s/\"//g); do echo or dst net $a; done) | ./teller +``` + +And then cry. diff --git a/goog.json b/goog.json new file mode 100644 index 0000000..ea336c3 --- /dev/null +++ b/goog.json @@ -0,0 +1,179 @@ +{ + "syncToken": "1661015026669", + "creationTime": "2022-08-20T10:03:46.669184", + "prefixes": [{ + "ipv4Prefix": "8.8.4.0/24" + }, { + "ipv4Prefix": "8.8.8.0/24" + }, { + "ipv4Prefix": "8.34.208.0/20" + }, { + "ipv4Prefix": "8.35.192.0/20" + }, { + "ipv4Prefix": "23.236.48.0/20" + }, { + "ipv4Prefix": "23.251.128.0/19" + }, { + "ipv4Prefix": "34.0.0.0/15" + }, { + "ipv4Prefix": "34.2.0.0/16" + }, { + "ipv4Prefix": "34.3.0.0/23" + }, { + "ipv4Prefix": "34.3.3.0/24" + }, { + "ipv4Prefix": "34.3.4.0/24" + }, { + "ipv4Prefix": "34.3.8.0/21" + }, { + "ipv4Prefix": "34.3.16.0/20" + }, { + "ipv4Prefix": "34.3.32.0/19" + }, { + "ipv4Prefix": "34.3.64.0/18" + }, { + "ipv4Prefix": "34.3.128.0/17" + }, { + "ipv4Prefix": "34.4.0.0/14" + }, { + "ipv4Prefix": "34.8.0.0/13" + }, { + "ipv4Prefix": "34.16.0.0/12" + }, { + "ipv4Prefix": "34.32.0.0/11" + }, { + "ipv4Prefix": "34.64.0.0/10" + }, { + "ipv4Prefix": "34.128.0.0/10" + }, { + "ipv4Prefix": "35.184.0.0/13" + }, { + "ipv4Prefix": "35.192.0.0/14" + }, { + "ipv4Prefix": "35.196.0.0/15" + }, { + "ipv4Prefix": "35.198.0.0/16" + }, { + "ipv4Prefix": "35.199.0.0/17" + }, { + "ipv4Prefix": "35.199.128.0/18" + }, { + "ipv4Prefix": "35.200.0.0/13" + }, { + "ipv4Prefix": "35.208.0.0/12" + }, { + "ipv4Prefix": "35.224.0.0/12" + }, { + "ipv4Prefix": "35.240.0.0/13" + }, { + "ipv4Prefix": "64.15.112.0/20" + }, { + "ipv4Prefix": "64.233.160.0/19" + }, { + "ipv4Prefix": "66.22.228.0/23" + }, { + "ipv4Prefix": "66.102.0.0/20" + }, { + "ipv4Prefix": "66.249.64.0/19" + }, { + "ipv4Prefix": "70.32.128.0/19" + }, { + "ipv4Prefix": "72.14.192.0/18" + }, { + "ipv4Prefix": "74.114.24.0/21" + }, { + "ipv4Prefix": "74.125.0.0/16" + }, { + "ipv4Prefix": "104.154.0.0/15" + }, { + "ipv4Prefix": "104.196.0.0/14" + }, { + "ipv4Prefix": "104.237.160.0/19" + }, { + "ipv4Prefix": "107.167.160.0/19" + }, { + "ipv4Prefix": "107.178.192.0/18" + }, { + "ipv4Prefix": "108.59.80.0/20" + }, { + "ipv4Prefix": "108.170.192.0/18" + }, { + "ipv4Prefix": "108.177.0.0/17" + }, { + "ipv4Prefix": "130.211.0.0/16" + }, { + "ipv4Prefix": "136.112.0.0/12" + }, { + "ipv4Prefix": "142.250.0.0/15" + }, { + "ipv4Prefix": "146.148.0.0/17" + }, { + "ipv4Prefix": "162.216.148.0/22" + }, { + "ipv4Prefix": "162.222.176.0/21" + }, { + "ipv4Prefix": "172.110.32.0/21" + }, { + "ipv4Prefix": "172.217.0.0/16" + }, { + "ipv4Prefix": "172.253.0.0/16" + }, { + "ipv4Prefix": "173.194.0.0/16" + }, { + "ipv4Prefix": "173.255.112.0/20" + }, { + "ipv4Prefix": "192.158.28.0/22" + }, { + "ipv4Prefix": "192.178.0.0/15" + }, { + "ipv4Prefix": "193.186.4.0/24" + }, { + "ipv4Prefix": "199.36.154.0/23" + }, { + "ipv4Prefix": "199.36.156.0/24" + }, { + "ipv4Prefix": "199.192.112.0/22" + }, { + "ipv4Prefix": "199.223.232.0/21" + }, { + "ipv4Prefix": "207.223.160.0/20" + }, { + "ipv4Prefix": "208.65.152.0/22" + }, { + "ipv4Prefix": "208.68.108.0/22" + }, { + "ipv4Prefix": "208.81.188.0/22" + }, { + "ipv4Prefix": "208.117.224.0/19" + }, { + "ipv4Prefix": "209.85.128.0/17" + }, { + "ipv4Prefix": "216.58.192.0/19" + }, { + "ipv4Prefix": "216.73.80.0/20" + }, { + "ipv4Prefix": "216.239.32.0/19" + }, { + "ipv6Prefix": "2001:4860::/32" + }, { + "ipv6Prefix": "2404:6800::/32" + }, { + "ipv6Prefix": "2404:f340::/32" + }, { + "ipv6Prefix": "2600:1900::/28" + }, { + "ipv6Prefix": "2606:73c0::/32" + }, { + "ipv6Prefix": "2607:f8b0::/32" + }, { + "ipv6Prefix": "2620:11a:a000::/40" + }, { + "ipv6Prefix": "2620:120:e000::/40" + }, { + "ipv6Prefix": "2800:3f0::/32" + }, { + "ipv6Prefix": "2a00:1450::/32" + }, { + "ipv6Prefix": "2c0f:fb50::/32" + }] +} diff --git a/teller.cc b/teller.cc new file mode 100644 index 0000000..4b7b9a5 --- /dev/null +++ b/teller.cc @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +int main() +{ + audio_object* ao; + + ao=create_audio_device_object(0, "teller", ""); + if(!ao) { + cerr<<"Unable to open audio file "< counter; + auto player = [&]() { + vector data; + int ourcounter=0; + data.reserve(44100); + while(counter >= 0) { + data.clear(); + if(ourcounter < counter) { + for(int n=0; n < 250; ++n) { + int16_t val = 20000 * sin((n/44100.0) * 500 * 2 * M_PI); + data.push_back(val); + } + ourcounter++; + } + else { + for(int n=0; n < 150; ++n) { + data.push_back(0); + } + } + + audio_object_write(ao, &data[0], data.size() * sizeof(decltype(data)::value_type)); + // audio_object_flush(ao); + } + }; + + std::thread athread(player); + string line; + while(getline(cin, line)) { + counter++; + } + counter = -1; + athread.join(); + sleep(1); +}