Jump to content
Gonzalez

[C] Azureus Seeder

Recommended Posts

Posted
/*
Azureus Seeder
Coded by a59
*/
#include <windows.h>
#include <stdio.h>
#include <urlmon.h>
#pragma comment( lib, "Urlmon.lib" )

int SeedAzureus( char* szLink, char* szSaveAs )
{
int i;
HWND hAzureus = FindWindow( 0, "Azureus" );
HWND hPopup, hExists;

if( hAzureus == NULL )
return 1;

if( URLDownloadToFile( 0, szLink, szSaveAs, 0, 0 ) != S_OK )
return 2;

if( (int)ShellExecute( 0, "open", szSaveAs, 0, 0, SW_NORMAL ) <= 32 )
return 3;

for( i = 0; i < 10; i++ )
{
hExists = FindWindow( 0, "Already exists" );

if( hExists != NULL )
{
ShowWindow( hExists, SW_HIDE );
return 4;
}

Sleep( 100 );
}

for( i = 0; i < 10; i++ )
{
hPopup = FindWindow( 0, "Information" );

if( hPopup != NULL )
break;

Sleep( 100 );
}

if( hPopup == NULL )
return 5;

ShowWindow( hPopup, SW_HIDE );

return 0;
};

int main( )
{
switch( SeedAzureus( "http://www.rofl.com/lol.torrent", "c:\\lol.torrent" ) )
{
case 1:
printf( "Unable to locate Azureus\n" );
break;
case 2:
printf( "Unable to download file\n" );
break;
case 3:
printf( "Unale to open file\n" );
break;
case 4:
printf( "Already seeded!\n" );
break;
case 5:
printf( "Unable to locate popup window\n" );
break;
case 0:
printf( "Seeded!\n" );
break;
}

return 0;
};

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...