Results 1 to 6 of 6
  1. #1
    ntoskrnl's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    3

    Blackshot Launcher[Includes Source]

    Little project I made while I was bored. This is for European Blackshot, not Garena. Enjoy.

    How to use
    Edit the configuration file with the correct information, making sure path points to the directory in which blackshot.exe resides.

    Code:
    //Custom Blackshot Online Game Launcher made by ntoskrnl. 3/6/11
    
    #include <windows.h>
    #include <winsock.h>
    #pragma comment(lib, "ws2_32")
    #include <stdio.h>
    
    struct AuthInfo
    {
    	unsigned int num;
    	wchar_t auth[12];
    };
    
    bool GetAuth(AuthInfo* ai, wchar_t* username, wchar_t* password)
    {
    	WSAData wsa;
    	SOCKET s;
    	sockaddr_in addr;
    	char buf[256];
    	int len;
    	int index;
    	
    	if(WSAStartup(MAKEWORD(2,2), &wsa) != 0)
    	{
    		return 0;
    	}
    
    	s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    
    	if(s == INVALID_SOCKET)
    	{
    		WSACleanup();
    		return 0;
    	}
    
    	addr.sin_addr.S_un.S_addr = inet_addr("217.113.36.25");
    	addr.sin_port = htons(12110);
    	addr.sin_family = AF_INET;
    
    	if(connect(s, (sockaddr*)&addr, sizeof(addr)) != 0)
    	{
    		closesocket(s);
    		WSACleanup();
    		return 0;
    	}
    
    	memcpy(buf, "\x64\x00", 2);
    	len = wcslen(username);
    	memcpy(buf+2, &len, 4);
    	len *= 2;
    	memcpy(buf+6, username, len);
    	index = 6 + len;
    	len = wcslen(password);
    	memcpy(buf+index, &len, 4);
    	len *= 2;
    	memcpy(buf+index+4, password, len);
    	index += len + 4;
    	memcpy(buf+index, "\x01\x00\x00\x00", 4);
    	index += 4;
    
    	if(!send(s, "\x2c\x00\x00\x00", 4, 0))
    	{
    		closesocket(s);
    		WSACleanup();
    		return 0;
    	}
    
    	if(!send(s, buf, index, 0))
    	{
    		closesocket(s);
    		WSACleanup();
    		return 0;
    	}
    
    	if(!recv(s, buf, 256, 0))
    	{
    		closesocket(s);
    		WSACleanup();
    		return 0;
    	}
    	memset(ai->auth, 0, 12*2);
    	memcpy(&ai->num, buf+8, 4);
    	memcpy(&len, buf+12, 4);
    	memcpy(ai->auth, buf+16, len*2);
    
    	closesocket(s);
    	WSACleanup();
    	return 1;
    }
    
    int main()
    {
    	AuthInfo ai;
    	wchar_t args[256], dir[256], path[256], username[18], password[18];
    
    	GetCurrentDirectoryW(256, dir);
    	wcscat_s(dir, 256, L"\\BlackshotGameLauncher.ini");
    	GetPrivateProfileStringW(L"info", L"username", NULL, username, 18, dir);
    	GetPrivateProfileStringW(L"info", L"password", NULL, password, 18, dir);
    	GetPrivateProfileStringW(L"info", L"path", L"C:\\Program Files\\BlackShot\\BlackShot\\system", path, 256, dir);
    
    	if(GetAuth(&ai, username, password) == 0)
    	{
    		printf("Error Retrieving Authentication Info\n");
    		return 2;
    	}
    
    	memset(args, 0, 512);
    	swprintf(args, 512, L"\"%ls\\blackshot.exe\" -id %ls -num %u -auth %ls -server 217.113.38.166 -Nation 1 -Language 0", path, username, ai.num, ai.auth);
    
    	STARTUPINFO si;
    	PROCESS_INFORMATION pi;
    	memset(&pi, 0, sizeof(pi));
    	memset(&si, 0, sizeof(si));
    
    	if(CreateProcess(NULL, args, NULL, NULL, FALSE, 0, NULL, path, &si, &pi) == 0)
    	{
    		printf("Error Creating Process: %d\n", GetLastError());
    		return 1;
    	}
    	CloseHandle(pi.hProcess);
    	CloseHandle(pi.hThread);
    	return 0;
    }
    Last edited by ntoskrnl; 03-06-2011 at 06:59 PM.

  2. The Following 2 Users Say Thank You to ntoskrnl For This Useful Post:

    garena_11 (06-02-2011),kio84 (08-09-2012)

  3. #2
    gunman353's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    In_Your_Computer!!
    Posts
    719
    Reputation
    27
    Thanks
    125
    My Mood
    Lurking
    From what i am seeing it doesn't look like there is much of a point o.o Please explain your purpose. Also, always include a virus scan

  4. #3
    ntoskrnl's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    3
    Quote Originally Posted by gunman353 View Post
    From what i am seeing it doesn't look like there is much of a point o.o Please explain your purpose. Also, always include a virus scan
    The 'point' is to easily launch the game without needing to use the official launcher, skipping any updates, and having to type in your username and password every single run. The source and project are both included in the attachment, there is no need for a virus scan.

  5. #4
    Margherita's Avatar
    Join Date
    Jan 2011
    Gender
    female
    Posts
    11,299
    Reputation
    783
    Thanks
    1,287
    My Mood
    Bashful
    Who approved this.

    This looks pretty good though
    PM Me | VM Me | Rules

    MARGHERITA

  6. #5
    gunman353's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    In_Your_Computer!!
    Posts
    719
    Reputation
    27
    Thanks
    125
    My Mood
    Lurking
    Quote Originally Posted by ntoskrnl View Post
    The 'point' is to easily launch the game without needing to use the official launcher, skipping any updates, and having to type in your username and password every single run. The source and project are both included in the attachment, there is no need for a virus scan.
    Without updates the game will most likely crash. Just an FYI

  7. #6
    mushdoomx's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    123 CUNTMUFFIN drive
    Posts
    222
    Reputation
    2
    Thanks
    11
    My Mood
    Dead
    pretty cool if i still plays blackshot i would download