Compare commits

..

2 Commits

Author SHA1 Message Date
zhaarey 86d1c1a507 change dns 3 months ago
zhaarey aa1886e487 fix get-m3u8 3 months ago
  1. 6
      test.c

@ -113,7 +113,7 @@ static inline void init() {
// raise(SIGSTOP); // raise(SIGSTOP);
fprintf(stderr, "[+] starting...\n"); fprintf(stderr, "[+] starting...\n");
setenv("ANDROID_DNS_MODE", "local", 1); setenv("ANDROID_DNS_MODE", "local", 1);
static const char *resolvers[2] = {"1.1.1.1", "1.0.0.1"}; static const char *resolvers[2] = {"1.1.1.1", "223.5.5.5"};
_resolv_set_nameservers_for_net(0, resolvers, 2, "."); _resolv_set_nameservers_for_net(0, resolvers, 2, ".");
#ifndef MyRelease #ifndef MyRelease
subhook_install(subhook_new( subhook_install(subhook_new(
@ -458,11 +458,13 @@ void handle_m3u8(const int connfd) {
readfull(connfd, &adam[i], sizeof(uint8_t)); readfull(connfd, &adam[i], sizeof(uint8_t));
} }
char *ptr; char *ptr;
unsigned long adamID = strtoul(adam, &ptr, adamSize); unsigned long adamID = strtoul(adam, &ptr, 10);
const char *m3u8 = get_m3u8_method_play(leaseMgr, adamID); const char *m3u8 = get_m3u8_method_play(leaseMgr, adamID);
if (m3u8 == NULL) { if (m3u8 == NULL) {
fprintf(stderr, "[.] failed to get m3u8 of adamId: %ld\n", adamID);
writefull(connfd, NULL, sizeof(NULL)); writefull(connfd, NULL, sizeof(NULL));
} else { } else {
fprintf(stderr, "[.] m3u8 adamId: %ld, url: %s\n", adamID, m3u8);
strcat((char *)m3u8, "\n"); strcat((char *)m3u8, "\n");
writefull(connfd, (void *)m3u8, strlen(m3u8)); writefull(connfd, (void *)m3u8, strlen(m3u8));
} }

Loading…
Cancel
Save