1. Список говнокодов пользователя Myxa

    Всего: 2

  2. PHP / Говнокод #28902

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    <?php
    
    $domains = [
    'edge-star-shv-%s-%s.facebook.com',      /* edge-chat.facebook.com, graph.facebook.com, mbasic.facebook.com, touch.facebook.com */ 
    'instagram-p42-shv-%s-%s.fbcdn.net',     /* www.instagram.com, b.i.instagram.com */
    'edge-sonar-mini-shv-%s-%s.fbcdn.net',   /* не знаю, для чего нужны edge-sonar-mini */
    'edge-star-mini-shv-%s-%s.facebook.com', /* www.facebook.com, m.facebook.com, fb.com */
    'instagram-p3-shv-%s-%s.fbcdn.net',      /* api.instagram.com, i.instagram.com, l.instagram.com, graph.instagram.com, edge-chat.instagram.com, */
                                             /* static.cdninstagram.com, scontent-hel3-1.cdninstagram.com, scontent.cdninstagram.com, */
                                             /* threads.net, www.threads.net */
    'xx-fbcdn-shv-%s-%s.fbcdn.net',          /* scontent-hel3-1.xx.fbcdn.net, static.xx.fbcdn.net, connect.facebook.net, scontent.xx.fbcdn.net */
    'edge-dgw-shv-%s-%s.facebook.com'        /* gateway.facebook.com, gateway.instagram.com, gateway.threads.net */
    ];
    
    $suffices = explode(',', 'akl1,ams2,ams4,arn2,atl3,bcn1,bkk1,bog1,bog2,bom1,bom2,bos5,bru2,ccu1,cdg4,cgk1,cph2,cpt1,del1,del2,den2,den4,dfw5,dub4,dus1,eze1,fco2,for1,fra3,fra5,gig4,gru1,gru2,ham3,hel3,hkg1,hkg4,hou1,hyd1,iad3,jnb1,jnb2,kul2,kul3,lax3,lga3,lhr6,lhr8,lim1,lis1,los2,maa2,mad1,mad2,man2,mct1,mia3,mnl1,mrs2,msp1,muc2,mxp1,mxp2,nrt1,ord5,otp1,pmo1,pnq1,prg1,qro1,scl2,sea1,sin6,sjc3,sof1,syd2,tpe1,vie1,waw1,xsp1,zrh1');
    
    foreach ($domains as $domain) {
      foreach (['01','02','03','04'] as $index) {
        foreach ($suffices as $suffix) {
            $url = sprintf($domain, $index, $suffix);
            $raw = gethostbynamel($url);
            if(!is_array($raw)) continue;
            $ips = implode(',', $raw);
            echo $ips,' ', $url, PHP_EOL;
        }
      }
    }

    Получение списка IP-адресов, используемых сервисами Ф*к, И*м и Threads.

    Myxa, 13 Января 2024

    Комментарии (21)
  3. Си / Говнокод #26828

    +2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    /*
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %                                                                             %
    %                                                                             %
    %                                                                             %
    +  N T M a p M e m o r y                                                      %
    %                                                                             %
    %                                                                             %
    %                                                                             %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %
    %  Mmap() emulates the Unix method of the same name.
    %
    %  The format of the NTMapMemory method is:
    %
    %    MagickPrivate void *NTMapMemory(char *address,size_t length,int protection,
    %      int access,int file,MagickOffsetType offset)
    %
    */
    MagickPrivate void *NTMapMemory(char *address,size_t length,int protection,
      int flags,int file,MagickOffsetType offset)
    {
      DWORD
        access_mode,
        high_length,
        high_offset,
        low_length,
        low_offset,
        protection_mode;
    
      HANDLE
        file_handle,
        map_handle;
    
      void
        *map;
    
      (void) address;
      access_mode=0;
      file_handle=INVALID_HANDLE_VALUE;
      low_length=(DWORD) (length & 0xFFFFFFFFUL);
      high_length=(DWORD) ((((MagickOffsetType) length) >> 32) & 0xFFFFFFFFUL);
      map_handle=INVALID_HANDLE_VALUE;
      map=(void *) NULL;
      low_offset=(DWORD) (offset & 0xFFFFFFFFUL);
      high_offset=(DWORD) ((offset >> 32) & 0xFFFFFFFFUL);
      protection_mode=0;
      if (protection & PROT_WRITE)
        {
          access_mode=FILE_MAP_WRITE;
          if (!(flags & MAP_PRIVATE))
            protection_mode=PAGE_READWRITE;
          else
            {
              access_mode=FILE_MAP_COPY;
              protection_mode=PAGE_WRITECOPY;
            }
        }
      else
        if (protection & PROT_READ)
          {
            access_mode=FILE_MAP_READ;
            protection_mode=PAGE_READONLY;
          }
      if ((file == -1) && (flags & MAP_ANONYMOUS))
        file_handle=INVALID_HANDLE_VALUE;
      else
        file_handle=(HANDLE) _get_osfhandle(file);
      map_handle=CreateFileMapping(file_handle,0,protection_mode,high_length,
        low_length,0);
      if (map_handle)
        {
          map=(void *) MapViewOfFile(map_handle,access_mode,high_offset,low_offset,
            length);
          CloseHandle(map_handle);
        }
      if (map == (void *) NULL)
        return((void *) ((char *) MAP_FAILED));
      return((void *) ((char *) map));
    }

    Мумуляция «mmap» в «Винде». Это даже работает, если пофиксить две строчки (кто угадает, какие именно, тому ничего).

    Отсюда:
    https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/nt-base.c

    Myxa, 30 Июля 2020

    Комментарии (29)