- 1
IT Оффтоп #215
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
IT Оффтоп #215
#185: https://govnokod.ru/28794 https://govnokod.xyz/_28794
#186: https://govnokod.ru/28815 https://govnokod.xyz/_28815
#187: https://govnokod.ru/28833 https://govnokod.xyz/_28833
#188: https://govnokod.ru/28837 https://govnokod.xyz/_28837
#189: https://govnokod.ru/28840 https://govnokod.xyz/_28840
#190: https://govnokod.ru/28875 https://govnokod.xyz/_28875
#191: https://govnokod.ru/28878 https://govnokod.xyz/_28878
#192: https://govnokod.ru/28886 https://govnokod.xyz/_28886
#193: https://govnokod.ru/28911 https://govnokod.xyz/_28911
#194: https://govnokod.ru/28914 https://govnokod.xyz/_28914
#195: https://govnokod.ru/28917 https://govnokod.xyz/_28917
#196: https://govnokod.ru/28925 https://govnokod.xyz/_28925
#197: https://govnokod.ru/28935 https://govnokod.xyz/_28935
#198: https://govnokod.ru/28938 https://govnokod.xyz/_28938
#199: https://govnokod.ru/28942 https://govnokod.xyz/_28942
#200: https://govnokod.ru/28945 https://govnokod.xyz/_28945
#201: https://govnokod.ru/28948 https://govnokod.xyz/_28948
#202: https://govnokod.ru/28951 https://govnokod.xyz/_28951
#203: https://govnokod.ru/28954 https://govnokod.xyz/_28954
#204: https://govnokod.ru/28971 https://govnokod.xyz/_28971
#205: https://govnokod.ru/28986 https://govnokod.xyz/_28986
#206: https://govnokod.ru/28991 https://govnokod.xyz/_28991
#207: https://govnokod.ru/29002 https://govnokod.xyz/_29002
#208: https://govnokod.ru/29060 https://govnokod.xyz/_29060
#209: https://govnokod.ru/29070 https://govnokod.xyz/_29070
#210: https://govnokod.ru/29079 https://govnokod.xyz/_29079
#211: https://govnokod.ru/29092 https://govnokod.xyz/_29092
#212: https://govnokod.ru/29093 https://govnokod.xyz/_29093
#213: https://govnokod.ru/29104 https://govnokod.xyz/_29104
#214: https://govnokod.ru/29114 https://govnokod.xyz/_29114
+1
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 это проверки на число постов, связанных с куки+айпи.
0
Просто оффтоп #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
+1
$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";
}
}
«Форчан» поломали.
0
// 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;
0
#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'шники опять обкурились в рантайме. Зачэм так делоть, это прикольно?
0
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 в рантайме наложил. Но нафига? Присосаться хуком и послать курить джуника с лидом как рукопожато билдить?
0
Ну вот, теперь и я попал в поле зрения спецслужб.
Хотя, возможно, я и раньше был в поле зрения спецслужб, а узнал об этом только сейчас.
Почему эти уродцы не пресекают коррупцию? Какой смысл следить за мной?
Это не паранойя.
Паранойя разовьется позже. Hemingway.png
0
Представьте такую картину: вам 27 лет, Вы идете такой, на работу или еще куда-нибудь и Вас сбивает машина.
Или Вам на голову падает бронзовая статуя Владимира Ильича. Или Вас убивает шальная пуля.
На вас глазеют люди да и Вы сам, с высоты седьмого этажа. Потом Вашу душу засасывает в небо.
Ваше тело погружают в труповоз и везут на вскрытие. Но этого Вы уже не видите, потому, что началось оформление документов на пограничье.
Вот - тело закатывают в разделочную, как именуют прозекторский зал, и начинается вскрытие.
Через пять минут помощница засовывает трупу - то есть, Вам - градусник в анус. Далее следует диалог примерно такого вида:
-Леонид Петрович, у него сперма в ректуме...
-Жертва изнасилования?
-Да нет, труп - не криминал.
-Мда. А на вид и не скажешь.
...
0
koko.
Add(1).
Add(2).
Add(3)
Такое трансоформатирование в стандартном линтере.