Introduction Due to recent attempts to crack programs and just the need for a new authorization, I have created a .dll file that can referenced and used for authorization within the .NET framework. This guide will show you all the functions for the new authorization, for both novice and advanced programmers. Table of Contents I. The Functions of the Authorization II. Using in Visual Studio III. Example Usage (VB.NET) IV. Example Usage (C#) V. Download (For Programmers) For the old authorization, please check here: post182797.html#p182797
The Functions of the Authorization The Functions of the Authorization Delegates (Delegate) dUpdateAvailable() (Delegate) dUnAuthorized() (Delegate) dExceptionHandle(Exception ex) (Delegate) dAuthorized() (Delegate) dAuthorizedWithStats(Dictionary<string, string> stats) [fitbox=145]Dictionary<string, int> stats keys: (String) Username: User's username. (String) Posts: User's post count. (String) Reputation: User's reputation points. (String) Cash: User's Forum Cash. (String) Last Visit: User's last visit. (String) Rank: User's rank. (String) Group: User's default group.[/fitbox] (Delegate) dInactive(Dictionary<string, int> info) [fitbox=100]Dictionary<string, int> info keys: Posts Required: The minimum amount of posts by the user to use the program. Days: The span of days to check for user activity. If set to 0, authorization will check total post count. Posts: The amount of posts the user currently has. Posts Left: The amount of posts left that the user must make to be authorized. [/fitbox] Constructor [Optional] (String) strUsername: The username to set the Neofriends.net authorization to. [Optional] (String) strPassword: The password corresponding to the username to authorize. [Optional] (String) strProgramID: The identification number (ID) of the program to authorize. [Optional] (String) strProgramName: The name of the program to authorize. Must be exact match to name in downloads section. [Optional] (Control) InvokeControl: The control to invoke when calling a Sub. [Optional] (Integer) iTimeout: The maximum time (in milliseconds) to wait for an authorization response. [Optional] (Integer) iActivityPosts: The minimum posts by the user to use the program. [Optional] (Integer) iActivityDays: The span of days to check for user activity. If set to 0, authorization will check total post count. [Optional] (Boolean) bShowMsgBox: The option whether to show message boxes. [Optional] (Boolean) bGetStats: The option whether to get statistics after a successful authorization. [Optional] (dUpdateAvailable) UpdateSub: The function to invoke if authorization finds an update available. [Optional] (dAuthorized) AuthorizedSub: The function to invoke if the authorization finds the user authorized without retrieving statistics. [Optional] (dAuthorizedWithStats) AuthorizedWithStatsSub: The function to invoke if the authorization finds the user authorized after retrieving statistics. [Optional] (dUnAuthorized) UnAuthorizedSub: The function to invoke if authorized finds the user unauthorized. [Optional] (dExceptionHandle) ExceptionSub: The function to invoke if an exception is thrown during authorization. [Optional] (dInactive) InactiveSub: The function to invoke if the authorization finds the user inactive. [Optional] (Label) lblStatus: The label to update with the latest authorization status. [Optional] (ToolStripLabel) tsStatus: The ToolStripLabel to update with the latest authorization status. [Optional] (NotifyIcon) ni: The NotifyIcon to show balloons with the latest authorization status. Properties (String) Username: The username to set the Neofriends.net authorization to. (String) Password: The password corresponding to the username to authorize. (String) ProgramID: The identification number (ID) of the program to authorize. (String) ProgramName: The name of the program to authorize. Must be exact match to name in downloads section. (Control) InvokeControl: The control to invoke when calling a Sub. (Integer) Timeout: The maximum time (in milliseconds) to wait for an authorization response. (Integer) ActivityPosts: The minimum posts by the user to use the program. (Integer) ActivityDays: The span of days to check for user activity. If set to 0, authorization will check total post count. (Label) StatusLabel: The label to update with the latest authorization status. (ToolStripLabel) TSStatusLabel: The ToolStripLabel to update with the latest authorization status. (NotifyIcon) TrayIcon: The NotifyIcon to show balloons with the latest authorization status. (dUpdateAvailable) UpdateSub: The function to invoke if authorization finds an update available. (dAuthorized) AuthorizedSubNoStats: The function to invoke if the authorization finds the user authorized without retrieving statistics. (dAuthorizedWithStats) AuthorizedSub: The function to invoke if the authorization finds the user authorized after retrieving statistics. (dUnAuthorized) UnAuthorizedSub: The function to invoke if authorized finds the user unauthorized. (dExceptionHandle) ExceptionSub: The function to invoke if an exception is thrown during authorization. (dInactive) InactiveSub: The function to invoke if the authorization finds the user inactive. [Read-Only] (Boolean) IsAuthorized: Returns whether the user is authorized to use this program. (Boolean) ShowMsgBox: Gets or sets whether to show interactive messageboxes with user. [Read-Only] (Integer) Progress: Gets the percentage complete out of 100. (Boolean) GetStatistics: Gets or sets whether to get statistics after a successful authorization. Methods (Void) Import: Imports the specified parameters to the instance of NFAuth. If parameters are left empty or with their default values, their values are left unchanged. [fitbox=125][Optional] (String) strUsername: The username to set the Neofriends.net authorization to. [Optional] (String) strPassword: The password corresponding to the username to authorize. [Optional] (String) strProgramID: The identification number (ID) of the program to authorize. [Optional] (String) strProgramName: The name of the program to authorize. Must be exact match to name in downloads section. [Optional] (Control) InvokeControl: The control to invoke when calling a Sub. [Optional] (Integer) iTimeout: The maximum time (in milliseconds) to wait for an authorization response. [Optional] (Integer) iActivityPosts: The minimum posts by the user to use the program. [Optional] (Integer) iActivityDays: The span of days to check for user activity. If set to 0, authorization will check total post count. [Optional] (dUpdateAvailable) UpdateSub: The function to invoke if authorization finds an update available. [Optional] (dAuthorized) AuthorizedSub: The function to invoke if the authorization finds the user authorized without retrieving statistics. [Optional] (dAuthorizedWithStats) AuthorizedWithStatsSub: The function to invoke if the authorization finds the user authorized after retrieving statistics. [Optional] (dUnAuthorized) UnAuthorizedSub: The function to invoke if authorized finds the user unauthorized. [Optional] (dExceptionHandle) ExceptionSub: The function to invoke if an exception is thrown during authorization. [Optional] (dInactive) InactiveSub: The function to invoke if the authorization finds the user inactive. [Optional] (Label) lblStatus: The label to update with the latest authorization status. [Optional] (ToolStripLabel) tsStatus: The ToolStripLabel to update with the latest authorization status. [Optional] (NotifyIcon) ni: The NotifyIcon to show balloons with the latest authorization status.[/fitbox] (Boolean) Authorize: Authorize with Neofriends synchronously using the information provided. Returns whether authorization was successful. (Void) AuthorizeASync: Authorize with Neofriends asynchronously using the information provided.
Using in Visual Studio Go to Project -> Add Reference... Click on the 'Browse' tab and find NFAuth.dll. Once loaded, this should show up under the Project's References like this. Click on NFAuth. The 'Properties' window should appear as follows. Make sure that Copy Local is set to true. You should be all set to go! Remember to import the 'Authorization' namespace. For VB.NET programmers, put this before the class (in the imports): Code (Text): Imports Authorization For C# programmers, put this before the class (in the imports): Code (Text): using Authorization;
Example Usage (VB.NET) Example Usage (VB.NET) For syntax highlight, go here: http://pastebin.com/A9Dr1igK Code (Text): Imports System.Collections Imports System.Collections.Generic Imports System.Text Imports System.Windows.Forms Imports Authorization Public Partial Class frmMain Inherits Form Public Sub New() InitializeComponent() End Sub #Region "Authorization" Private Sub btnAuthorize_Click(sender As Object, e As EventArgs) 'Validate that user has entered correct information in textboxes. 'Use NFAuth's constructor to your full advantage Dim auth As New NFAuth(txtUsername.Text, txtPassword.Text, PROGRAM_ID, PROGRAM_NAME, Me, UpdateSub := AddressOf Auth_UpdateHandler, _ AuthorizedSub := AddressOf Auth_AuthorizedHandler, UnAuthorizedSub := AddressOf Auth_UnauthorizedHandler, ExceptionSub := AddressOf Auth_ExceptionHandler) 'Settings can also be set like this: auth.StatusLabel = lblStatus 'Authorize asynchronously so it doesn't freeze the GUI auth.AuthorizeASync() 'Disable your authorize button btnAuthorize.Enabled = False End Sub Private Sub Auth_ExceptionHandler(ex As Exception) 'Handle the exception (stuff like Debug.Print() might help with debugging) End Sub Private Sub Auth_AuthorizedHandler() 'Do something when they are authorized End Sub Private Sub Auth_UnauthorizedHandler() btnAuthorize.Enabled = True 'Do something for handling unauthorized. End Sub Private Sub Auth_UpdateHandler() 'You can either require the user to update before using or just use the outdated version. End Sub #End Region End Class
Example Usage (C#) Example Usage (C#) For syntax highlight, go here: http://pastebin.com/E2R6xBru Code (Text): using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using Authorization; public partial class frmMain : Form { public frmMain() { InitializeComponent(); } #region "Authorization" private void btnAuthorize_Click(object sender, EventArgs e) { //Validate that user has entered correct information in textboxes. //Use NFAuth's constructor to your full advantage NFAuth auth = new NFAuth(txtUsername.Text, txtPassword.Text, PROGRAM_ID, PROGRAM_NAME, this, UpdateSub: Auth_UpdateHandler, AuthorizedSub: Auth_AuthorizedHandler, UnAuthorizedSub: Auth_UnauthorizedHandler, ExceptionSub: Auth_ExceptionHandler); //Settings can also be set like this: auth.StatusLabel = lblStatus; //Authorize asynchronously so it doesn't freeze the GUI auth.AuthorizeASync(); //Disable your authorize button btnAuthorize.Enabled = false; } private void Auth_ExceptionHandler(Exception ex) { //Handle the exception (stuff like Debug.Print() might help with debugging) } private void Auth_AuthorizedHandler() { //Do something when they are authorized } private void Auth_UnauthorizedHandler() { btnAuthorize.Enabled = true; //Do something for handling unauthorized. } private void Auth_UpdateHandler() { //You can either require the user to update before using or just use the outdated version. } #endregion }
Download Download Before downloading, I would like to thank tharoux and ricky92. Tharoux for him trusting me and helping me with this authorization. Ricky92 for his existing code that this new authorization is based off of. Zip Hashes SHA1: 4F8E4331E82062382B0486F9AF973DAEC382A935 MD5: CFE2183841126634EEC14392183B54FA NFAuth.dll Hashes SHA1: A461956F6969798FAE744F04AED365C92805437F MD5: 836189EE243158982B691749B1972FBB Download:
Version 2.0 New Features Major security updates Updated for faster authorization Added optional activity monitor for the programmer Many minor internal changes
It's not due to the authorization system itself, it was the database's collation which caused usernames to be case sensitive. I've changed it, and it should be working as expected now