111
Programación / Programación General / [Delphi] DH Icon Changer 0.5
en: 11 Abril 2014, 18:36 pm
Version final de este programa para cambiarle el icono a cualquier programa (eso creo).
Una imagen :
El codigo.
// DH Icon Changer 0.5
// (C) Doddy Hackman 2014
// Based on IconChanger By Chokstyle
// Thanks to Chokstyle
unit icon;
interface
uses
Winapi. Windows , Winapi. Messages , System. SysUtils , System. Variants ,
System. Classes , Vcl. Graphics ,
Vcl. Controls , Vcl. Forms , Vcl. Dialogs , madRes, Vcl. StdCtrls ,
Vcl. Imaging . pngimage , Vcl. ExtCtrls , Vcl. ComCtrls , about;
type
TForm1 = class ( TForm)
Image1: TImage;
GroupBox1: TGroupBox;
Edit1: TEdit;
Button1: TButton;
OpenDialog1: TOpenDialog;
StatusBar1: TStatusBar;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
Button2: TButton;
GroupBox4: TGroupBox;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Edit2: TEdit;
Image2: TImage;
OpenDialog2: TOpenDialog;
procedure Button1Click( Sender: TObject ) ;
procedure Button4Click( Sender: TObject ) ;
procedure Button5Click( Sender: TObject ) ;
procedure FormCreate( Sender: TObject ) ;
procedure Button2Click( Sender: TObject ) ;
procedure Button3Click( Sender: TObject ) ;
private
{ Private declarations }
public
{ Public declarations }
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1. Button1Click ( Sender: TObject ) ;
begin
if OpenDialog1. Execute then
begin
Edit1. Text : = OpenDialog1. FileName ;
end ;
end ;
procedure TForm1. Button2Click ( Sender: TObject ) ;
begin
if OpenDialog2. Execute then
begin
Image2. Picture . LoadFromFile ( OpenDialog2. FileName ) ;
Edit2. Text : = OpenDialog2. FileName ;
end ;
end ;
procedure TForm1. Button3Click ( Sender: TObject ) ;
var
op: string ;
change: dword ;
valor: string ;
begin
valor : = IntToStr ( 128 ) ;
op : = InputBox( 'Backup' , 'Backup ?' , 'Yes' ) ;
if op = 'Yes' then
begin
CopyFile( PChar ( Edit1. Text ) , PChar ( ExtractFilePath ( Application. ExeName ) +
'backup' + ExtractFileExt ( Edit1. Text ) ) , True ) ;
end ;
try
begin
change : = BeginUpdateResourceW( PWideChar ( wideString ( Edit1. Text ) ) , false ) ;
LoadIconGroupResourceW( change, PWideChar ( wideString ( valor) ) , 0 ,
PWideChar ( wideString ( Edit2. Text ) ) ) ;
EndUpdateResourceW( change, false ) ;
StatusBar1. Panels [ 0 ] . Text : = '[+] Changed !' ;
Form1. StatusBar1 . Update ;
end ;
except
begin
StatusBar1. Panels [ 0 ] . Text : = '[-] Error' ;
Form1. StatusBar1 . Update ;
end ;
end ;
end ;
procedure TForm1. Button4Click ( Sender: TObject ) ;
begin
Form2. Show ;
end ;
procedure TForm1. Button5Click ( Sender: TObject ) ;
begin
Form1. Close ( ) ;
Form2. Close ( ) ;
end ;
procedure TForm1. FormCreate ( Sender: TObject ) ;
begin
OpenDialog1. InitialDir : = GetCurrentDir ;
OpenDialog2. InitialDir : = GetCurrentDir ;
OpenDialog2. Filter : = 'Icons|*.ico|' ;
end ;
end .
// The End ?
Si quieren bajar el programa lo pueden hacer de
aca .
112
Programación / Programación General / [Delphi] LocateIP 0.5
en: 4 Abril 2014, 20:16 pm
Version final de este programa para localizar la IP y DNS de una pagina.
Una imagen :
El codigo :
// LocateIP 0.5
// (C) Doddy Hackman 2014
// Credits :
// Based on the services :
// To get IP -- http://whatismyipaddress.com/
// To locate IP -- http://www.melissadata.com/
// To get DNS -- http://www.ip-adress.com/
// Thanks to whatismyipaddress.com , www.melissadata.com , www.ip-adress.com
unit locate;
interface
uses
Winapi. Windows , Winapi. Messages , System. SysUtils , System. Variants ,
System. Classes , Vcl. Graphics ,
Vcl. Controls , Vcl. Forms , Vcl. Dialogs , Vcl. StdCtrls , Vcl. ComCtrls ,
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, PerlRegEx,
IdMultipartFormData, Vcl. Imaging . pngimage , Vcl. ExtCtrls ;
type
TForm1 = class ( TForm)
GroupBox1: TGroupBox;
Edit1: TEdit;
Button1: TButton;
GroupBox2: TGroupBox;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
StatusBar1: TStatusBar;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
IdHTTP1: TIdHTTP;
Image1: TImage;
GroupBox3: TGroupBox;
ListBox1: TListBox;
procedure Button1Click( Sender: TObject ) ;
private
{ Private declarations }
public
{ Public declarations }
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1. Button1Click ( Sender: TObject ) ;
var
regex: TPerlRegEx;
par: TIdMultiPartFormDataStream;
rta: string ;
z: integer ;
begin
regex : = TPerlRegEx. Create ( ) ;
par : = TIdMultiPartFormDataStream. Create ;
par. AddFormField ( 'DOMAINNAME' , Edit1. text ) ;
StatusBar1. Panels [ 0 ] . text : = '[+] Getting IP ...' ;
Form1. StatusBar1 . Update ;
rta : = IdHTTP1. Post ( 'http://whatismyipaddress.com/hostname-ip' , par) ;
regex. regex : = 'Lookup IP Address: <a href=(.*)>(.*)<\/a>' ;
regex. Subject : = rta;
if regex. Match then
begin
Edit1. text : = regex. Groups [ 2 ] ;
StatusBar1. Panels [ 0 ] . text : = '[+] Locating ...' ;
Form1. StatusBar1 . Update ;
rta : = IdHTTP1. Get
( 'http://www.melissadata.com/lookups/iplocation.asp?ipaddress=' +
Edit1. text ) ;
regex. regex : = 'City<\/td><td align=(.*)><b>(.*)<\/b><\/td>' ;
regex. Subject : = rta;
if regex. Match then
begin
Edit2. text : = regex. Groups [ 2 ] ;
end
else
begin
Edit2. text : = 'Not Found' ;
end ;
regex. regex : = 'Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>' ;
regex. Subject : = rta;
if regex. Match then
begin
Edit3. text : = regex. Groups [ 2 ] ;
end
else
begin
Edit3. text : = 'Not Found' ;
end ;
regex. regex : = 'State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>' ;
regex. Subject : = rta;
if regex. Match then
begin
Edit4. text : = regex. Groups [ 2 ] ;
end
else
begin
Edit4. text : = 'Not Found' ;
end ;
StatusBar1. Panels [ 0 ] . text : = '[+] Getting DNS ...' ;
Form1. StatusBar1 . Update ;
ListBox1. Items . Clear ;
rta : = IdHTTP1. Get ( 'http://www.ip-adress.com/reverse_ip/' + Edit1. text ) ;
regex. regex : = 'whois\/(.*?)\">Whois' ;
regex. Subject : = rta;
while regex. MatchAgain do
begin
for z : = 1 to regex. GroupCount do
ListBox1. Items . Add ( regex. Groups [ z] ) ;
end ;
end
else
begin
StatusBar1. Panels [ 0 ] . text : = '[-] Error' ;
Form1. StatusBar1 . Update ;
end ;
StatusBar1. Panels [ 0 ] . text : = '[+] Finished' ;
Form1. StatusBar1 . Update ;
regex. Free ;
end ;
end .
// The End ?
Si lo quieren bajar lo pueden hacer de
aca .
113
Programación / Scripting / [Perl] Radio X 0.4
en: 28 Marzo 2014, 16:29 pm
Actualice mi programa en perl llamado "Radio X" debido a que las emisoras no me gustaban , asi que actualice el hash con 31 estaciones , todas de diferentes generos , aunque la unica que siempre escucho siempre es la de musica clasica.
Aclaracion de dependencia :
Aclaro que necesitan bajar el mplayer , esta el link de descarga en el script , una vez que lo tengan descargado y descomprimido creen una carpeta llamada
"mplayer" y copian todos los archivos del archivo descomprimido en la carpeta recien creada , todo esto tiene que ser en el mismo directorio donde este el script.
El codigo :
#!usr/bin/perl
#Radio X
#Version 0.4
#(C) Doddy Hackman 2014
#
#Download : http://www.mplayerhq.hu/MPlayer/releases/win32/MPlayer-mingw32-1.0rc2.zip
#
use Cwd;
my @emisoras = (
{ } ,
{
"nombre" => "idobi Radio" ,
"genero" => "Alternative" ,
"link" => "http://69.46.88.21:80"
} ,
{
"nombre" => "BLUES RADIO (1.FM TM)" ,
"genero" => "Blues" ,
"link" => "http://205.164.35.58:80"
} ,
{
"nombre" => "Venice Classic Radio Italia" ,
"genero" => "Classical" ,
"link" => "http://174.36.206.197:8000"
} ,
{
"nombre" => "100hitz - New Country" ,
"genero" => "Country" ,
"link" => "http://69.4.234.186:9210"
} ,
{
"nombre" => "RADIO 7 - POLNOCNE" ,
"genero" => "Decades" ,
"link" => "http://94.23.36.107:443"
} ,
{
"nombre" => "COOLfahrenheit 93" ,
"genero" => "Easy Listening" ,
"link" => "http://203.150.225.77:8400"
} ,
{
"nombre" => "Ibiza Global Radio" ,
"genero" => "Electronic" ,
"link" => "http://198.50.197.161:8024"
} ,
{
"nombre" => "HBR1.com - I.D.M. Tranceponder" ,
"genero" => "Trance" ,
"link" => "http://ubuntu.hbr1.com:19800/trance.ogg"
} ,
{
"nombre" => "COOL radio - Beograd" ,
"genero" => "Folk" ,
"link" => "http://176.9.30.66:80"
} ,
{
"nombre" => "COOL radio - Beograd" ,
"genero" => "Folk" ,
"link" => "http://176.9.30.66:80"
} ,
{
"nombre" => "HPR4" ,
"genero" => "Inspirational" ,
"link" => "http://50.7.77.179:8024"
} ,
{
"nombre" => "Radio Carsija - Melli" ,
"genero" => "International" ,
"link" => "http://80.237.153.95:19406"
} ,
{
"nombre" => "TheJazzGroove.com" ,
"genero" => "Jazz" ,
"link" => "http://199.180.72.2:8015"
} ,
{
"nombre" => "Paisa Estereo" ,
"genero" => "Latin" ,
"link" => "http://199.217.118.10:7094"
} ,
{
"nombre" => "RockRadio1.Com" ,
"genero" => "Metal" ,
"link" => "http://77.74.192.50:8000"
} ,
{
"nombre" => "Adom 106.3FM" ,
"genero" => "Misc" ,
"link" => "http://67.159.60.45:8100"
} ,
{
"nombre" => "Healing" ,
"genero" => "New Age" ,
"link" => "http://222.122.178.183:11070"
} ,
{
"nombre" => "RADIO SOUND POP" ,
"genero" => "Pop" ,
"link" => "http://99.198.118.250:8076"
} ,
{
"nombre" => "Latido 90.1 FM" ,
"genero" => "Public Radio" ,
"link" => "http://64.251.21.48:42000"
} ,
{
"nombre" => "Radio Mandela" ,
"genero" => "Funk" ,
"link" => "http://184.154.150.93:9010"
} ,
{
"nombre" => "Boneyaad Radio" ,
"genero" => "Rap" ,
"link" => "http://69.175.103.226:8180"
} ,
{
"nombre" => "Reggae141.com" ,
"genero" => "Reggae" ,
"link" => "http://184.107.197.154:8002"
} ,
{
"nombre" => "Classic Rock 915" ,
"genero" => "Rock" ,
"link" => "http://117.53.175.113:15018"
} ,
{
"nombre" => "181.fm - Rock 181 (Active Rock)" ,
"genero" => "Rock" ,
"link" => "http://108.61.73.118:14008"
} ,
{
"nombre" => "181.FM - The Buzz" ,
"genero" => "Rock" ,
"link" => "http://108.61.73.119:14126"
} ,
{
"nombre" => "181.FM - Good Time Oldies" ,
"genero" => "Rock" ,
"link" => "http://108.61.73.118:14046"
} ,
{
"nombre" => "Top40" ,
"genero" => "Pop Dance R&B Rock" ,
"link" => "http://95.141.24.79:80"
} ,
{
"nombre" => "MUSIK.ORIENTAL" ,
"genero" => "Seasonal and Holiday" ,
"link" => "http://193.34.51.40:80"
} ,
{
"nombre" => "NOVA 100.3" ,
"genero" => "Soundtracks" ,
"link" => "http://117.53.175.113:15010"
} ,
{
"nombre" => "Alex Jones - Infowars.com" ,
"genero" => "Talk" ,
"link" => "http://50.7.130.109:80"
} ,
{
"nombre" => "illusive Radio Punta" ,
"genero" => "Themes" ,
"link" => "http://38.96.148.141:9996"
}
) ;
$SIG { INT} = \&retorno ;
chdir ( getcwd
( ) . "/mplayer/" ) ;
menu( ) ;
sub retorno {
print "\n \n [+] Press any key for return to the menu\n \n " ; <stdin> ;
clean( ) ;
menu( ) ;
}
sub menu {
head( ) ;
print "\n \n [+] Listing [" . int ( @emisoras - 1 ) . "] " . "stations found ...\n " ;
for my $em ( 1 .. @emisoras - 1 ) {
print "\n [+] ID : " . $em . "\n " ; print "[+] Name : " . $emisoras [ $em ] -> { nombre
} . "\n " ; print "[+] Type : " . $emisoras [ $em ] -> { genero
} . "\n " ;
#print "[$em] - ".$emisoras[$em]->{genero}."\n";
}
print "\n [+] Write exit to go out\n " ;
chomp ( my $op = <stdin> ) ;
if ( $op eq "exit" ) {
copyright( ) ;
}
if ( $op =~ /\d+/ ) {
print "\n [!] Listening : " . $emisoras [ $op ] -> { link } . " ...\n \n " ; system ( "mplayer $emisoras[$op]->{link}" ) ; }
copyright( ) ;
}
sub head {
clean( ) ;
@@@@@ @ @@@@ @ @@@@ @ @
@ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @
@@@@@ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @
@ @ @@@@@ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @@@@ @ @@@@ @ @
) ;
}
sub copyright {
print "\n \n -- == (C) Doddy Hackman 2014 == --\n \n " ; <stdin> ;
}
sub clean {
my $os = $^O ;
if ( $os =~ /Win32/ig ) {
}
else {
}
}
#The End ?
Un ejemplo de uso
@@@@@ @ @@@@ @ @@@@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@@@@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@@@@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @@@@ @ @@@@ @ @ [+] Listing [31] stations found ... [+] ID : 1 [+] Name : idobi Radio [+] Type : Alternative [+] ID : 2 [+] Name : BLUES RADIO (1.FM TM) [+] Type : Blues [+] ID : 3 [+] Name : Venice Classic Radio Italia [+] Type : Classical [+] ID : 4 [+] Name : 100hitz - New Country [+] Type : Country [+] ID : 5 [+] Name : RADIO 7 - POLNOCNE [+] Type : Decades [+] ID : 6 [+] Name : COOLfahrenheit 93 [+] Type : Easy Listening [+] ID : 7 [+] Name : Ibiza Global Radio [+] Type : Electronic [+] ID : 8 [+] Name : HBR1.com - I.D.M. Tranceponder [+] Type : Trance [+] ID : 9 [+] Name : COOL radio - Beograd [+] Type : Folk [+] ID : 10 [+] Name : COOL radio - Beograd [+] Type : Folk [+] ID : 11 [+] Name : HPR4 [+] Type : Inspirational [+] ID : 12 [+] Name : Radio Carsija - Melli [+] Type : International [+] ID : 13 [+] Name : TheJazzGroove.com [+] Type : Jazz [+] ID : 14 [+] Name : Paisa Estereo [+] Type : Latin [+] ID : 15 [+] Name : RockRadio1.Com [+] Type : Metal [+] ID : 16 [+] Name : Adom 106.3FM [+] Type : Misc [+] ID : 17 [+] Name : Healing [+] Type : New Age [+] ID : 18 [+] Name : RADIO SOUND POP [+] Type : Pop [+] ID : 19 [+] Name : Latido 90.1 FM [+] Type : Public Radio [+] ID : 20 [+] Name : Radio Mandela [+] Type : Funk [+] ID : 21 [+] Name : Boneyaad Radio [+] Type : Rap [+] ID : 22 [+] Name : Reggae141.com [+] Type : Reggae [+] ID : 23 [+] Name : Classic Rock 915 [+] Type : Rock [+] ID : 24 [+] Name : 181.fm - Rock 181 (Active Rock) [+] Type : Rock [+] ID : 25 [+] Name : 181.FM - The Buzz [+] Type : Rock [+] ID : 26 [+] Name : 181.FM - Good Time Oldies [+] Type : Rock [+] ID : 27 [+] Name : Top40 [+] Type : Pop Dance R&B Rock [+] ID : 28 [+] Name : MUSIK.ORIENTAL [+] Type : Seasonal and Holiday [+] ID : 29 [+] Name : NOVA 100.3 [+] Type : Soundtracks [+] ID : 30 [+] Name : Alex Jones - Infowars.com [+] Type : Talk [+] ID : 31 [+] Name : illusive Radio Punta [+] Type : Themes [+] Write exit to go out [+] Option : 3 [!] Listening : http://174.36.206.197:8000 ... MPlayer 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team CPU: AMD Sempron(tm) 140 Processor (Family: 16, Model: 6, Stepping: 2) CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1 Compiled with runtime CPU detection. Playing http://174.36.206.197:8000. Connecting to server 174.36.206.197[174.36.206.197]: 8000... Name : Venice Classic Radio Italia Genre : Classical Website: http://www.veniceclassicradio.eu/ Public : yes Bitrate: 128kbit/s Cache size set to 320 KBytes Cache fill: 0.00% (0 bytes) No bind found for key ''. Cache fill: 7.50% (24576 bytes) ICY Info: StreamTitle='Frederic Chopin (1810-1849) - 'Allegro de concert' per pi anoforte in la Maggiore Op.46 (11:37) {+info: veniceclassicradio.eu}';StreamUrl =''; Cache fill: 17.50% (57344 bytes) Audio file file format detected. ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 mpg123: Can't rewind stream by 154 bits! AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400) Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== AO: [dsound] 44100Hz 2ch s16le (2 bytes per sample) Video: no video Starting playback... ICY Info: StreamTitle='Mauro Giuliani (1781-1829) - Variazioni su 'Deh! Calma, o h ciel!' per chitarra e quartetto (08:00) {+info: veniceclassicradio.eu}';Strea mUrl=''; ICY Info: StreamTitle='Johann Sebastian Bach (1685-1750) - 'Il clavicembalo ben temperato' - Libro I - Praeludium et Fuga in si bemolle Maggiore BWV866 (02:42) {+info: veniceclassicradio.eu}';StreamUrl=''; ICY Info: StreamTitle='Antonio Palella (1692-1761) - Concerto a 4 in sol Maggio re (12:42) {+info: veniceclassicradio.eu}';StreamUrl=''; ICY Info: StreamTitle='Anton Reicha (1770-1836) - Sonata per fagotto e pianofort e (16:19) {+info: veniceclassicradio.eu}';StreamUrl=''; ICY Info: StreamTitle='Gioachino Rossini (1792-1868) - Sonata per archi in mi be molle Maggiore No.5 (14:51) {+info: veniceclassicradio.eu}';StreamUrl=''; ICY Info: StreamTitle='Fernand De La Tombelle (1854-1928) - Andante espressivo p er violoncello e pianoforte (04:39) {+info: veniceclassicradio.eu}';StreamUrl=' '; ICY Info: StreamTitle='Franz Schubert (1797-1828) - Sinfonia in re Maggiore No.3 D200 (23:09) {+info: veniceclassicradio.eu}';StreamUrl='';Eso es todo.
115
Programación / Java / [Java] BingHackTool 1.0
en: 14 Marzo 2014, 16:17 pm
Un simple programa en Java para buscar paginas vulnerables a SQLI usando Bing.
Una imagen :
Si lo quieren bajar lo pueden hacer de
aca .
117
Programación / Programación General / [Delphi] DH Player 0.5
en: 28 Febrero 2014, 16:35 pm
Un reproductor de musica , en esta version le agregue un buscador usando mp3skull para buscar y descargar canciones , para despues guardarlas en una carpeta llamada "downloads" y escucharlas cuando quieran.
Una imagen :
El codigo :
// DH Player 0.5
// Coded By Doddy H
// Based on this article : http://delphi.about.com/od/multimedia/l/aa112800a.htm
unit mp3player;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls, sListBox, sSkinManager, MPlayer, sGroupBox, jpeg,
ExtCtrls, ComCtrls, acProgressBar, Buttons, FileCtrl, sEdit, sPageControl,
sStatusBar, sButton, PerlRegEx, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, sListView, acPNG, sLabel;
type
TForm1 = class ( TForm)
sSkinManager1: TsSkinManager;
Image1: TImage;
PopupMenu1: TPopupMenu;
L1: TMenuItem;
R1: TMenuItem;
A1: TMenuItem;
E1: TMenuItem;
Timer1: TTimer;
sPageControl1: TsPageControl;
sTabSheet1: TsTabSheet;
sGroupBox4: TsGroupBox;
MediaPlayer1: TMediaPlayer;
sGroupBox2: TsGroupBox;
sEdit1: TsEdit;
sGroupBox5: TsGroupBox;
sListBox1: TsListBox;
sGroupBox1: TsGroupBox;
sProgressBar1: TsProgressBar;
sTabSheet2: TsTabSheet;
sStatusBar1: TsStatusBar;
sGroupBox3: TsGroupBox;
sEdit2: TsEdit;
sListBox2: TsListBox;
sListBox3: TsListBox;
sListBox4: TsListBox;
sButton1: TsButton;
IdHTTP1: TIdHTTP;
PerlRegEx1: TPerlRegEx;
sGroupBox6: TsGroupBox;
sListView1: TsListView;
sTabSheet3: TsTabSheet;
sGroupBox7: TsGroupBox;
MediaPlayer2: TMediaPlayer;
sGroupBox8: TsGroupBox;
sListBox5: TsListBox;
sGroupBox9: TsGroupBox;
sGroupBox10: TsGroupBox;
sProgressBar2: TsProgressBar;
sProgressBar3: TsProgressBar;
Timer2: TTimer;
IdHTTP2: TIdHTTP;
sTabSheet4: TsTabSheet;
sGroupBox11: TsGroupBox;
Image2: TImage;
sLabel1: TsLabel; procedure A1Click( Sender: TObject ) ;
procedure E1Click( Sender: TObject ) ;
procedure R1Click( Sender: TObject ) ;
procedure L1Click( Sender: TObject ) ;
procedure Timer1Timer( Sender: TObject ) ;
procedure sListBox1DblClick( Sender: TObject ) ;
procedure FormCreate( Sender: TObject ) ;
procedure sButton1Click( Sender: TObject ) ;
procedure sListView1DblClick( Sender: TObject ) ;
procedure sListBox5DblClick( Sender: TObject ) ;
procedure Timer2Timer( Sender: TObject ) ;
procedure IdHTTP2Work( ASender: TObject ; AWorkMode: TWorkMode;
AWorkCount: Int64 ) ;
procedure IdHTTP2WorkBegin( ASender: TObject ; AWorkMode: TWorkMode;
AWorkCountMax: Int64 ) ;
procedure IdHTTP2WorkEnd( ASender: TObject ; AWorkMode: TWorkMode) ;
private
{ Private declarations }
public
{ Public declarations }
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
// Functions
function getfilename( archivo: string ) : string ;
var
test: TStrings;
begin
test : = TStringList. Create ;
test. Delimiter : = '/' ;
test. DelimitedText : = archivo;
Result : = test[ test. Count - 1 ] ;
test. Free ;
end ;
//
procedure TForm1. A1Click ( Sender: TObject ) ;
begin
ShowMessage( 'Contact to lepuke[at]hotmail[com]' ) ;
end ;
procedure TForm1. E1Click ( Sender: TObject ) ;
begin
Form1. Close ( ) ;
end ;
procedure TForm1. FormCreate ( Sender: TObject ) ;
var
dir: string ;
search: TSearchRec;
cantidad: Integer ;
begin
sProgressBar1. Max : = 0 ;
sProgressBar2. Max : = 0 ;
sProgressBar3. Max : = 0 ;
sSkinManager1. SkinDirectory : = ExtractFilePath ( Application. ExeName ) + 'Data' ;
sSkinManager1. SkinName : = 'fm' ;
sSkinManager1. Active : = True ;
begin
dir : = ExtractFilePath ( Application. ExeName ) + '/downloads' ;
if not ( DirectoryExists ( dir) ) then
begin
CreateDir ( dir) ;
end ;
ChDir ( dir) ;
sListBox5. Clear ;
cantidad : = FindFirst ( ExtractFilePath ( Application. ExeName )
+ '/downloads/' + '*.mp3' , faAnyFile, search) ;
while cantidad = 0 do
begin
if FileExists ( dir + '/' + search. name ) then
begin
sListBox5. Items . Add ( search. name ) ;
end ;
cantidad : = FindNext ( search) ;
end ;
FindClose ( search) ;
end ;
end ;
procedure TForm1. IdHTTP2Work ( ASender: TObject ; AWorkMode: TWorkMode;
AWorkCount: Int64 ) ;
begin
sProgressBar2. Position : = AWorkCount;
sStatusBar1. Panels [ 0 ] . Text : = '[+] Downloading ...' ;
Form1. sStatusBar1 . Update ;
end ;
procedure TForm1. IdHTTP2WorkBegin ( ASender: TObject ; AWorkMode: TWorkMode;
AWorkCountMax: Int64 ) ;
begin
sProgressBar2. Max : = AWorkCountMax;
sStatusBar1. Panels [ 0 ] . Text : = '[+] Starting download ...' ;
Form1. sStatusBar1 . Update ;
end ;
procedure TForm1. IdHTTP2WorkEnd ( ASender: TObject ; AWorkMode: TWorkMode) ;
var
dir: string ;
search: TSearchRec;
cantidad: Integer ;
begin
sProgressBar2. Position : = 0 ;
sListBox5. Clear ;
dir : = ExtractFilePath ( Application. ExeName ) + '/downloads' ;
cantidad : = FindFirst ( ExtractFilePath ( Application. ExeName )
+ '/downloads/' + '*.mp3' , faAnyFile, search) ;
while cantidad = 0 do
begin
if FileExists ( dir + '/' + search. name ) then
begin
sListBox5. Items . Add ( search. name ) ;
end ;
cantidad : = FindNext ( search) ;
end ;
FindClose ( search) ;
end ;
procedure TForm1. L1Click ( Sender: TObject ) ;
var
dir: string ;
search: TSearchRec;
cantidad: Integer ;
begin
SelectDirectory( 'Select a folder' , '' , dir) ;
sListBox1. Clear ;
sEdit1. Text : = dir;
cantidad : = FindFirst ( dir + '/' + '*.mp3' , faAnyFile, search) ;
while cantidad = 0 do
begin
if FileExists ( dir + '/' + search. name ) then
begin
sListBox1. Items . Add ( search. name ) ;
end ;
cantidad : = FindNext ( search) ;
end ;
FindClose ( search) ;
end ;
procedure TForm1. R1Click ( Sender: TObject ) ;
begin
sEdit1. Text : = '' ;
sProgressBar1. Max : = 0 ;
sListBox1. Clear ;
end ;
procedure TForm1. sButton1Click ( Sender: TObject ) ;
var
cancion: string ;
code: string ;
nombre: string ;
datos: string ;
link: string ;
i: Integer ;
begin
sListBox2. Clear ;
sListBox3. Clear ;
sListBox4. Clear ;
sListView1. Clear ;
cancion : = sEdit2. Text ;
cancion : = StringReplace ( cancion, ' ' , '-' , [ rfReplaceAll, rfIgnoreCase] ) ;
sStatusBar1. Panels [ 0 ] . Text : = '[+] Searching ... ' ;
sStatusBar1. Update ;
code : = IdHTTP1. Get ( 'http://mp3skull.com/mp3/' + cancion + '.html' ) ;
PerlRegEx1. Regex : = '<div style="font-size:15px;"><b>(.*)<\/b><\/div>' ;
PerlRegEx1. Subject : = code;
while PerlRegEx1. MatchAgain do
// if PerlRegEx1.Match then
begin
nombre : = PerlRegEx1. SubExpressions [ 1 ] ;
sListBox2. Items . Add ( nombre) ;
end ;
PerlRegEx1. Regex : = '<!-- info mp3 here -->\s+(.*?)<\/div>' ;
PerlRegEx1. Subject : = code;
while PerlRegEx1. MatchAgain do
// if PerlRegEx1.Match then
begin
datos : = PerlRegEx1. SubExpressions [ 1 ] ;
datos : = StringReplace ( datos, '<br \/>' , ' ' , [ rfReplaceAll, rfIgnoreCase] ) ;
datos : = StringReplace ( datos, '<br />' , ' ' , [ rfReplaceAll, rfIgnoreCase] ) ;
sListBox3. Items . Add ( datos) ;
end ;
PerlRegEx1. Regex : = '<a href=\"(.*)\.mp3\"' ;
PerlRegEx1. Subject : = code;
while PerlRegEx1. MatchAgain do
// if PerlRegEx1.Match then
begin
link : = PerlRegEx1. SubExpressions [ 1 ] + '.mp3' ;
sListBox4. Items . Add ( link) ;
end ;
for i : = 0 to sListBox2. Count - 1 do
begin
// ShowMessage(IntToStr(i));
with sListView1. Items . Add do
begin
Caption : = sListBox2. Items [ i] ;
SubItems. Add ( sListBox3. Items [ i] ) ;
end ;
end ;
sStatusBar1. Panels [ 0 ] . Text : = '[+] Finished ' ;
sStatusBar1. Update ;
end ;
procedure TForm1. sListBox1DblClick ( Sender: TObject ) ;
begin
sProgressBar1. Max : = 0 ;
MediaPlayer1. Close ;
MediaPlayer1. FileName : = sEdit1. Text + '/' + sListBox1. Items . Strings
[ sListBox1. ItemIndex ] ;
MediaPlayer1. Open ;
sProgressBar1. Max : = MediaPlayer1. Length ;
end ;
procedure TForm1. sListBox5DblClick ( Sender: TObject ) ;
begin
MediaPlayer2. Close ;
MediaPlayer2. FileName : = ExtractFilePath ( Application. ExeName )
+ '/downloads' + '/' + sListBox5. Items . Strings [ sListBox5. ItemIndex ] ;
MediaPlayer2. Open ;
sProgressBar3. Max : = MediaPlayer2. Length ;
end ;
procedure TForm1. sListView1DblClick ( Sender: TObject ) ;
var
FileName: string ;
nombrefinal: string ;
archivobajado: TFileStream;
url: string ;
begin
url : = sListBox4. Items [ sListView1. Selected . Index ] ;
nombrefinal : = getfilename( url) ;
archivobajado : = TFileStream. Create ( ExtractFilePath ( Application. ExeName )
+ '/downloads' + '/' + nombrefinal, fmCreate) ;
try
begin
DeleteFile ( nombrefinal) ;
IdHTTP2. Get ( url, archivobajado) ;
sStatusBar1. Panels [ 0 ] . Text : = '[+] File Dowloaded' ;
Form1. sStatusBar1 . Update ;
archivobajado. Free ;
end ;
except
sStatusBar1. Panels [ 0 ] . Text : = '[-] Failed download' ;
Form1. sStatusBar1 . Update ;
archivobajado. Free ;
Abort ;
end ;
end ;
procedure TForm1. Timer1Timer ( Sender: TObject ) ;
begin
if sProgressBar1. Max <> 0 then
begin
sProgressBar1. Position : = MediaPlayer1. Position ;
end ;
end ;
procedure TForm1. Timer2Timer ( Sender: TObject ) ;
begin
if sProgressBar3. Max <> 0 then
begin
sProgressBar3. Position : = MediaPlayer2. Position ;
end ;
end ;
end .
// The End ?
Si lo quieren bajar lo pueden hacer de
aca .
118
Programación / Java / Generar Jar con librerias incluidas
en: 26 Febrero 2014, 21:57 pm
Bueno , hice este videotutorial porque queria tener un solo archivo jar en vez de tener las clasicas dependencias en la carpeta lib , este problema lo resolvi gracias a este
link .
El video :
VIDEO El manual en si :
Para empezar tenemos que modificar el archivo build.xml del programa al que quieren hacerle esto , en mi caso voy a buscar en el directorio de mi proyecto llamado "locateip_grafico" que es un programa que hice hace poco , la ruta en mi caso es esta : C:\Documents and Settings\Doddy\Mis documentos\NetBeansProjects\locateip_grafico
Una vez encontrado el archivo build.xml lo abrimos y le agregamos esto despues de las tres primeras lineas de texto , con texto me refiero a despues de los comentarios que estan con "<!--" , el codigo a agregar es este :
<target name="-post-jar"> <jar jarfile="dist/finished.jar"> <zipfileset src="${dist.jar}" excludes="META-INF/*" /> <zipfileset src="dist/lib/appframework-1.0.3.jar" excludes="META-INF/*" /> <zipfileset src="dist/lib/swing-worker-1.1.jar" excludes="META-INF/*" /> <manifest> <attribute name="Main-Class" value="locateip_grafico.Locateip_graficoApp"/> </manifest> </jar> </target> En la parte de "jar jarfile=" deben agregar el nombre que tendra el archivo unico con extension jar , algo a tener en cuenta es que el nombre que usen debe ser diferente al programa en si porque si no va haber errores.
Las librerias que usan deben estar como en las siguientes lineas :
<zipfileset src="dist/lib/appframework-1.0.3.jar" excludes="META-INF/*" /> <zipfileset src="dist/lib/swing-worker-1.1.jar" excludes="META-INF/*" /> Como ven en mi caso uso las librerias "appframework-1.0.3.jar" y "swing-worker-1.1.jar"
Lo ultimo y mas importante es modificar la siguiente linea "<attribute name=Main-Class" con el nombre que tienen como Main-Class , en el proyecto para saber cual es solo tienen que ir las propiedades del proyecto en NetBeans y ver en la parte de "Run".
Una vez modicado el archivo solo tenemos que volver a compilar el proyecto en NetBeans y contemplar el jar solo xD.
Eso seria todo.
119
Programación / Java / Como convertir un jar a exe usando IExpress
en: 25 Febrero 2014, 21:57 pm
Hoy les traigo un video de como convertir un archivo jar a exe usando IExpress.
El video :
VIDEO El manual en si :
-> Execute "iexpress" -> Create new Self Extraction Directive file -> Extract files and run an installation command -> Package title : Your title -> No prompt -> Do not display a license -> Packaged files : Java Files -> Install Program to Launch -> Install program -> java -jar <file> -> Show window -> Hidden -> Finished Message -> No message -> Package Name and Options -> Enter exe name -> Select "Hide File Extracting Progress Animation from User" -> Configure restart -> No restart -> Save Self Extraction Directive -> Dont save -> Finished
120
Programación / Programación General / [Delphi] PirateBay Manager 0.8
en: 14 Febrero 2014, 19:10 pm
Un simple programa en Delphi para buscar torrents en PirateBay.
Una imagen :
El codigo :
// PirateBay Manager 0.8
// (C) Doddy Hackman 2014
unit pirate;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, PerlRegEx, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, ComCtrls, sListView, sGroupBox, sListBox, ShellApi,
sSkinManager, acPNG, ExtCtrls, sStatusBar, sEdit, sButton;
type
TForm1 = class ( TForm)
IdHTTP1: TIdHTTP;
PerlRegEx1: TPerlRegEx;
sGroupBox1: TsGroupBox;
sListView1: TsListView;
sListBox1: TsListBox;
sListBox2: TsListBox;
sListBox3: TsListBox;
PerlRegEx2: TPerlRegEx;
sSkinManager1: TsSkinManager;
Image1: TImage;
sGroupBox2: TsGroupBox;
sEdit1: TsEdit;
sStatusBar1: TsStatusBar;
sButton1: TsButton;
procedure sListView1DblClick( Sender: TObject ) ;
procedure sButton1Click( Sender: TObject ) ;
procedure FormCreate( Sender: TObject ) ;
private
{ Private declarations }
public
{ Public declarations }
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1. FormCreate ( Sender: TObject ) ;
begin
sSkinManager1. SkinDirectory : = ExtractFilePath ( Application. ExeName ) + 'Data' ;
sSkinManager1. SkinName : = 'tv-b' ;
sSkinManager1. Active : = True ;
end ;
procedure TForm1. sButton1Click ( Sender: TObject ) ;
var
busqueda: string ;
code: string ;
nombre: string ;
link_torrent: string ;
limpiando_data: string ;
data: string ;
seeders: string ;
leechers: string ;
i: integer ;
begin
sListBox1. Clear ;
sListBox2. Clear ;
sListBox3. Clear ;
sListView1. Clear ;
busqueda : = sEdit1. Text ;
busqueda : = StringReplace ( busqueda, ' ' , '%20' , [ rfReplaceAll, rfIgnoreCase] ) ;
sStatusBar1. Panels [ 0 ] . Text : = '[+] Searching ...' ;
sStatusBar1. Update ;
code : = IdHTTP1. Get ( 'http://thepiratebay.se/search/' + busqueda + '/0/99/0' ) ;
sStatusBar1. Panels [ 0 ] . Text : = '[+] Finished' ;
sStatusBar1. Update ;
PerlRegEx1. Regex : =
'(.*?)class="detLink" title="Details for (.*?)">(.*?)<a href="magnet(.*?)" title="Download this torrent using magnet"(.*?)<font class="detDesc">(.*?)<\/font>(.*?)<td align="right">(.*?)<\/td>(.*?)<td align="right">(.*?)<\/td>(.*?)' ;
PerlRegEx1. Subject : = code;
while PerlRegEx1. MatchAgain do
// if PerlRegEx1.Match then
begin
nombre : = PerlRegEx1. SubExpressions [ 2 ] ;
link_torrent : = 'magnet' + PerlRegEx1. SubExpressions [ 4 ] ;
limpiando_data : = PerlRegEx1. SubExpressions [ 6 ] ;
seeders : = PerlRegEx1. SubExpressions [ 8 ] ;
leechers : = PerlRegEx1. SubExpressions [ 10 ] ;
PerlRegEx2. Regex : = '(.*), ULed by <' ;
PerlRegEx2. Subject : = limpiando_data;
if PerlRegEx2. Match then
begin
limpiando_data : = PerlRegEx2. SubExpressions [ 1 ] ;
data : = StringReplace ( limpiando_data, ' ' , '' , [ rfReplaceAll,
rfIgnoreCase] ) ;
data : = data + ', Seeders ' + seeders + ', Leechers ' + leechers;
end ;
sListBox1. Items . Add ( nombre) ;
sListBox2. Items . Add ( data) ;
sListBox3. Items . Add ( link_torrent) ;
end ;
for i : = 0 to sListBox1. Count - 1 do
begin
// ShowMessage(IntToStr(i));
with sListView1. Items . Add do
begin
Caption : = sListBox1. Items [ i] ;
SubItems. Add ( sListBox2. Items [ i] ) ;
end ;
end ;
end ;
procedure TForm1. sListView1DblClick ( Sender: TObject ) ;
begin
// ShowMessage(sListBox3.Items[sListView1.Selected.Index]);
ShellExecute( 0 , nil , PChar ( sListBox3. Items [ sListView1. Selected . Index ] ) , nil ,
nil , SW_SHOWNORMAL) ;
end ;
end .
// The End ?
Si lo quieren bajar lo pueden hacer de
aca .