This commit is contained in:
bert hubert 2022-08-21 22:48:40 +02:00
parent c85b0d5a61
commit 6dc02ef81f
4 changed files with 281 additions and 0 deletions

27
CMakeLists.txt Normal file
View File

@ -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)

View File

@ -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.

179
goog.json Normal file
View File

@ -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"
}]
}

59
teller.cc Normal file
View File

@ -0,0 +1,59 @@
#include <iostream>
#include <vector>
#include <math.h>
#include <unistd.h>
#include <thread>
#include <atomic>
#include <pcaudiolib/audio.h>
using namespace std;
int main()
{
audio_object* ao;
ao=create_audio_device_object(0, "teller", "");
if(!ao) {
cerr<<"Unable to open audio file "<<endl;
return 0;
}
int res = audio_object_open(ao, AUDIO_OBJECT_FORMAT_S16LE, 44100, 1);
if(res < 0) {
cerr<<"Error opening audio: "<<audio_object_strerror(ao, res)<<endl;
}
std::atomic<int64_t> counter;
auto player = [&]() {
vector<int16_t> 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);
}