- 1
http://blog.extremehacking.org/blog/2017/07/31/hungarian-hacker-arrested-pressing-f12/
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+4
http://blog.extremehacking.org/blog/2017/07/31/hungarian-hacker-arrested-pressing-f12/
Вкратце: в Будапеште за миллион баксов набыдлокодили систему продажи билетов на общественный транспорт с кучей багов, как например поле с суммой было readonly, но если поправить html в браузере, то можно цену поменять, а на бэкенде никто не стал проверку суммы делать. Пацанчик этот баг нашел, написал в саппорт, а через 2 недели его мусора загребли.
−98
Если Не ЕстьОшибки Тогда
СформироватьФайлы(КоличествоФайлов, Объект.ВидВыгрузки, ВыгружатьСведенияОЗданиях, ВыгружатьДоговорыУправления, ВыгружатьСпособыФормированияФондаКР, ВыгружатьЗаявкиНаДобавлениеВременныхАдресов,
Объект.КаталогВыгрузки, МакетЗаявокНаДобВА, МакетСФКР, МакетМКД, МакетЖД, МакетДУ, МакетЛС, МакетПУ, МакетРасчетыРСО, МакетДОИ, ДополнительныеСоглашенияДУ, ДополнительныеУслугиДУ,
КоммунальныеУслугиДУ, ТаблицаДУ, ТаблицаЖД, ТаблицаЖилыхПомещений, ТаблицаКодовУслуг, ТаблицаКомнатЖД, ТаблицаКомнатМКД, ТаблицаЛицевыхСчетов, ТаблицаМКД, ТаблицаНежилыхПомещений,
ТаблицаПодъездов, КоличествоПартийМКД, КоличествоПартийЖД, СформированныеФайлы, ЭтотОбъект, СтруктураИменТаблицФормы, ТаблицаЗаявокНаДобВА, ТаблицаСФКР, ТаблицаСостоянияРасчетовРСОПериоды,
ТаблицаСостоянияРасчетовРСОДоговоры, Истина);
КонецЕсли;
хоть убей, ну зачем так?????
−79
int main( void )
{
fraction f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15;
fraction t1f1, t1f2, t1f3, t1f4, t1f5, t1f6, t1f7, t1f8, t1f9, t1f10, t1f11, t1f12, t1f13, t1f14, t1f15;
fraction t2f1, t2f2, t2f3, t2f4, t2f5, t2f6, t2f7, t2f8, t2f9, t2f10, t2f11, t2f12, t2f13, t2f14, t2f15;
fraction t3f1, t3f2, t3f3, t3f4, t3f5, t3f6, t3f7, t3f8, t3f9, t3f10, t3f11, t3f12, t3f13, t3f14, t3f15;
fraction t4f1, t4f2, t4f3, t4f4, t4f5, t4f6, t4f7, t4f8, t4f9, t4f10, t4f11, t4f12, t4f13, t4f14, t4f15;
fraction t5f1, t5f2, t5f3, t5f4, t5f5, t5f6, t5f7, t5f8, t5f9, t5f10, t5f11, t5f12, t5f13, t5f14, t5f15;
fraction t6f1, t6f2, t6f3, t6f4, t6f5, t6f6, t6f7, t6f8, t6f9, t6f10, t6f11, t6f12, t6f13, t6f14, t6f15;
fraction t7f1, t7f2, t7f3, t7f4, t7f5, t7f6, t7f7, t7f8, t7f9, t7f10, t7f11, t7f12, t7f13, t7f14, t7f15;
fraction t8f1, t8f2, t8f3, t8f4, t8f5, t8f6, t8f7, t8f8, t8f9, t8f10, t8f11, t8f12, t8f13, t8f14, t8f15;
fraction t9f1, t9f2, t9f3, t9f4, t9f5, t9f6, t9f7, t9f8, t9f9, t9f10, t9f11, t9f12, t9f13, t9f14, t9f15;
fraction t10f1, t10f2, t10f3, t10f4, t10f5, t10f6, t10f7, t10f8, t10f9, t10f10, t10f11, t10f12, t10f13, t10f14, t10f15;
fraction t11f1, t11f2, t11f3, t11f4, t11f5, t11f6, t11f7, t11f8, t11f9, t11f10, t11f11, t11f12, t11f13, t11f14, t11f15;
fraction t12f1, t12f2, t12f3, t12f4, t12f5, t12f6, t12f7, t12f8, t12f9, t12f10, t12f11, t12f12, t12f13, t12f14, t12f15;
fraction t13f1, t13f2, t13f3, t13f4, t13f5, t13f6, t13f7, t13f8, t13f9, t13f10, t13f11, t13f12, t13f13, t13f14, t13f15;
fraction t14f1, t14f2, t14f3, t14f4, t14f5, t14f6, t14f7, t14f8, t14f9, t14f10, t14f11, t14f12, t14f13, t14f14, t14f15;
fraction t15f1, t15f2, t15f3, t15f4, t15f5, t15f6, t15f7, t15f8, t15f9, t15f10, t15f11, t15f12, t15f13, t15f14, t15f15;
fraction current;
current.getnum( 1 );
int den( 0 );
int num ( 1 );
do
{
cout << "Enter den: ";
cin >> den;
if( den > 16 )
{
cout << "Very big den! Try again!" << endl;
continue;
}
if( den < 2 )
{
cout << "Very small den! Try again!" << endl;
continue;
}
current.getden( den );
}
while( den > 16 || den < 2 );
//////////////////////////////////////////////////////////////////////////////////////////////
cout << endl;
cout << "----------------------------------------------------------------------" << endl;
f1 = current;
f1.showfrac( ); cout << " ";
current.getnum( ++num );
if( den > num )
{
f2 = current;
f2.lowterms( );
f2.showfrac( ); cout << " ";
}
current.getnum( ++num );
if( den > num )
{
f3 = current;
f3.lowterms( );
f3.showfrac( ); cout << " ";
}
current.getnum( ++num );
if( den > num )
{
f4 = current;
f4.lowterms( );
f4.showfrac( ); cout << " ";
}
current.getnum( ++num );
if( den > num )
{
f5 = current;
f5.lowterms( );
f5.showfrac( ); cout << " ";
}
current.getnum( ++num );
if( den > num )
{
f6 = current;
f6.lowterms( );
f6.showfrac( ); cout << " ";
}
current.getnum( ++num );
if( den > num )
{
f7 = current;
f7.lowterms( );
f7.showfrac( ); cout << " ";
}
current.getnum( ++num );
if( den > num )
{
f8 = current;
f8.lowterms( );
f8.showfrac( ); cout << " ";
}
current.getnum( ++num );
if( den > num )
{
f9 = current;
Выполнение задания. Массивы? Проверка ввода? Не, не слышали!
−677
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let rootViewController = LAMainViewController(nibName: nil, bundle: nil)
let navigationController = LANavigationController()
let gradientLayer = CAGradientLayer()
gradientLayer.colors = [UIColor.blackColor().CGColor, UIColor(hexString: "330033", alpha: 1)!.CGColor]
gradientLayer.locations = [0, 1]
gradientLayer.frame = window!.frame
navigationController.viewControllers = [rootViewController]
window!.rootViewController = navigationController
window!.makeKeyAndVisible()
window!.layer.insertSublayer(gradientLayer, atIndex: 0)
return true
}
давайте слой зафигачим на окно
+9
template<typename T> struct OBB
{
vector3<T> position;
matrix3<T> transform;
vector3<T> GetPoint(bool positiveX, bool positiveY, bool positiveZ) const
{
const vector3<T> localUnitPoint = {T(positiveX)-T(0.5), T(positiveY)-T(0.5), T(positiveZ)-T(0.5)};
return vector3<T>(GetFullTransform()*vector4<T>(localUnitPoint, 1));
}
AABB<T> BoundingAABB() const
{
AABB<T> result;
result.max = result.min = position;
for(bool b1: {false, true})
for(bool b2: {false, true})
for(bool b3: {false, true}) //Перебираем все точки параллелепипеда
result.AddPoint(GetPoint(b1, b2, b3));
return result;
}
};
Что-то даже не могу вспомнить, когда я такое написал. Случайно наткнулся и решил, что это должно быть здесь.
−94
Если
ЗначениеЗаполнено(СсылкаНаОбъект) И ((Строка(ТипЗнч(СсылкаНаОбъект))="Документ ссылка: Поступление товаров и услуг") или (Строка(ТипЗнч(СсылкаНаОбъект))="Документ ссылка: Установка цен номенклатуры") или (Строка(ТипЗнч(СсылкаНаОбъект))="Документ ссылка: Перемещение товаров")) Тогда
Проверяется тип документа
+5
public string GenerateKey(int length)
{
System.Random random = new System.Random();
char[] chArray = new char[62]
{
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'
};
string str = string.Empty;
for (int index = 0; index < length; ++index)
str += (string) (object) chArray[random.Next(0, 35)];
return str;
}
Решил декомпилировать "Копатель Онлайн" ради лулзов.
+9
if(buf_modem[cntfrommodem] == 'S')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem ] == 'R')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'I')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'N')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'G')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == ':')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == ' ')
{
cnt_comma = 0;
while(cnt_comma < 2)
{
cntfrommodem = cntfrommodem + 1;
if(buf_modem[cntfrommodem] == ',')
cnt_comma = cnt_comma + 1;
}
cntfrommodem = cntfrommodem + 1 ;
}
}
}else
cntfrommodem -= 4;
}else cntfrommodem -= 3;
}else cntfrommodem -= 2;
}else cntfrommodem--;
}
buf_modem[tmpcntr] = buf_modem[cntfrommodem];
cntfrommodem++;
tmpcntr++;
}
cntfrommodem = 0;
while(1)
{
/// ищем мэдэ5
if(buf_modem[cntfrommodem] == '#')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'S')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem ] == 'E')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'R')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'V')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'A')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'N')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'S')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == 'W')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == ':')
{
cntfrommodem = cntfrommodem + 1 ;
if(buf_modem[cntfrommodem] == ' ')
{
Парсинг ответа от GSM-модема. Код из реального проекта для STM32.
+3
/**
* Gibt ein Array mit den Fehlermeldungen zurück
*
* @todo Test
* @param void
* @return bool|array True = Keine Fehler, Array = Fehler-Array
* @access public
* @since version 4.0
*/
public function get_meldung()
{
if($fehler_meldung == null)
{
return true;
}
else
{
for($errori=0;$fehleri<count($this->fehler_meldung);$fehleri++)
{
echo $this->fehler_meldung[$fehleri]."<br>\n";
}
return false;
}
}
Ещё немного немецкого говнокода.
По описанию ЭТО возвращает true когда ошибок нет или array с ошибками.
+9
#define GetLastError rand /* optimize API work */
#define struct union /* saves memory */
#define while if /* saves cpu time */