- 1
Пиздец-оффтоп #33
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+3
Пиздец-оффтоп #33
#4: https://govnokod.ru/26689 https://govnokod.xyz/_26689
#5: https://govnokod.ru/26784 https://govnokod.xyz/_26784
#5: https://govnokod.ru/26839 https://govnokod.xyz/_26839
#6: https://govnokod.ru/26986 https://govnokod.xyz/_26986
#7: https://govnokod.ru/27007 https://govnokod.xyz/_27007
#8: https://govnokod.ru/27023 https://govnokod.xyz/_27023
#9: https://govnokod.ru/27098 https://govnokod.xyz/_27098
#10: https://govnokod.ru/27125 https://govnokod.xyz/_27125
#11: https://govnokod.ru/27129 https://govnokod.xyz/_27129
#12: https://govnokod.ru/27184 https://govnokod.xyz/_27184
#13: https://govnokod.ru/27286 https://govnokod.xyz/_27286
#14: https://govnokod.ru/27298 https://govnokod.xyz/_27298
#15: https://govnokod.ru/27322 https://govnokod.xyz/_27322
#16: https://govnokod.ru/27328 https://govnokod.xyz/_27328
#17: https://govnokod.ru/27346 https://govnokod.xyz/_27346
#18: https://govnokod.ru/27374 https://govnokod.xyz/_27374
#19: https://govnokod.ru/27468 https://govnokod.xyz/_27468
#20: https://govnokod.ru/27469 https://govnokod.xyz/_27469
#21: https://govnokod.ru/27479 https://govnokod.xyz/_27479
#22: https://govnokod.ru/27485 https://govnokod.xyz/_27485
#23: https://govnokod.ru/27493 https://govnokod.xyz/_27493
#24: https://govnokod.ru/27501 https://govnokod.xyz/_27501
#25: https://govnokod.ru/27521 https://govnokod.xyz/_27521
#26: https://govnokod.ru/27545 https://govnokod.xyz/_27545
#27: https://govnokod.ru/27572 https://govnokod.xyz/_27572
#28: https://govnokod.ru/27580 https://govnokod.xyz/_27580
#29: https://govnokod.ru/27738 https://govnokod.xyz/_27738
#30: https://govnokod.ru/27751 https://govnokod.xyz/_27751
#31: https://govnokod.ru/27754 https://govnokod.xyz/_27754
#32: https://govnokod.ru/27786 https://govnokod.xyz/_27786
−2
_ _
|_| |_|
| | /^^^\ | |
_| |_ (| "o" |) _| |_
_| | | | _ (_---_) _ | | | |_
| | | | |' | _| |_ | `| | | | |
\ / / \ \ /
\ / / /(. .)\ \ \ /
\ / / / | . | \ \ \ /
\ \/ / ||Y|| \ \/ /
\_/ || || \_/
() ()
|| ||
ooO Ooo
Битч
−2
мдеее
мдеее
+1
#include <stdio.h>
#define new(class) _##class##_##new
#define impl(class, method) _##class##_##method
struct Calculate
{
int(*getOne)(struct Calculate*);
};
int impl(Calculate, getOne)(struct Calculate* this) { return 1; }
void* new(Calculate)(void)
{
struct Calculate* class = malloc(sizeof(struct Calculate));
class->getOne = impl(Calculate, getOne);
return class;
}
struct CalculateProxy
{
struct Calculate;
};
int impl(CalculateProxy, getOne)(struct Calculate* this)
{
printf("Method call!\n");
return impl(Calculate, getOne)(this);
}
void* new(CalculateProxy)(void)
{
struct CalculateProxy* class = malloc(sizeof(struct CalculateProxy));
class->getOne = impl(CalculateProxy, getOne);
return class;
}
int main(void)
{
struct Calculate* calc = new(CalculateProxy)();
printf("%X!\n", calc->getOne(calc));
}
жавашок попросил реализовать паттерн прокси на Си
−2
#include <iostream>
#include <cmath>
#include <signal.h>
#define lovu struct
#define cpp ptrdiff_t
struct forever{};
lovu forever hactehbka(void) {return {};}
int love(void) {return 0;}
void bacbka(void) {}
auto bormand = (cpp(hactehbka) + cpp(bacbka)) != cpp(love);
int main(void)
{
if(bormand)
kill(bormand, SIGINT);
auto sad = cpp(bacbka) - cpp(love),
chance = cpp(love) - cpp(hactehbka),
never = cpp(bacbka) - cpp(hactehbka);
auto usocute = [chance, never, sad](void) -> void
{
putchar(sad * (chance - never / chance / 2) - sad / chance);
putchar(sad * (chance - never / chance / 2) + sad / chance);
};
auto mydear = [chance, sad, never](void) -> void
{
putchar(sad * chance / (never / chance) + never / chance / 2 + (never + cpp(love) / (never / chance) - cpp(hactehbka) / (never / chance)) + never - (never / chance * 1.5));
putchar(9 * chance + never / chance);
putchar(std::abs(cpp(signal) - cpp(hactehbka) + chance * 2 + never * 3 + sad - 9) / std::pow(never / chance, 3));
};
putchar(sad * (chance - never / chance / 2));
usocute();
putchar(never * (chance - never / chance) + sad - (sad / (cpp(love) - cpp(hactehbka))) * (never / chance * 1.5));
mydear();
putchar(chance * 10 + never / chance);
usocute();
putchar((chance + never / chance / 2) * 10 + (never / chance) * 2);
auto ohyes = 69.8886;
putchar(ohyes);
putchar(chance * 10 + never / chance);
putchar(chance + never / chance / 2);
putchar(never * (chance - never / chance) + sad - (sad / (cpp(love) - cpp(hactehbka))) * (never / chance * 1.5));
mydear();
for(auto&& c : {1.5f, 3.f, 6.5f})
putchar(ohyes + M_PI + never / chance * c);
putchar(ohyes);
putchar(chance + never / chance * 1.5);
return 0;
}
+1
npm install
очередной npm пакет с трояном
https://www.bleepingcomputer.com/news/security/popular-coa-npm-library-hijacked-to-steal-user-passwords/
−1
#include <cstdio>
int main(void)
{
static char data[] = "sosu hui\n";
__asm
{
mov eax, 0
ploop:
mov bl, [data + eax]
push eax
push bx
call putchar
pop bx
pop eax
inc eax
cmp bl, 0
jnz ploop
}
return 0;
}
−2
// Подгрузка аватаров пользователей.
Bmp:=TBitMap.Create; // Нет более изящного спооба узнать тип изображения, не колупаясь в заголовках. Расширение файлов картинок зачастую фиктивное.
try // Зная, что ава может быть только двух типов - jpg и png, я решил пойти конём.
Bmp.PixelFormat:=pf32Bit;
Bmp.Width:=16;
Bmp.Height:=16;
ImgConv:=True;
Png:=TPngObject.Create;
try
try
Comm.RawAvatar.Position:=0;
Png.LoadFromStream(Comm.RawAvatar);
Bmp.Canvas.StretchDraw(Bmp.Canvas.ClipRect, Png);
except
ImgConv:=False; // Ошибка конвертирования. Не совпал формат - идем дальше, пробуем jpg...
end;
finally
Png.Free; // нет смысла раскручивать стек, ибо исключение в любом случае отловится try..except
end;
if not ImgConv then
begin
Jpg:=TJPEGImage.Create;
try
try
Comm.RawAvatar.Position:=0;
Jpg.LoadFromStream(Comm.RawAvatar);
Bmp.Canvas.StretchDraw(Bmp.Canvas.ClipRect, Jpg);
except
end;
finally
Jpg.Free;
end;
end;
CommentList.Items[I].ImageIndex:=Images.AddMasked(Bmp, clWhite);
finally
Bmp.Free;
end;
end;
"Тут всюду густая вонь, то жаркая и приятная, то теплая и противная, но одинаково волнующая, особая, пароходная, мешающаяся с морской свежестью"
@ Бунин.
Теперь минусатор умеет подгружать авы.
https://dropmefiles.com/USQKW
0
// https://github.com/dxFeed/dxfeed-c-api/blob/8f24055298c9751344db72da03ab8eb37dfeb6a5/src/DXAlgorithms.h#L63
#define CHECKED_CALL(func, param) \
do { \
if (!func(param)) { \
return false; \
} \
} while (false)
#define CHECKED_CALL_0(func) \
do { \
if (!func()) { \
return false; \
} \
} while (false)
#define CHECKED_CALL_1(func, param1) \
do { \
if (!func(param1)) { \
return false; \
} \
} while (false)
#define CHECKED_CALL_2(func, param1, param2) \
do { \
if (!func(param1, param2)) { \
return false; \
} \
} while (false)
#define CHECKED_CALL_3(func, param1, param2, param3) \
do { \
if (!func(param1, param2, param3)) { \
return false; \
} \
} while (false)
#define CHECKED_CALL_4(func, param1, param2, param3, param4) \
do { \
if (!func(param1, param2, param3, param4)) { \
return false; \
} \
} while (false)
#define CHECKED_CALL_5(func, param1, param2, param3, param4, param5) \
do { \
if (!func(param1, param2, param3, param4, param5)) { \
return false; \
} \
} while (false)
Мокроебства
+1
#include <string>
#include <type_traits>
#include <iostream>
template<int N> struct tag {};
template<typename T, int N>
struct loophole_t
{
friend auto loophole(tag<N>) { return T{}; };
};
#define BA(c) auto loophole(tag< (c) >);
#define Cb(c) BA(c) BA(c+1) BA(c+2) BA(c+3) BA(c+4)
#define KA(c) Cb(c) Cb(c+5) Cb(c+10) Cb(c+15) Cb(c+20)
#define ZDES(c) KA(c) KA(c+20) KA(c+40) KA(c+60) KA(c+80)
#define BACbKAZDES ZDES(0) ZDES(80) ZDES(160) ZDES(240) ZDES(300)
BACbKAZDES
template<int I>
struct wrp
{
int a;
};
int main(void)
{
sizeof(loophole_t<wrp<67>, 0>);
sizeof(loophole_t<wrp<66>, 1>);
sizeof(loophole_t<wrp<68>, 2>);
sizeof(loophole_t<wrp<99>, 3>);
sizeof(loophole_t<wrp<76>, 4>);
sizeof(loophole_t<wrp<66>, 5>);
sizeof(loophole_t<wrp<33>, 6>);
sizeof(loophole_t<wrp<73>, 7>);
sizeof(loophole_t<wrp<66>, 8>);
sizeof(loophole_t<wrp<68>, 9>);
sizeof(loophole_t<wrp<85>, 10>);
sizeof(loophole_t<wrp<70>, 11>);
sizeof(loophole_t<wrp<79>, 12>);
sizeof(loophole_t<wrp<99>, 13>);
sizeof(loophole_t<wrp<76>, 14>);
sizeof(loophole_t<wrp<66>, 15>);
sizeof(loophole_t<wrp<33>, 16>);
sizeof(loophole_t<wrp<109>, 17>);
sizeof(loophole_t<wrp<112>, 18>);
sizeof(loophole_t<wrp<119>, 19>);
sizeof(loophole_t<wrp<102>, 20>);
std::string nactenbka;
#define L(c, i) if(std::is_same< wrp< (c) >, decltype( loophole(tag< (i) >{}) )>::value) nactenbka.push_back((char)( c-1 ) );
#define O(c, i) L(c, i) L(c+1, i) L(c+2, i) L(c+3, i) L(c+4, i)
#define V(c, i) O(c, i) O(c+5, i) O(c+10,i) O(c+15,i) O(c+20,i)
#define E(c, i) V(c, i) V(c+20,i) V(c+40,i) V(c+60,i) V(c+80,i)
#define LOVE(c, i) E(c, i) V(c+80, i) V(c+100, i)
#define FORE(i) LOVE(0, i)
#define VER(i) FORE(i) FORE(i+1) FORE(i+2) FORE(i+3) FORE(i+4)
#define FOREVER VER(0) VER(5) VER(10) VER(15) FORE(20)
FOREVER
std::cout << nactenbka << std::endl;
return 0;
}
<3