1. PHP / Говнокод #29124

    +1

    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
    if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'g' && strpos($_thread_sub, '/aicg/') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_aicg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
          }
          
          if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_com, '/lolg/') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_lolg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_com, '/overwatch') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_owg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (false && !$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'fa' && strpos($_thread_sub, 'Workwear General') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_denim', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/bag/') !== false && $browser_id === '04d2237a2') {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_bag', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
          }
          
          if (false && !$_pwd_known && !$resto && (BOARD_DIR === 'co' || BOARD_DIR === 'a') && $country !== 'XX' && $browser_id === '02b99990d' && ($country == 'GB' || $country == 'DE' || $country == 'AU' || strpos($_COOKIE['_tcs'], $_SERVER['HTTP_X_TIMEZONE']) === false)) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_peridot', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
          }
          
          if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, 'granblue') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_gbfg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'v' && strpos($_thread_sub, 'gamesdonequick') !== false && $_threat_score >= 0.09 && mt_rand(0, 9) >= 1) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_adgq', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            show_post_successful_fake($resto);
            return;
          }
          
          if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/zzz/') !== false && $_threat_score >= 0.09 && mt_rand(0, 9) >= 1) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_zzz', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            show_post_successful_fake($resto);
            return;
          }
          
          if (!$_pwd_verified && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/funkg/') !== false && $_threat_score >= 0.09) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_funkg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            show_post_successful_fake($resto);
            return;
          }

    4chan.org. Хардкод бан. Продолжение https://govnokod.ru/29122.

    Админы, берите на заметку на свои форумы.

    trusted, known это проверки на число постов, связанных с куки+айпи.

    lemur, 22 Апреля 2025

    Комментарии (27)
  2. Куча / Говнокод #29123

    0

    1. 1
    Просто оффтоп #42

    #12: https://govnokod.ru/27153 https://govnokod.xyz/_27153
    #13: https://govnokod.ru/27159 https://govnokod.xyz/_27159
    #14: https://govnokod.ru/27200 https://govnokod.xyz/_27200
    #15: https://govnokod.ru/27237 https://govnokod.xyz/_27237
    #16: (vanished) https://govnokod.xyz/_27282
    #17: https://govnokod.ru/27319 https://govnokod.xyz/_27319
    #18: https://govnokod.ru/27380 https://govnokod.xyz/_27380
    #19: (vanished) https://govnokod.xyz/_27500
    #20: https://govnokod.ru/27607 https://govnokod.xyz/_27607
    #21: https://govnokod.ru/27951 https://govnokod.xyz/_27951
    #22: https://govnokod.ru/28076 https://govnokod.xyz/_28076
    #23: https://govnokod.ru/28266 https://govnokod.xyz/_28266
    #24: https://govnokod.ru/28373 https://govnokod.xyz/_28373
    #25: https://govnokod.ru/28474 https://govnokod.xyz/_28474
    #26: https://govnokod.ru/28563 https://govnokod.xyz/_28563
    #27: https://govnokod.ru/28645 https://govnokod.xyz/_28645
    #28: (vanished) https://govnokod.xyz/_28664
    #29: https://govnokod.ru/28674 https://govnokod.xyz/_28674
    #30: https://govnokod.ru/28680 https://govnokod.xyz/_28680
    #31: https://govnokod.ru/28688 https://govnokod.xyz/_28688
    #32: https://govnokod.ru/28695 https://govnokod.xyz/_28695
    #33: https://govnokod.ru/28702 https://govnokod.xyz/_28702
    #34: (vanished) https://govnokod.xyz/_28708
    #35: https://govnokod.ru/28715 https://govnokod.xyz/_28715
    #36: https://govnokod.ru/28725 https://govnokod.xyz/_28725
    #37: https://govnokod.ru/28733 https://govnokod.xyz/_28733
    #38: (vanished) https://govnokod.xyz/_28748
    #39: https://govnokod.ru/28758 https://govnokod.xyz/_28758
    #40: https://govnokod.ru/28885 https://govnokod.xyz/_28885
    #41: https://govnokod.ru/29061 https://govnokod.xyz/_29061

    nepeKamHblu_nemyx, 19 Апреля 2025

    Комментарии (29)
  3. PHP / Говнокод #29122

    +1

    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
    $css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/' . $mobilecss . '">';
    	
      // April 2024
      $css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/xa24extra.css">';
      
    	if (SHOW_COUNTRY_FLAGS) {
    		$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/flags.' . CSS_VERSION_FLAGS . '.css">';
    	}
      
      if (ENABLE_BOARD_FLAGS) {
        $_flags_type = (defined('BOARD_FLAGS_TYPE') && BOARD_FLAGS_TYPE) ? BOARD_FLAGS_TYPE : BOARD_DIR;
        $css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'image/flags/' . $_flags_type . '/flags.' . CSS_VERSION_BOARD_FLAGS . '.css">';
      }
      
    	if( CODE_TAGS ) {
    		$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'js/prettify/prettify.' . CSS_VERSION . '.css">';
    	}
    
    	// Various optional tags
    	if( USE_RSS == 1 ) {
    		$rss = '<link rel="alternate" title="RSS feed" href="/' . BOARD_DIR . '/index.rss" type="application/rss+xml">';
    	}
    
    	if( RTA == 1 ) {
    		$rta = '<meta name="rating" content="adult">';
    	}
    
    	if( defined( 'FAVICON' ) ) {
    		$favicon = '<link rel="shortcut icon" href="' . FAVICON . '">';
    	}
    	
    	$thread_unique_ips = 0;
    	$jsUniqueIps = '';
    	
    	if (SHOW_THREAD_UNIQUES) {
        if ($res) {
          $thread_unique_ips = get_unique_ip_count($res);
        }
        
        if ($thread_unique_ips) {
          $jsUniqueIps = 'var unique_ips = ' . $thread_unique_ips . ';';
        }
    	}
      
    	// js tags
    	$jsVersion   = TEST_BOARD ? JS_VERSION_TEST : JS_VERSION;
    	$comLen      = MAX_COM_CHARS;
    	$styleGroup  = style_group();
    	$maxFilesize = MAX_KB * 1024;
    	$maxLines    = MAX_LINES;
    	$jsCooldowns = json_encode(array(
    		'thread' => RENZOKU3,
    		'reply' => RENZOKU,
    		'image' => RENZOKU2
    	));
      
    	$tailSizeJs = '';
    	
      if ($res) {
        $tailSize = get_json_tail_size($res);
        
        if ($tailSize) {
          $tailSizeJs = ",tailSize = $tailSize";
        }
      }

    «Форчан» поломали.

    ISO, 15 Апреля 2025

    Комментарии (25)
  4. JavaScript / Говнокод #29121

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    // java types for typescript
    export type int = number;
    export type float= number;
    export type double = number;
    export type long = number;
    export type short = number;
    export type byte = number;
    export type char = string;
    export type boolean = boolean;
    export type void = void;

    veiny, 12 Апреля 2025

    Комментарии (24)
  5. Си / Говнокод #29120

    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
    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
    #include <stdio.h>
    #include <stddef.h>
    #include <stdlib.h>
    #include <limits.h>
    
    int gcc_rtm_virt_test(int a, int(*f)(int, int(*)(), float*), float fa[static (-1,0,1)]) {
        short s = sizeof (short) + sizeof 0;
        char b[12] = "0123456789";
    
        for (long ll = sizeof b; ll -= 4;) {
            b[ll]   = '0';
            b[ll-1] = '1';
            b[ll-2] = '2';
            b[ll-3] = '3';
        }
    
        return s - ((1 << 2) - (b[0] - '2'));
    }
    
    int gcc_rtm_cf32(int(*f0)(), int(*f1)()) {
        ptrdiff_t d = f1 - f0;
        // guess you know what you're doing
        if (! (d >> sizeof (ptrdiff_t) * CHAR_BIT - 1)) { 
            while (d--) {
                switch(*(unsigned short*)(f0 + d)) {
                    case 0xc3c9:
                        return 0;
                    case 0xb8:
                        if (!*(unsigned int*)(f0 + d + 1)) {
                            return 1;
                        } 
                        break;
                    case 0xC031:
                        return 2;
                }
            }
            return -1;
        };
    
        return -2;
    }
    
    int main() {
    
        switch (gcc_rtm_cf32(gcc_rtm_virt_test, gcc_rtm_cf32)) {
            case -1:
                fprintf(stderr, "Hey, added smth. special? Maybe -Og? \n"), abort();
                break;
            case 0:
                fprintf(stderr, "Hey, -O0 smells like a dead rat.. check your flags!\n"), abort();
                break;
            case 1:
                fprintf(stderr, "Hey, -O1 is still not allowed.. Would you do better?\n"), abort();
                break;
            case 2:
                fprintf(stdout, "Hey, finally you've captured [-O2 || -O3 || -Ofast || -Os] flag!");
                break;
            default:
                fprintf(stderr, "Hey, looks like you've got impl. defined crap, check PTRDIFF_T stuff.. \n"), abort();
                break;
        };
    
    }

    И далее по тексту..gcc'шники опять обкурились в рантайме. Зачэм так делоть, это прикольно?

    BCHARa, 10 Апреля 2025

    Комментарии (141)
  6. Си / Говнокод #29119

    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
    28. 28
    29. 29
    30. 30
    void rtm_guard(void) {
        /*
            Don't even try to MS VC that stuff, zerobuffy 4eyes.
        */
        unsigned char buf0[0];
        unsigned a = 0xF001BA11;
        unsigned b = 0xF001BA11;
        unsigned c = 0x55550000;
        unsigned d = 0xF001BA11;
        unsigned e = 0xF001BA11;
        unsigned char buf1[0];
        ptrdiff_t diff = buf0 - buf1;
    
        const char* prnt;
        switch (diff) {
            case sizeof rtm_guard:
                prnt = "dear Nizhny Novgorod '-O1' lover";
                break;
            case sizeof (int):
                prnt = "'gcc -O0' bastard";
                break;
            default:
                prnt = "\b";
        };
    
        (diff == sizeof (int) || diff == sizeof rtm_guard) ?
        fprintf(stderr, "%s%s%s", 
                    "Hey you, ", prnt, ", what the hell are you trying to bang here w/o mandatory flags? Forgot something? \n"), abort() : 
        0;
    }

    Сodebomb в рантайме наложил. Но нафига? Присосаться хуком и послать курить джуника с лидом как рукопожато билдить?

    BCHARa, 08 Апреля 2025

    Комментарии (21)
  7. Куча / Говнокод #29118

    0

    1. 1
    2. 2
    3. 3
    4. 4
    Ну вот, теперь и я попал в поле зрения спецслужб. 
    Хотя, возможно, я и раньше был в поле зрения спецслужб, а узнал об этом только сейчас.
    
    Почему эти уродцы не пресекают коррупцию? Какой смысл следить за мной?

    Это не паранойя.
    Паранойя разовьется позже. Hemingway.png

    3uMuCTOH, 06 Апреля 2025

    Комментарии (1)
  8. Куча / Говнокод #29117

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    Представьте такую картину: вам 27 лет, Вы идете такой, на работу или еще куда-нибудь и Вас сбивает машина. 
    Или Вам на голову падает бронзовая статуя Владимира Ильича. Или Вас убивает шальная пуля.
    На вас глазеют люди да и Вы сам, с высоты седьмого этажа. Потом Вашу душу засасывает в небо.
    Ваше тело погружают в труповоз и везут на вскрытие. Но этого Вы уже не видите, потому, что началось оформление документов на пограничье.
    Вот - тело закатывают в разделочную, как именуют прозекторский зал, и начинается вскрытие. 
    Через пять минут помощница засовывает трупу - то есть, Вам - градусник в анус. Далее следует диалог примерно такого вида:
    -Леонид Петрович, у него сперма в ректуме...
    -Жертва изнасилования?
    -Да нет, труп - не криминал. 
    -Мда. А на вид и не скажешь.

    ...

    3uMuCTOH, 04 Апреля 2025

    Комментарии (1)
  9. Go / Говнокод #29116

    0

    1. 1
    2. 2
    3. 3
    4. 4
    koko.
      Add(1). 
      Add(2). 
      Add(3)

    Такое трансоформатирование в стандартном линтере.

    3_dar, 03 Апреля 2025

    Комментарии (2)
  10. Си / Говнокод #29115

    0

    1. 1
    #include <console_io.h>

    конио

    3_dar, 03 Апреля 2025

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