├── HFAPI ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignTimeResolveAssemblyReferencesInput.cache ├── .vs │ └── HFAPI │ │ └── v14 │ │ └── .suo ├── CookieClient.cs ├── Properties │ └── AssemblyInfo.cs ├── HFAPI.sln ├── Helpers.cs ├── HFAPI.csproj └── Hfapi.cs ├── HFAPI_Form ├── obj │ └── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ ├── TempPE │ │ └── Properties.Resources.Designer.cs.dll │ │ └── DesignTimeResolveAssemblyReferencesInput.cache ├── bin │ └── Debug │ │ ├── HFAPI_Form.vshost.exe │ │ ├── HFAPI_Form.vshost.exe.config │ │ └── HFAPI_Form.vshost.exe.manifest ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Program.cs ├── Form1.cs ├── HFAPI_Form.csproj ├── Form1.resx └── Form1.Designer.cs ├── HFAPI_Console ├── App.config ├── Properties │ └── AssemblyInfo.cs ├── HFAPI_Console.csproj └── Program.cs ├── .gitattributes ├── .gitignore └── README.md /HFAPI/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HFAPI/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HFAPI/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HFAPI_Form/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HFAPI_Form/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HFAPI_Form/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /HFAPI/.vs/HFAPI/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XenocodeRCE/HFAPI/master/HFAPI/.vs/HFAPI/v14/.suo -------------------------------------------------------------------------------- /HFAPI_Form/bin/Debug/HFAPI_Form.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XenocodeRCE/HFAPI/master/HFAPI_Form/bin/Debug/HFAPI_Form.vshost.exe -------------------------------------------------------------------------------- /HFAPI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XenocodeRCE/HFAPI/master/HFAPI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /HFAPI_Form/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XenocodeRCE/HFAPI/master/HFAPI_Form/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /HFAPI_Form/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XenocodeRCE/HFAPI/master/HFAPI_Form/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll -------------------------------------------------------------------------------- /HFAPI_Form/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XenocodeRCE/HFAPI/master/HFAPI_Form/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /HFAPI_Form/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HFAPI_Console/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HFAPI_Form/bin/Debug/HFAPI_Form.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HFAPI_Form/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /HFAPI_Form/bin/Debug/HFAPI_Form.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /HFAPI_Form/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace HFAPI_Form 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /HFAPI/CookieClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace HFAPI 5 | { 6 | public sealed class CookieClient : WebClient 7 | { 8 | private HttpWebRequest _request; 9 | 10 | public CookieContainer Cookies = new CookieContainer(); 11 | 12 | protected override WebRequest GetWebRequest(Uri address) 13 | { 14 | _request = (HttpWebRequest)base.GetWebRequest(address); 15 | if (_request == null) return null; 16 | _request.Timeout = 8000; 17 | _request.ReadWriteTimeout = 30000; 18 | _request.KeepAlive = false; 19 | _request.CookieContainer = Cookies; 20 | _request.Proxy = null; 21 | return _request; 22 | } 23 | 24 | public void ClearCookies() 25 | { 26 | Cookies = new CookieContainer(); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /HFAPI_Form/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HFAPI_Form.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](http://i.imgur.com/oYXoYMQ.png) 2 | 3 | # HFAPI 4 | HFAPI est une librairie .NET pour pouvoir utiliser certaines fonctions du forum hack-free dans vos programmes .NET 5 | 6 | ### Introduction 7 | Pour utiliser HFAPI vous devez d'abord l'ajouter en référence : 8 | > using HFAPI; 9 | 10 | Ensuite vous devez instanciez la classe : 11 | >User.Connect("Username", "Password"); 12 | 13 | Une fois fais, vous pouvez dès lors obtenir plusieurs informations sur l'User connecté en jouant avec les différantes propriétés disponibles. 14 | 15 | ### Fonctionnalités 16 | 17 | >User.Bet(50); 18 | 19 | Permet de parier 50 crédits contre le système 20 | 21 | >User.Bet("Chewbaka", 50, BetType.Private); 22 | 23 | Permet de parier 50 crédits contre Chewbaka 24 | 25 | >User.PrivateMessage("Chewbaka", "Sujet", "Message", true, true, true); 26 | 27 | Permet d'envoyer un message privé à Chewbaka dont le sujet est "Sujet", le message est "Message", vous voulez y afficher votre signature, sauvegarder une copie et recevoir un accusé de reception 28 | 29 | >User.SendShout("Hello world !"); 30 | 31 | Permet d'envoyer "Hello world !" dans la shoutbox 32 | 33 | >User.ReportProfile("1", "il est gay"); 34 | 35 | Permet de report le profile numéro 1, l'administrateur, parce que "il est gay" 36 | 37 | -------------------------------------------------------------------------------- /HFAPI_Form/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using HFAPI; 11 | 12 | namespace HFAPI_Form 13 | { 14 | public partial class Form1 : Form 15 | { 16 | public Form1() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void button1_Click(object sender, EventArgs e) 22 | { 23 | User.Connect(txtUsername.Text, txtPassword.Text); 24 | lblPosts.Text += User.PostCount.ToString(); 25 | lblRefered.Text += User.ReferencedMembers; 26 | lblReputation.Text += User.Reputation; 27 | lblInscription.Text += User.InscriptionDate; 28 | lblRatio.Text += User.Ratio; 29 | lblUsername.Text = User.Username; 30 | lblUsernameChanges.Text += User.UsernameChange; 31 | lblmerçi.Text += User.Merci; 32 | lblCredit.Text += User.Credit; 33 | pictureBox1.ImageLocation = User.AvatarURL; 34 | lblReported.Text += User.ReportedMessage; 35 | lblGroupe.Text += User.Groupe; 36 | 37 | //var test = User.GetMemberinfo("Chewbaka"); 38 | 39 | var xeno = User.IsUserAMerci("3189"); 40 | 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /HFAPI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Hfapi")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Hfapi")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("33717e48-ef3c-495d-8a12-5e4e214731fb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /HFAPI_Form/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HFAPI_Form")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("HFAPI_Form")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bffffeac-bd0e-4f56-b10e-02695a90c351")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /HFAPI_Console/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HFAPI_Console")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("HFAPI_Console")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("45de621a-bcdd-4bb3-829f-b7c834f0b727")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /HFAPI/HFAPI.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HFAPI", "HFAPI.csproj", "{33717E48-EF3C-495D-8A12-5E4E214731FB}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HFAPI_Form", "..\HFAPI_Form\HFAPI_Form.csproj", "{BFFFFEAC-BD0E-4F56-B10E-02695A90C351}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HFAPI_Console", "..\HFAPI_Console\HFAPI_Console.csproj", "{45DE621A-BCDD-4BB3-829F-B7C834F0B727}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {33717E48-EF3C-495D-8A12-5E4E214731FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {33717E48-EF3C-495D-8A12-5E4E214731FB}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {33717E48-EF3C-495D-8A12-5E4E214731FB}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {33717E48-EF3C-495D-8A12-5E4E214731FB}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {BFFFFEAC-BD0E-4F56-B10E-02695A90C351}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {BFFFFEAC-BD0E-4F56-B10E-02695A90C351}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {BFFFFEAC-BD0E-4F56-B10E-02695A90C351}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {BFFFFEAC-BD0E-4F56-B10E-02695A90C351}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {45DE621A-BCDD-4BB3-829F-B7C834F0B727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {45DE621A-BCDD-4BB3-829F-B7C834F0B727}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {45DE621A-BCDD-4BB3-829F-B7C834F0B727}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {45DE621A-BCDD-4BB3-829F-B7C834F0B727}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /HFAPI/Helpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace HFAPI 8 | { 9 | class Helpers 10 | { 11 | 12 | /// 13 | /// Permet d'obtenir une chaine spécifique entre deux chaines 14 | /// 15 | /// Le debut ou la chaine avant la cible 16 | /// La fin ou la chaine après la cible 17 | /// La source, la String dans laquelle chercher 18 | /// Si oui, le résutat comportera le début 19 | /// Si oui, le résutat comportera la fin 20 | /// 21 | public static string GetStringInBetween(string strBegin, string strEnd, string strSource, bool includeBegin, 22 | bool includeEnd) 23 | { 24 | string[] result = { string.Empty, string.Empty }; 25 | int iIndexOfBegin = strSource.IndexOf(strBegin); 26 | 27 | if (iIndexOfBegin != -1) 28 | { 29 | // include the Begin string if desired 30 | if (includeBegin) 31 | iIndexOfBegin -= strBegin.Length; 32 | 33 | strSource = strSource.Substring(iIndexOfBegin + strBegin.Length); 34 | 35 | int iEnd = strSource.IndexOf(strEnd); 36 | if (iEnd != -1) 37 | { 38 | // include the End string if desired 39 | if (includeEnd) 40 | iEnd += strEnd.Length; 41 | result[0] = strSource.Substring(0, iEnd); 42 | // advance beyond this segment 43 | if (iEnd + strEnd.Length < strSource.Length) 44 | result[1] = strSource.Substring(iEnd + strEnd.Length); 45 | } 46 | } 47 | else 48 | // stay where we are 49 | result[1] = strSource; 50 | return result[0]; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /HFAPI/HFAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {33717E48-EF3C-495D-8A12-5E4E214731FB} 8 | Library 9 | Properties 10 | HFAPI 11 | HFAPI 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Component 45 | 46 | 47 | 48 | 49 | 50 | 51 | 58 | -------------------------------------------------------------------------------- /HFAPI_Console/HFAPI_Console.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {45DE621A-BCDD-4BB3-829F-B7C834F0B727} 8 | Exe 9 | Properties 10 | HFAPI_Console 11 | HFAPI_Console 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\HFAPI\bin\Debug\HFAPI.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 63 | -------------------------------------------------------------------------------- /HFAPI_Form/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HFAPI_Form.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HFAPI_Form.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /HFAPI_Form/HFAPI_Form.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {BFFFFEAC-BD0E-4F56-B10E-02695A90C351} 8 | WinExe 9 | Properties 10 | HFAPI_Form 11 | HFAPI_Form 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\HFAPI\bin\Debug\HFAPI.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Form 54 | 55 | 56 | Form1.cs 57 | 58 | 59 | 60 | 61 | Form1.cs 62 | Designer 63 | 64 | 65 | ResXFileCodeGenerator 66 | Resources.Designer.cs 67 | Designer 68 | 69 | 70 | True 71 | Resources.resx 72 | True 73 | 74 | 75 | SettingsSingleFileGenerator 76 | Settings.Designer.cs 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | 85 | 86 | 87 | 88 | 95 | -------------------------------------------------------------------------------- /HFAPI_Form/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeytoken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeytoken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /HFAPI_Form/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /HFAPI_Console/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Threading.Tasks; 4 | using HFAPI; 5 | 6 | namespace HFAPI_Console 7 | { 8 | class Program 9 | { 10 | const string listreporteduser = @"C:\Users\User\Source\HFAPI\HFAPI_Console\bin\Debug\data\user_report.txt"; 11 | 12 | static void Main(string[] args) 13 | { 14 | 15 | Console.WriteLine("--------------------------------------------------------------"); 16 | Console.WriteLine("-----------------------Hack Free Bot--------------------------"); 17 | Console.WriteLine("-------------------------Modo 2.0-----------------------------" + Environment.NewLine); 18 | 19 | User.Connect("Prometheus", ""); 20 | Label_01: 21 | Console.WriteLine("1. Vérifier les «Merci du partage»"); 22 | Console.WriteLine("2. Bruteforce les profiles à la recherhe de «Merci du partage»"); 23 | Console.WriteLine("3. Parier contre un utilisateur"); 24 | Console.WriteLine("4. Parier contre le système"); 25 | Console.WriteLine("5. Exit"); 26 | 27 | var choice = Console.ReadLine(); 28 | Console.Clear(); 29 | switch (choice) 30 | { 31 | case "1": 32 | Log(logtype.info, "Début de la tâche de vérification !"); 33 | var newreplies = User.LastReplyByUsers(); 34 | foreach (var user in newreplies) 35 | { 36 | choice1(user); 37 | } 38 | Log(logtype.info, "Fin de la tâche de vérification !"); 39 | Console.ReadKey(); 40 | break; 41 | 42 | 43 | 44 | 45 | case "2": 46 | Console.WriteLine("[¤] Début de la tâche de vérification !"); 47 | for (int i = 4; i < 4410; i++) 48 | { 49 | var urluser = "http://hack-free.net/User-" + i; 50 | var user = User.ID2Nickname(i.ToString()); 51 | if (user != null) 52 | { 53 | if (User.IsUserAMerci(i.ToString())) 54 | { 55 | if (!IsAlready(user, listreporteduser)) 56 | { 57 | User.ReportProfile(i.ToString(), 58 | "Merci du partage : http://hack-free.net/search.php?action=finduser&uid=" + i); 59 | Console.WriteLine("[!] {" + user + "} vient d'être reporté pour Merci du Partage"); 60 | using (StreamWriter w = File.AppendText(listreporteduser)) 61 | { 62 | Log(user, w); 63 | } 64 | } 65 | } 66 | else 67 | { 68 | Console.WriteLine("[*] " + user + " est clean."); 69 | } 70 | } 71 | 72 | 73 | } 74 | Console.WriteLine("[¤] Fin de la tâche de vérification !"); 75 | Console.ReadKey(); 76 | break; 77 | 78 | 79 | 80 | 81 | case "3": 82 | Console.WriteLine("[¤] Début de la séssion de pari !"); 83 | var username = Console.ReadLine(); 84 | Console.WriteLine("[!] Vous avez décidé de parier contre " + username); 85 | Console.WriteLine("[? Combie voulez-vous parier ?"); 86 | var somme = Console.ReadLine(); 87 | Console.WriteLine("[?] Êtes vous sûr de vouloir parier " + somme + " crédits contre " + username +" ? [Y/N]"); 88 | var sûr = Console.ReadLine(); 89 | if (sûr.Equals("Y")) 90 | { 91 | User.Bet(username, somme, User.BetType.Public); 92 | Console.WriteLine("[!] Vous avez pariez " + somme + " crédits contre " + username); 93 | Console.WriteLine("[¤] Fin de la séssion de pari !"); 94 | break; 95 | } 96 | else if (sûr.Equals("N")) 97 | { 98 | Console.WriteLine("[¤] Fin de la séssion de pari !"); 99 | break; 100 | } 101 | break; 102 | case "4": 103 | Console.WriteLine("[¤] Début de la séssion de pari !"); 104 | Console.WriteLine("[!] Vous avez décidé de parier contre le système"); 105 | Console.WriteLine("[? Combie voulez-vous parier ?"); 106 | var somme2 = Console.ReadLine(); 107 | Console.WriteLine("[?] Êtes vous sûr de vouloir parier " + somme2 + " crédits ? [Y/N]"); 108 | var sûr2 = Console.ReadLine(); 109 | if (sûr2.Equals("Y") || sûr2.Equals("y")) 110 | { 111 | Console.WriteLine("[!] Vous avez pariez " + somme2 + " crédits contre le système"); 112 | var win = User.Bet(somme2); 113 | if (win) 114 | { 115 | Console.WriteLine("[¤] Pari gagné !"); 116 | } 117 | else 118 | { 119 | Console.WriteLine("[¤] Pari perdu !"); 120 | } 121 | Console.WriteLine("[¤] Fin de la séssion de pari !"); 122 | break; 123 | } 124 | else if (sûr2.Equals("N") || sûr2.Equals("n")) 125 | { 126 | Console.WriteLine("[¤] Fin de la séssion de pari !"); 127 | break; 128 | } 129 | break; 130 | case "5": 131 | //Environment.Exit(0); 132 | var xeno = User.GetUserMessageCount("wako94"); 133 | break; 134 | } 135 | Console.ReadKey(); 136 | goto Label_01; 137 | } 138 | 139 | static void choice1(string user) 140 | { 141 | if (!user.Contains("")) 142 | { 143 | var membre = User.Nickname2ID(user); 144 | if (User.IsUserAMerci(membre)) 145 | { 146 | var x = User.GetMemberinfo(user); 147 | int memberpost = Convert.ToInt32(x[1]); 148 | if (memberpost < 15) 149 | { 150 | User.PrivateMessage(user, "[Avertissement] Vos messages", "Notre systeme automatique vous averti de ne plus répondre par 'merci du partage' sous peine de bannissement.", true, true, true); 151 | 152 | Log(logtype.warning, "{" + user + "} vient d'être averti par message privé"); 153 | } 154 | else 155 | { 156 | if (!IsAlready(user, listreporteduser)) 157 | { 158 | User.ReportProfile(membre, 159 | "Merci du partage : http://hack-free.net/search.php?action=finduser&uid=" + membre); 160 | User.PrivateMessage(user, "[Avertissement] Vos messages", "Vous avez été reporté par notre bot à cause de vos abus de 'merci du partage'. Merci de ne plus recommencer, sinon votre compte sera bannis. Si vous voulez répondre à un message, merci de bien vouloir y répondre convenablement, et éditer vos messages pour laisser un retour positif ou negatif sur le sujet auquel vous avez répondu.", true, true, true); 161 | Log(logtype.danger, "{" + user + "} vient d'être reporté pour Merci du Partage"); 162 | using (StreamWriter w = File.AppendText(listreporteduser)) 163 | { 164 | Log(user, w); 165 | } 166 | } 167 | else 168 | { 169 | Log(logtype.info, "{" + user + "} a déjà été reporté pour Merci du Partage"); 170 | } 171 | } 172 | 173 | } 174 | else 175 | { 176 | Log(logtype.success, "{" + user + "} est clean."); 177 | } 178 | } 179 | } 180 | 181 | static bool IsAlready(string arg, string source) 182 | { 183 | using (StreamReader sr = new StreamReader(source)) 184 | { 185 | string contents = sr.ReadToEnd(); 186 | if (contents.Contains(arg)) 187 | { 188 | return true; 189 | } 190 | } 191 | return false; 192 | } 193 | 194 | public static void WriteToFile(string Str, string Filename) 195 | { 196 | File.WriteAllText(Filename, Str); 197 | return; 198 | } 199 | 200 | public static void Log(string logMessage, TextWriter w) 201 | { 202 | w.Write(logMessage + Environment.NewLine); 203 | } 204 | 205 | static void Log(logtype log, string message) 206 | { 207 | switch (log) 208 | { 209 | case logtype.danger: 210 | Console.ForegroundColor = ConsoleColor.Red; 211 | Console.Write("[X]"); 212 | Console.ForegroundColor = ConsoleColor.White; 213 | Console.WriteLine(message); 214 | break; 215 | case logtype.info: 216 | Console.ForegroundColor = ConsoleColor.Cyan; 217 | Console.Write("[|]"); 218 | Console.ForegroundColor = ConsoleColor.White; 219 | Console.WriteLine(message); 220 | break; 221 | case logtype.success: 222 | Console.ForegroundColor = ConsoleColor.Green; 223 | Console.Write("[V]"); 224 | Console.ForegroundColor = ConsoleColor.White; 225 | Console.WriteLine(message); 226 | break; 227 | case logtype.warning: 228 | Console.ForegroundColor = ConsoleColor.DarkYellow; 229 | Console.Write("[!]"); 230 | Console.ForegroundColor = ConsoleColor.White; 231 | Console.WriteLine(message); 232 | break; 233 | } 234 | } 235 | 236 | enum logtype 237 | { 238 | info, 239 | warning, 240 | success, 241 | danger, 242 | 243 | } 244 | 245 | } 246 | } 247 | -------------------------------------------------------------------------------- /HFAPI_Form/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace HFAPI_Form 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.button1 = new System.Windows.Forms.Button(); 32 | this.txtUsername = new System.Windows.Forms.TextBox(); 33 | this.txtPassword = new System.Windows.Forms.TextBox(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.lblUsername = new System.Windows.Forms.Label(); 37 | this.lblRefered = new System.Windows.Forms.Label(); 38 | this.lblCredit = new System.Windows.Forms.Label(); 39 | this.lblmerçi = new System.Windows.Forms.Label(); 40 | this.lblPosts = new System.Windows.Forms.Label(); 41 | this.lblReputation = new System.Windows.Forms.Label(); 42 | this.lblReported = new System.Windows.Forms.Label(); 43 | this.lblAverto = new System.Windows.Forms.Label(); 44 | this.lblInscription = new System.Windows.Forms.Label(); 45 | this.lblRatio = new System.Windows.Forms.Label(); 46 | this.lblUsernameChanges = new System.Windows.Forms.Label(); 47 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 48 | this.lblGroupe = new System.Windows.Forms.Label(); 49 | this.richTextBox1 = new System.Windows.Forms.RichTextBox(); 50 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 51 | this.SuspendLayout(); 52 | // 53 | // button1 54 | // 55 | this.button1.Location = new System.Drawing.Point(363, 280); 56 | this.button1.Name = "button1"; 57 | this.button1.Size = new System.Drawing.Size(75, 23); 58 | this.button1.TabIndex = 0; 59 | this.button1.Text = "Login"; 60 | this.button1.UseVisualStyleBackColor = true; 61 | this.button1.Click += new System.EventHandler(this.button1_Click); 62 | // 63 | // txtUsername 64 | // 65 | this.txtUsername.Location = new System.Drawing.Point(83, 282); 66 | this.txtUsername.Name = "txtUsername"; 67 | this.txtUsername.Size = new System.Drawing.Size(100, 20); 68 | this.txtUsername.TabIndex = 1; 69 | this.txtUsername.Text = "Prometheus"; 70 | // 71 | // txtPassword 72 | // 73 | this.txtPassword.Location = new System.Drawing.Point(257, 282); 74 | this.txtPassword.Name = "txtPassword"; 75 | this.txtPassword.Size = new System.Drawing.Size(100, 20); 76 | this.txtPassword.TabIndex = 2; 77 | this.txtPassword.Text = "qlThXKaQ"; 78 | // 79 | // label1 80 | // 81 | this.label1.AutoSize = true; 82 | this.label1.Location = new System.Drawing.Point(13, 285); 83 | this.label1.Name = "label1"; 84 | this.label1.Size = new System.Drawing.Size(64, 13); 85 | this.label1.TabIndex = 3; 86 | this.label1.Text = "Username : "; 87 | // 88 | // label2 89 | // 90 | this.label2.AutoSize = true; 91 | this.label2.Location = new System.Drawing.Point(189, 285); 92 | this.label2.Name = "label2"; 93 | this.label2.Size = new System.Drawing.Size(62, 13); 94 | this.label2.TabIndex = 4; 95 | this.label2.Text = "Password : "; 96 | // 97 | // lblUsername 98 | // 99 | this.lblUsername.AutoSize = true; 100 | this.lblUsername.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 101 | this.lblUsername.ForeColor = System.Drawing.Color.Black; 102 | this.lblUsername.Location = new System.Drawing.Point(2, 18); 103 | this.lblUsername.Name = "lblUsername"; 104 | this.lblUsername.Size = new System.Drawing.Size(139, 20); 105 | this.lblUsername.TabIndex = 7; 106 | this.lblUsername.Text = "%USERNAME%"; 107 | // 108 | // lblRefered 109 | // 110 | this.lblRefered.AutoSize = true; 111 | this.lblRefered.Location = new System.Drawing.Point(12, 64); 112 | this.lblRefered.Name = "lblRefered"; 113 | this.lblRefered.Size = new System.Drawing.Size(100, 13); 114 | this.lblRefered.TabIndex = 8; 115 | this.lblRefered.Text = "Members Referred: "; 116 | // 117 | // lblCredit 118 | // 119 | this.lblCredit.AutoSize = true; 120 | this.lblCredit.Location = new System.Drawing.Point(13, 88); 121 | this.lblCredit.Name = "lblCredit"; 122 | this.lblCredit.Size = new System.Drawing.Size(42, 13); 123 | this.lblCredit.TabIndex = 9; 124 | this.lblCredit.Text = "Credits:"; 125 | // 126 | // lblmerçi 127 | // 128 | this.lblmerçi.AutoSize = true; 129 | this.lblmerçi.Location = new System.Drawing.Point(13, 112); 130 | this.lblmerçi.Name = "lblmerçi"; 131 | this.lblmerçi.Size = new System.Drawing.Size(65, 13); 132 | this.lblmerçi.TabIndex = 10; 133 | this.lblmerçi.Text = "Merci Reçu:"; 134 | // 135 | // lblPosts 136 | // 137 | this.lblPosts.AutoSize = true; 138 | this.lblPosts.Location = new System.Drawing.Point(12, 136); 139 | this.lblPosts.Name = "lblPosts"; 140 | this.lblPosts.Size = new System.Drawing.Size(63, 13); 141 | this.lblPosts.TabIndex = 11; 142 | this.lblPosts.Text = "Total Posts:"; 143 | // 144 | // lblReputation 145 | // 146 | this.lblReputation.AutoSize = true; 147 | this.lblReputation.Location = new System.Drawing.Point(189, 64); 148 | this.lblReputation.Name = "lblReputation"; 149 | this.lblReputation.Size = new System.Drawing.Size(65, 13); 150 | this.lblReputation.TabIndex = 12; 151 | this.lblReputation.Text = "Réputation :"; 152 | // 153 | // lblReported 154 | // 155 | this.lblReported.AutoSize = true; 156 | this.lblReported.Location = new System.Drawing.Point(189, 88); 157 | this.lblReported.Name = "lblReported"; 158 | this.lblReported.Size = new System.Drawing.Size(99, 13); 159 | this.lblReported.TabIndex = 13; 160 | this.lblReported.Text = "Messages Signale: "; 161 | // 162 | // lblAverto 163 | // 164 | this.lblAverto.AutoSize = true; 165 | this.lblAverto.Location = new System.Drawing.Point(186, 112); 166 | this.lblAverto.Name = "lblAverto"; 167 | this.lblAverto.Size = new System.Drawing.Size(129, 13); 168 | this.lblAverto.TabIndex = 14; 169 | this.lblAverto.Text = " Niveau d\'avertissement : "; 170 | // 171 | // lblInscription 172 | // 173 | this.lblInscription.AutoSize = true; 174 | this.lblInscription.Location = new System.Drawing.Point(186, 136); 175 | this.lblInscription.Name = "lblInscription"; 176 | this.lblInscription.Size = new System.Drawing.Size(94, 13); 177 | this.lblInscription.TabIndex = 15; 178 | this.lblInscription.Text = "Date d\'inscription: "; 179 | // 180 | // lblRatio 181 | // 182 | this.lblRatio.AutoSize = true; 183 | this.lblRatio.Location = new System.Drawing.Point(12, 159); 184 | this.lblRatio.Name = "lblRatio"; 185 | this.lblRatio.Size = new System.Drawing.Size(35, 13); 186 | this.lblRatio.TabIndex = 16; 187 | this.lblRatio.Text = "Ratio:"; 188 | // 189 | // lblUsernameChanges 190 | // 191 | this.lblUsernameChanges.AutoSize = true; 192 | this.lblUsernameChanges.Location = new System.Drawing.Point(189, 159); 193 | this.lblUsernameChanges.Name = "lblUsernameChanges"; 194 | this.lblUsernameChanges.Size = new System.Drawing.Size(106, 13); 195 | this.lblUsernameChanges.TabIndex = 17; 196 | this.lblUsernameChanges.Text = "Username Changes: "; 197 | // 198 | // pictureBox1 199 | // 200 | this.pictureBox1.Location = new System.Drawing.Point(370, 12); 201 | this.pictureBox1.Name = "pictureBox1"; 202 | this.pictureBox1.Size = new System.Drawing.Size(64, 64); 203 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; 204 | this.pictureBox1.TabIndex = 18; 205 | this.pictureBox1.TabStop = false; 206 | // 207 | // lblGroupe 208 | // 209 | this.lblGroupe.AutoSize = true; 210 | this.lblGroupe.Location = new System.Drawing.Point(12, 182); 211 | this.lblGroupe.Name = "lblGroupe"; 212 | this.lblGroupe.Size = new System.Drawing.Size(51, 13); 213 | this.lblGroupe.TabIndex = 19; 214 | this.lblGroupe.Text = "Groupe : "; 215 | // 216 | // richTextBox1 217 | // 218 | this.richTextBox1.Location = new System.Drawing.Point(387, 117); 219 | this.richTextBox1.Name = "richTextBox1"; 220 | this.richTextBox1.Size = new System.Drawing.Size(419, 96); 221 | this.richTextBox1.TabIndex = 20; 222 | this.richTextBox1.Text = ""; 223 | // 224 | // Form1 225 | // 226 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 227 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 228 | this.ClientSize = new System.Drawing.Size(818, 309); 229 | this.Controls.Add(this.richTextBox1); 230 | this.Controls.Add(this.lblGroupe); 231 | this.Controls.Add(this.pictureBox1); 232 | this.Controls.Add(this.lblUsernameChanges); 233 | this.Controls.Add(this.lblRatio); 234 | this.Controls.Add(this.lblInscription); 235 | this.Controls.Add(this.lblAverto); 236 | this.Controls.Add(this.lblReported); 237 | this.Controls.Add(this.lblReputation); 238 | this.Controls.Add(this.lblPosts); 239 | this.Controls.Add(this.lblmerçi); 240 | this.Controls.Add(this.lblCredit); 241 | this.Controls.Add(this.lblRefered); 242 | this.Controls.Add(this.lblUsername); 243 | this.Controls.Add(this.label2); 244 | this.Controls.Add(this.label1); 245 | this.Controls.Add(this.txtPassword); 246 | this.Controls.Add(this.txtUsername); 247 | this.Controls.Add(this.button1); 248 | this.MaximizeBox = false; 249 | this.MinimizeBox = false; 250 | this.Name = "Form1"; 251 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 252 | this.Text = "Hack-Free Login"; 253 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 254 | this.ResumeLayout(false); 255 | this.PerformLayout(); 256 | 257 | } 258 | 259 | #endregion 260 | 261 | private System.Windows.Forms.Button button1; 262 | private System.Windows.Forms.TextBox txtUsername; 263 | private System.Windows.Forms.TextBox txtPassword; 264 | private System.Windows.Forms.Label label1; 265 | private System.Windows.Forms.Label label2; 266 | private System.Windows.Forms.Label lblUsername; 267 | private System.Windows.Forms.Label lblRefered; 268 | private System.Windows.Forms.Label lblCredit; 269 | private System.Windows.Forms.Label lblmerçi; 270 | private System.Windows.Forms.Label lblPosts; 271 | private System.Windows.Forms.Label lblReputation; 272 | private System.Windows.Forms.Label lblReported; 273 | private System.Windows.Forms.Label lblAverto; 274 | private System.Windows.Forms.Label lblInscription; 275 | private System.Windows.Forms.Label lblRatio; 276 | private System.Windows.Forms.Label lblUsernameChanges; 277 | private System.Windows.Forms.PictureBox pictureBox1; 278 | private System.Windows.Forms.Label lblGroupe; 279 | private System.Windows.Forms.RichTextBox richTextBox1; 280 | } 281 | } 282 | 283 | -------------------------------------------------------------------------------- /HFAPI/Hfapi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.Specialized; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text.RegularExpressions; 7 | 8 | namespace HFAPI 9 | { 10 | 11 | public class User 12 | { 13 | #region Sared var 14 | 15 | /// 16 | /// L'instance initiale du Forum 17 | /// 18 | public static Uri ForumUri { get; set; } 19 | 20 | /// 21 | /// Sert à pointer vers la page de Login 22 | /// 23 | public static string LoginPage { get; set; } 24 | 25 | /// 26 | /// La PostKey de MyBB 27 | /// 28 | public static string MyPostKey { get; set; } 29 | 30 | /// 31 | /// Le Code Source de la page principale (index) 32 | /// 33 | public static string Forum { get; set; } 34 | 35 | /// 36 | /// Le code source de l'UserCP du membre 37 | /// 38 | public static string Userpanel { get; set; } 39 | 40 | /// 41 | /// Le Webclient qui permet de garder les Cookies en mémoires 42 | /// 43 | public static CookieClient MyWebClient { get; set; } 44 | 45 | /// 46 | /// Le String.Concat du pauvre, pour valider l'instance principale du Forum 47 | /// 48 | public static string CompleteUrl => new Uri(ForumUri, LoginPage).ToString(); 49 | 50 | #endregion 51 | 52 | #region User var 53 | 54 | /// 55 | /// L'ID qui sert à identifier le membre sur le forum 56 | /// 57 | public static int UserID { get; set; } 58 | 59 | /// 60 | /// Le nom d'utilisateur du membre 61 | /// 62 | public static string Username { get; set; } 63 | 64 | /// 65 | /// La PostKey de MyBB, utile pour toutes les autres requettes 66 | /// 67 | public static string PostKey { get; set; } 68 | 69 | /// 70 | /// Le nombre total de posts (messages + sujets) 71 | /// 72 | public static int PostCount { get; set; } 73 | 74 | /// 75 | /// Le ratio actuel du membre 76 | /// 77 | public static string Ratio { get; set; } 78 | 79 | /// 80 | /// Le nombre total de "Merçi" reçu 81 | /// 82 | public static string Merci { get; set; } 83 | 84 | /// 85 | /// Le nombre de réputation positive ou négative 86 | /// 87 | public static string Reputation { get; set; } 88 | 89 | /// 90 | /// La date d'inscription au forum 91 | /// 92 | public static string InscriptionDate { get; set; } 93 | 94 | /// 95 | /// Le nombre de fois que le membre à changé de pseudo 96 | /// Le nombre total de pseudos est donc égale à UsernameChange + 1 97 | /// 98 | public static string UsernameChange { get; set; } 99 | 100 | /// 101 | /// Le titre / nom du groupe d'affichage séléctionné par le membre 102 | /// 103 | public static string Groupe { get; set; } 104 | 105 | /// 106 | /// La liste des groupes dont le membre est membre 107 | /// 108 | public static List Groupes { get; set; } 109 | 110 | /// 111 | /// Le nombre de membre qui se sont inscrits en méttant comme Parrain le membre 112 | /// 113 | public static int ReferencedMembers { get; set; } 114 | 115 | /// 116 | /// Le nombre de crédit dont dispose le membre 117 | /// 118 | public static string Credit { get; set; } 119 | 120 | /// 121 | /// L'adresse URL pointant vers l'Avatar actuel du membre 122 | /// 123 | public static string AvatarURL { get; set; } 124 | 125 | /// 126 | /// Le nombre de message / poste / sujets reportés par le membre 127 | /// 128 | public static string ReportedMessage { get; set; } 129 | 130 | /// 131 | /// Le taux d'avertissement du membre 132 | /// La valeur retournée est une string du nombre sans le pourcentage 133 | /// 134 | public static string Avertissement { get; set; } 135 | 136 | #endregion 137 | 138 | /// 139 | /// Permet de se connecter au forum 140 | /// 141 | /// Votre nom d'utilisateur. 142 | /// Votre mot de passe. 143 | public static void Connect(string username, string password) 144 | { 145 | try 146 | { 147 | ForumUri = new Uri("http://hack-free.net/"); 148 | LoginPage = "member.php"; 149 | MyWebClient = new CookieClient {BaseAddress = ForumUri.ToString()}; 150 | var request = new NameValueCollection 151 | { 152 | {"action", "do_login"}, 153 | {"url", CompleteUrl}, 154 | {"quick_login", "1"}, 155 | {"quick_username", username}, //Prometheus 156 | {"quick_password", password}, // 157 | {"submit", "Login"}, 158 | {"quick_remember", "no"} 159 | }; 160 | var connection = MyWebClient.UploadValues(CompleteUrl, request); 161 | var myStream = new MemoryStream(connection); 162 | var myReader = new StreamReader(myStream); 163 | var xeno = myReader.ReadToEnd(); 164 | Forum = xeno; 165 | Username = username; 166 | if (myReader.ReadToEnd().Contains("Corrigez les erreurs suivantes avant de continuer :")) 167 | { 168 | throw new Exception("Error : Cannot connect to the forum : Invalid Login or Password"); 169 | } 170 | GetData(); 171 | } 172 | catch (Exception e) 173 | { 174 | 175 | throw new Exception("Error : Cannot connect to the forum : " + e.ToString()); 176 | } 177 | } 178 | 179 | /// 180 | /// Permet de parier une somme de crédit X contre le système 181 | /// 182 | /// En int, minimum 50 maximum 10,000 183 | /// Renvoie True quand le pari est gagné, False quand ce dernier est perdu 184 | public static bool Bet(string montant) 185 | { 186 | var betpoints = montant.ToString(); 187 | 188 | var response = MyWebClient.UploadValues("http://hack-free.net/newpoints.php", new NameValueCollection() 189 | { 190 | { "my_post_key", PostKey }, 191 | { "action", "betting"}, 192 | { "type", "system" }, 193 | { "username", "" }, 194 | { "points", betpoints }, 195 | { "submit", "Affronter" } 196 | }); 197 | 198 | var result = System.Text.Encoding.UTF8.GetString(response); 199 | //
Vous avez un message privé non lu de Prometheus intitulé System bet results
200 | var xeno = 2; 201 | var src1 = "intitulé ", ""); 207 | entries2 = entries2.Trim('"'); 208 | entries2 = entries2.Replace("amp;", ""); 209 | var readPm = MyWebClient.DownloadString("http://hack-free.net/" + entries2); 210 | 211 | return !readPm.Contains("perdu"); 212 | } 213 | 214 | /// 215 | /// Permet d'envoyer un message dans la shoutbox 216 | /// 217 | /// Le message à envoyer 218 | public static void SendShout(string message) 219 | { 220 | MyWebClient.Headers.Add("Referer", "http://hack-free.net/"); 221 | var response = MyWebClient.UploadValues("http://hack-free.net/infernoshout.php?action=newshout", new NameValueCollection() 222 | { 223 | { "shout", message}, 224 | { "my_post_key", PostKey } 225 | 226 | }); 227 | var result = System.Text.Encoding.UTF8.GetString(response); 228 | } 229 | 230 | /// 231 | /// Permet de reporter un profile 232 | /// 233 | /// l'UserID de la personne à reporter 234 | /// La raison du report 235 | public static void ReportProfile(string memberID, string reason) 236 | { 237 | var response = MyWebClient.UploadValues("http://hack-free.net/misc.php", new NameValueCollection() 238 | { 239 | { "reason", reason }, 240 | { "submit", "Envoyer mon rapport"}, 241 | { "action", "do_profile_report" }, 242 | { "uid", memberID }, 243 | { "do_uid", UserID.ToString() } 244 | }); 245 | 246 | var result = System.Text.Encoding.UTF8.GetString(response); 247 | } 248 | 249 | 250 | /// 251 | /// Permet de récupérer certaines informations d'un membre 252 | /// 253 | /// le pseudonyme du membre 254 | /// Ratio, Merçi, Reputation, Message report, Credit, Groupe d'affichage 255 | public static List GetMemberinfo(string pseudo) 256 | { 257 | try 258 | { 259 | var infos = new List(); 260 | var ID = Nickname2ID(pseudo); 261 | var panel = MyWebClient.DownloadString("http://hack-free.net/User-" + ID); 262 | Userpanel = panel; 263 | var ratio = GetRatio(); 264 | var msg = Getpostcount(); 265 | var merci = GetMerci(); 266 | var rep = GetReputation(); 267 | var reportedmessage = GetReportedMessage(); 268 | var credit = GetCredit(); 269 | var maingroupe = GetGroupe(); 270 | infos.Add(ratio); 271 | infos.Add(msg.ToString()); 272 | infos.Add(merci); 273 | infos.Add(rep); 274 | infos.Add(reportedmessage); 275 | infos.Add(credit); 276 | infos.Add(maingroupe); 277 | return infos; 278 | } 279 | catch (Exception) 280 | { 281 | 282 | return null; 283 | } 284 | 285 | } 286 | 287 | 288 | /// 289 | /// Permet de parier une somme de crédit X contre un utilisateur 290 | /// 291 | /// L'Username de la personne contre laquelle vous pariez 292 | /// En int, minimum 50 maximum 10,000 293 | /// Choisir le de partie : Public, Private, System 294 | /// Ne permet pas de savoir si on gagne ou on perd ! 295 | public static void Bet(string username, string montant, BetType bet) 296 | { 297 | var betpoints = montant.ToString(); 298 | 299 | var response = MyWebClient.UploadValues("http://hack-free.net/newpoints.php", new NameValueCollection() 300 | { 301 | { "my_post_key", PostKey }, 302 | { "action", "betting"}, 303 | { "type", bet.ToString() }, 304 | { "username", username }, 305 | { "points", betpoints }, 306 | { "submit", "Affronter" } 307 | }); 308 | 309 | var result = System.Text.Encoding.UTF8.GetString(response); 310 | } 311 | 312 | /// 313 | /// Permet d'envoyer un message privé à un membre 314 | /// 315 | /// Membre à qui envoyer le message privé 316 | /// Sujet du message privé 317 | /// Corps, message à envoyer 318 | /// inclure ou non votre signature 319 | /// sauvegarder ou non une copie dans le dossier "Envoyé" 320 | /// Recevoir ou non un accusé de reception 321 | public static void PrivateMessage(string to, string sujet, string message, bool signature, bool savecopie, bool accuséreception) 322 | { 323 | var sig = signature ? 1 : 0; 324 | var savecopy = savecopie ? 1 : 0; 325 | var readreceipt = accuséreception ? 1 : 0; 326 | 327 | var response = MyWebClient.UploadValues("http://hack-free.net/private.php", new NameValueCollection() 328 | { 329 | { "my_post_key", PostKey }, 330 | { "to", to + ", "}, 331 | { "bcc", "" }, 332 | { "subject", sujet }, 333 | { "message_new", message }, 334 | { "message", message }, 335 | { "options[signature]", sig.ToString() }, 336 | { "options[savecopy]", savecopy.ToString() }, 337 | { "options[readreceipt]", readreceipt.ToString() }, 338 | { "action", "do_send" }, 339 | { "pmid", "" }, 340 | { "do", "" }, 341 | { "submit", "Envoyer le message" }, 342 | }); 343 | 344 | var result = System.Text.Encoding.UTF8.GetString(response); 345 | } 346 | 347 | /// 348 | /// Les types de parties 349 | /// 350 | public enum BetType 351 | { 352 | Public, 353 | Private, 354 | System 355 | } 356 | 357 | /// 358 | /// Permet de récupérer le pseudonyme à partir de l'UserID 359 | /// 360 | /// 361 | public static string ID2Nickname(string memberID) 362 | { 363 | try 364 | { 365 | string nickname; 366 | var profile = MyWebClient.DownloadString("http://hack-free.net/User-" + memberID); 367 | //http://hack-free.net/User-1094 368 | //Profil de `Kysura~_^ 369 | var src1 = "Profil de "; 370 | var src2 = ""; 371 | var entries2 = Helpers.GetStringInBetween(src1, src2, 372 | profile, false, false); 373 | nickname = entries2; 374 | return nickname; 375 | } 376 | catch (Exception) 377 | { 378 | 379 | return null; // 404 -> profile delet 380 | } 381 | 382 | } 383 | 384 | /// 385 | /// Permet de récupérer l'userID à partir d'un pseudo 386 | /// 387 | /// 388 | /// 389 | public static string Nickname2ID(string pseudo) 390 | { 391 | string ID = ""; 392 | 393 | var response = MyWebClient.UploadValues("http://hack-free.net/memberlist.php", new NameValueCollection() 394 | { 395 | { "username", pseudo }, 396 | { "website", ""}, 397 | { "sort", "lastvisit" }, 398 | { "order", "ascending" }, 399 | { "submit", "Rechercher" } 400 | }); 401 | var result = System.Text.Encoding.UTF8.GetString(response); 402 | //Prometheus
403 | var src1 = " 416 | /// Permet de récupérer la liste des utilisateurs ayant répondu dernièrement aux sujet 417 | /// 418 | /// Un array de string comprenant tous les utilisateurs 419 | public static List LastReplyByUsers() 420 | { 421 | List xx = new List(); 422 | var entries = 423 | Helpers.GetStringInBetween("SujetHeure AuteurDerniersForum", 424 | "", Forum, false, false); 425 | var x = 0; 426 | while (x < 15) 427 | { 428 | entries = entries.Replace("", null); 429 | entries = entries.Replace("", null); 430 | entries = entries.Replace( 431 | "\"\"/ ", 432 | null); 433 | entries = entries.Replace( 434 | "\"\"/ ", 435 | null); 436 | entries = entries.Replace("", null); 437 | x++; 438 | } 439 | File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\" + "HFB_users2.txt",entries); 440 | var file_users = AppDomain.CurrentDomain.BaseDirectory + @"\" + "HFB_users2.txt"; 441 | var sr = new StreamReader(file_users).ReadToEnd(); 442 | var user12delet = Helpers.GetStringInBetween("", "", sr, true, true); 443 | sr.Replace(sr, user12delet); 444 | // 445 | var user1 = GetLine(file_users, 8); 446 | var cbdefois = Regex.Matches(user1, "").Count; 447 | if (cbdefois == 2) 448 | { 449 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 450 | userB = userB.Replace("", ""); 451 | userB = userB.Replace("", ""); 452 | userB = userB.Replace("", ""); 453 | userB = userB.Replace("", ""); 454 | user1 = user1.Replace(""+userB+"", null); 455 | if (!xx.Contains(userB)) 456 | { 457 | xx.Add(userB); 458 | } 459 | } 460 | string user = Helpers.GetStringInBetween("", "", user1, false, false); 461 | user.Replace("", ""); 462 | user.Replace("", ""); 463 | if (!xx.Contains(user)) 464 | { 465 | xx.Add(user); 466 | } 467 | // 468 | user1 = GetLine(file_users, 15); 469 | cbdefois = Regex.Matches(user1, "").Count; 470 | if (cbdefois == 2) 471 | { 472 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 473 | userB = userB.Replace("", ""); 474 | userB = userB.Replace("", ""); 475 | userB = userB.Replace("", ""); 476 | userB = userB.Replace("", ""); 477 | user1 = user1.Replace("" + userB + "", null); 478 | if (!xx.Contains(userB)) 479 | { 480 | xx.Add(userB); 481 | } 482 | } 483 | user = Helpers.GetStringInBetween("", "", user1, false, false); 484 | user.Replace("", ""); 485 | user.Replace("", ""); 486 | if (!xx.Contains(user)) 487 | { 488 | xx.Add(user); 489 | } 490 | // 491 | user1 = GetLine(file_users, 22); 492 | cbdefois = Regex.Matches(user1, "").Count; 493 | if (cbdefois == 2) 494 | { 495 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 496 | userB = userB.Replace("", ""); 497 | userB = userB.Replace("", ""); 498 | userB = userB.Replace("", ""); 499 | userB = userB.Replace("", ""); 500 | user1 = user1.Replace("" + userB + "", null); 501 | if (!xx.Contains(userB)) 502 | { 503 | xx.Add(userB); 504 | } 505 | } 506 | user = Helpers.GetStringInBetween("", "", user1, false, false); 507 | user.Replace("", ""); 508 | user.Replace("", ""); 509 | if (!xx.Contains(user)) 510 | { 511 | xx.Add(user); 512 | } 513 | // 514 | user1 = GetLine(file_users, 29); 515 | cbdefois = Regex.Matches(user1, "").Count; 516 | if (cbdefois == 2) 517 | { 518 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 519 | userB = userB.Replace("", ""); 520 | userB = userB.Replace("", ""); 521 | userB = userB.Replace("", ""); 522 | userB = userB.Replace("", ""); 523 | user1 = user1.Replace("" + userB + "", null); 524 | if (!xx.Contains(userB)) 525 | { 526 | xx.Add(userB); 527 | } 528 | } 529 | user = Helpers.GetStringInBetween("", "", user1, false, false); 530 | user.Replace("", ""); 531 | user.Replace("", ""); 532 | if (!xx.Contains(user)) 533 | { 534 | xx.Add(user); 535 | } 536 | // 537 | user1 = GetLine(file_users, 36); 538 | cbdefois = Regex.Matches(user1, "").Count; 539 | if (cbdefois == 2) 540 | { 541 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 542 | userB = userB.Replace("", ""); 543 | userB = userB.Replace("", ""); 544 | userB = userB.Replace("", ""); 545 | userB = userB.Replace("", ""); 546 | user1 = user1.Replace("" + userB + "", null); 547 | if (!xx.Contains(userB)) 548 | { 549 | xx.Add(userB); 550 | } 551 | } 552 | user = Helpers.GetStringInBetween("", "", user1, false, false); 553 | user.Replace("", ""); 554 | user.Replace("", ""); 555 | if (!xx.Contains(user)) 556 | { 557 | xx.Add(user); 558 | } 559 | // 560 | user1 = GetLine(file_users, 43); 561 | cbdefois = Regex.Matches(user1, "").Count; 562 | if (cbdefois == 2) 563 | { 564 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 565 | userB = userB.Replace("", ""); 566 | userB = userB.Replace("", ""); 567 | userB = userB.Replace("", ""); 568 | userB = userB.Replace("", ""); 569 | user1 = user1.Replace("" + userB + "", null); 570 | if (!xx.Contains(userB)) 571 | { 572 | xx.Add(userB); 573 | } 574 | } 575 | user = Helpers.GetStringInBetween("", "", user1, false, false); 576 | user.Replace("", ""); 577 | user.Replace("", ""); 578 | if (!xx.Contains(user)) 579 | { 580 | xx.Add(user); 581 | } 582 | // 583 | user1 = GetLine(file_users, 50); 584 | cbdefois = Regex.Matches(user1, "").Count; 585 | if (cbdefois == 2) 586 | { 587 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 588 | userB = userB.Replace("", ""); 589 | userB = userB.Replace("", ""); 590 | userB = userB.Replace("", ""); 591 | userB = userB.Replace("", ""); 592 | user1 = user1.Replace("" + userB + "", null); 593 | if (!xx.Contains(userB)) 594 | { 595 | xx.Add(userB); 596 | } 597 | } 598 | user = Helpers.GetStringInBetween("", "", user1, false, false); 599 | user.Replace("", ""); 600 | user.Replace("", ""); 601 | if (!xx.Contains(user)) 602 | { 603 | xx.Add(user); 604 | } 605 | // 606 | user1 = GetLine(file_users, 57); 607 | cbdefois = Regex.Matches(user1, "").Count; 608 | if (cbdefois == 2) 609 | { 610 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 611 | userB = userB.Replace("", ""); 612 | userB = userB.Replace("", ""); 613 | userB = userB.Replace("", ""); 614 | userB = userB.Replace("", ""); 615 | user1 = user1.Replace("" + userB + "", null); 616 | if (!xx.Contains(userB)) 617 | { 618 | xx.Add(userB); 619 | } 620 | } 621 | user = Helpers.GetStringInBetween("", "", user1, false, false); 622 | user.Replace("", ""); 623 | user.Replace("", ""); 624 | if (!xx.Contains(user)) 625 | { 626 | xx.Add(user); 627 | } 628 | // 629 | user1 = GetLine(file_users, 64); 630 | cbdefois = Regex.Matches(user1, "").Count; 631 | if (cbdefois == 2) 632 | { 633 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 634 | userB = userB.Replace("", ""); 635 | userB = userB.Replace("", ""); 636 | userB = userB.Replace("", ""); 637 | userB = userB.Replace("", ""); 638 | user1 = user1.Replace("" + userB + "", null); 639 | if (!xx.Contains(userB)) 640 | { 641 | xx.Add(userB); 642 | } 643 | } 644 | user = Helpers.GetStringInBetween("", "", user1, false, false); 645 | user.Replace("", ""); 646 | user.Replace("", ""); 647 | if (!xx.Contains(user)) 648 | { 649 | xx.Add(user); 650 | } 651 | // 652 | user1 = GetLine(file_users, 71); 653 | cbdefois = Regex.Matches(user1, "").Count; 654 | if (cbdefois == 2) 655 | { 656 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 657 | userB = userB.Replace("", ""); 658 | userB = userB.Replace("", ""); 659 | userB = userB.Replace("", ""); 660 | userB = userB.Replace("", ""); 661 | user1 = user1.Replace("" + userB + "", null); 662 | if (!xx.Contains(userB)) 663 | { 664 | xx.Add(userB); 665 | } 666 | } 667 | user = Helpers.GetStringInBetween("", "", user1, false, false); 668 | user.Replace("", ""); 669 | user.Replace("", ""); 670 | if (!xx.Contains(user)) 671 | { 672 | xx.Add(user); 673 | } 674 | // 675 | user1 = GetLine(file_users, 78); 676 | cbdefois = Regex.Matches(user1, "").Count; 677 | if (cbdefois == 2) 678 | { 679 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 680 | userB = userB.Replace("", ""); 681 | userB = userB.Replace("", ""); 682 | userB = userB.Replace("", ""); 683 | userB = userB.Replace("", ""); 684 | user1 = user1.Replace("" + userB + "", null); 685 | if (!xx.Contains(userB)) 686 | { 687 | xx.Add(userB); 688 | } 689 | } 690 | user = Helpers.GetStringInBetween("", "", user1, false, false); 691 | user.Replace("", ""); 692 | user.Replace("", ""); 693 | if (!xx.Contains(user)) 694 | { 695 | xx.Add(user); 696 | } 697 | // 698 | user1 = GetLine(file_users, 85); 699 | cbdefois = Regex.Matches(user1, "").Count; 700 | if (cbdefois == 2) 701 | { 702 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 703 | userB = userB.Replace("", ""); 704 | userB = userB.Replace("", ""); 705 | userB = userB.Replace("", ""); 706 | userB = userB.Replace("", ""); 707 | user1 = user1.Replace("" + userB + "", null); 708 | if (!xx.Contains(userB)) 709 | { 710 | xx.Add(userB); 711 | } 712 | } 713 | user = Helpers.GetStringInBetween("", "", user1, false, false); 714 | user.Replace("", ""); 715 | user.Replace("", ""); 716 | if (!xx.Contains(user)) 717 | { 718 | xx.Add(user); 719 | } 720 | // 721 | user1 = GetLine(file_users, 92); 722 | cbdefois = Regex.Matches(user1, "").Count; 723 | if (cbdefois == 2) 724 | { 725 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 726 | userB = userB.Replace("", ""); 727 | userB = userB.Replace("", ""); 728 | userB = userB.Replace("", ""); 729 | userB = userB.Replace("", ""); 730 | user1 = user1.Replace("" + userB + "", null); 731 | if (!xx.Contains(userB)) 732 | { 733 | xx.Add(userB); 734 | } 735 | } 736 | user = Helpers.GetStringInBetween("", "", user1, false, false); 737 | user.Replace("", ""); 738 | user.Replace("", ""); 739 | if (!xx.Contains(user)) 740 | { 741 | xx.Add(user); 742 | } 743 | // 744 | user1 = GetLine(file_users, 99); 745 | cbdefois = Regex.Matches(user1, "").Count; 746 | if (cbdefois == 2) 747 | { 748 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 749 | userB = userB.Replace("", ""); 750 | userB = userB.Replace("", ""); 751 | userB = userB.Replace("", ""); 752 | userB = userB.Replace("", ""); 753 | user1 = user1.Replace("" + userB + "", null); 754 | if (!xx.Contains(userB)) 755 | { 756 | xx.Add(userB); 757 | } 758 | } 759 | user = Helpers.GetStringInBetween("", "", user1, false, false); 760 | user.Replace("", ""); 761 | user.Replace("", ""); 762 | if (!xx.Contains(user)) 763 | { 764 | xx.Add(user); 765 | } 766 | // 767 | user1 = GetLine(file_users, 106); 768 | cbdefois = Regex.Matches(user1, "").Count; 769 | if (cbdefois == 2) 770 | { 771 | string userB = Helpers.GetStringInBetween("", "", user1, true, true); 772 | userB = userB.Replace("", ""); 773 | userB = userB.Replace("", ""); 774 | userB = userB.Replace("", ""); 775 | userB = userB.Replace("", ""); 776 | user1 = user1.Replace("" + userB + "", null); 777 | if (!xx.Contains(userB)) 778 | { 779 | xx.Add(userB); 780 | } 781 | } 782 | user = Helpers.GetStringInBetween("", "", user1, false, false); 783 | user.Replace("", ""); 784 | user.Replace("", ""); 785 | if (!xx.Contains(user)) 786 | { 787 | xx.Add(user); 788 | } 789 | return xx; 790 | } 791 | 792 | /// 793 | /// Permet de savoir si un membre poste mass de 'Merci du partage' 794 | /// 795 | /// le User ID du membre 796 | /// 797 | public static bool IsUserAMerci(string UserID) 798 | { 799 | var x = GetMemberinfo(ID2Nickname(UserID)); 800 | 801 | if (x != null) 802 | { 803 | int memberpost = Convert.ToInt32(x[1]); 804 | /* 805 | Pour 1 page on vérifie 8 merci 806 | Pour 2 pages 16 807 | etc... 808 | pour X=1 Y=8 809 | pour X=2 Y=16 810 | Rapport R {X,Y} = x/0.16 Ry = y'{x/0.16} || x/Ry =0.16 811 | */ 812 | int wordCount = 0; 813 | var pagereponses = 814 | MyWebClient.DownloadString("http://hack-free.net/search.php?action=finduser&uid=" + UserID); 815 | pagereponses = pagereponses.ToLower(); 816 | var count = Regex.Matches(pagereponses, "merci").Count; 817 | int percentComplete = (int) Math.Round((double) (100*count)/memberpost); 818 | return percentComplete >= 50; 819 | } 820 | else 821 | { 822 | return false; 823 | } 824 | } 825 | 826 | /// 827 | /// Permet de récupérer le nombre de message d'un membre 828 | /// 829 | /// Le pseudo du membre 830 | /// 831 | public static int GetUserMessageCount(string username) 832 | { 833 | var nombremessage = 0; 834 | var userid = Nickname2ID(username); 835 | var reply = MyWebClient.DownloadString("http://hack-free.net/search.php?action=finduser&uid=" + userid); 836 | //Pages (5) : 837 | var source1 = "Pages "; 838 | var source2 = " :"; 839 | var pagenumber = Helpers.GetStringInBetween(source1, source2, reply, false, false); 840 | pagenumber = pagenumber.Replace("(",""); 841 | pagenumber = pagenumber.Replace(")", ""); 842 | if (pagenumber != "") 843 | { 844 | //1 845 | //2 846 | source1 = ">1"; 847 | source2 = "class=\"pagination_page\">2"; 848 | var url = Helpers.GetStringInBetween(source1, source2, reply, false, false); 849 | url = url.Replace(""); 867 | nombremessage += xeno; 868 | } 869 | } 870 | } 871 | else 872 | { 873 | var xeno = CountStringOccurrences(reply, "width=\"2%\">"); 874 | nombremessage += xeno; 875 | } 876 | 877 | return nombremessage; 878 | } 879 | 880 | 881 | 882 | 883 | #region private method to fetch & scrape data 884 | 885 | /// 886 | /// This method returns the percentage-formatted string. 887 | /// 888 | static string GetPercentageString(double ratio) 889 | { 890 | return ratio.ToString("0.0%"); 891 | } 892 | 893 | 894 | /// 895 | /// Count occurrences of strings. 896 | /// 897 | private static int CountStringOccurrences(string text, string pattern) 898 | { 899 | // Loop through all instances of the string 'text'. 900 | int count = 0; 901 | int i = 0; 902 | while ((i = text.IndexOf(pattern, i)) != -1) 903 | { 904 | i += pattern.Length; 905 | count++; 906 | } 907 | return count; 908 | } 909 | 910 | /// 911 | /// Permet de récupérer une ertaine ligne d'un fichier texte 912 | /// 913 | /// Le fichier source 914 | /// La ligne 915 | /// 916 | private static string GetLine(string fileName, int line) 917 | { 918 | using (var sr = new StreamReader(fileName)) 919 | { 920 | for (var i = 1; i < line; i++) 921 | sr.ReadLine(); 922 | return sr.ReadLine(); 923 | } 924 | } 925 | 926 | /// 927 | /// Grosse methode bien trash-code qui sert de fourre-tout 928 | /// 929 | private static void GetData() 930 | { 931 | GetUserID(); 932 | GetUserPanel(); 933 | GetPostKey(Forum); 934 | Getpostcount(); 935 | GetMemberReferedcount(); 936 | GetRatio(); 937 | GetUsernameChange(); 938 | GetMerci(); 939 | GetCredit(); 940 | GetAvatarUrl(); 941 | GetReportedMessage(); 942 | GetGroupe(); 943 | GetReputation(); 944 | GetInscriptionDate(); 945 | GetAverto(); 946 | } 947 | 948 | private static int GetUserID() 949 | { 950 | try 951 | { 952 | var rep = 0; 953 | var cpanel = MyWebClient.DownloadString("http://hack-free.net/usercp.php"); 954 | Userpanel = cpanel; 955 | var entries = 956 | Helpers.GetStringInBetween("Mes Vouches", cpanel, false, 958 | false); 959 | if (entries != "") 960 | { 961 | //"84\"" 962 | entries = entries.Trim('"'); 963 | entries = entries.Replace(@"\", ""); 964 | } 965 | else 966 | { 967 | throw new Exception("Error : Cannot fetch userID value !"); 968 | } 969 | UserID = int.Parse(entries); 970 | return UserID; 971 | } 972 | catch (Exception) 973 | { 974 | 975 | throw new Exception("Error : Cannot fetch referenced members count !"); 976 | } 977 | } 978 | 979 | private static string GetUserPanel() 980 | { 981 | try 982 | { 983 | var pagemember = MyWebClient.DownloadString("http://hack-free.net/User-" + UserID); 984 | Userpanel = pagemember; 985 | return pagemember; 986 | } 987 | catch (Exception) 988 | { 989 | 990 | throw new Exception("Error : Cannot fetch user panel !"); 991 | } 992 | } 993 | 994 | private static string GetPostKey(string source) 995 | { 996 | //var my_post_key = " "; var imagepath = "images"; 997 | var Postkeyz = Helpers.GetStringInBetween("var my_post_key = ", "; var imagepath = \"images\";", source, false, 998 | false); 999 | Postkeyz = Postkeyz.Replace("\"", null); 1000 | PostKey = Postkeyz; 1001 | return Postkeyz; 1002 | } 1003 | 1004 | private static int Getpostcount() 1005 | { 1006 | 1007 | try 1008 | { 1009 | var postcount = 0; 1010 | var pagemember = Userpanel; 1011 | //Total Posts: 230 1012 | var entries2 = Helpers.GetStringInBetween("Total Posts: ", " ", 1013 | pagemember, false, false); 1014 | 1015 | postcount = int.Parse(entries2); 1016 | PostCount = postcount; 1017 | return postcount; 1018 | } 1019 | catch (Exception) 1020 | { 1021 | 1022 | throw new Exception("Error : Cannot fetch post count !"); 1023 | } 1024 | } 1025 | 1026 | private static int GetMemberReferedcount() 1027 | { 1028 | 1029 | try 1030 | { 1031 | var refmember = 0; 1032 | var pagemember = Userpanel; 1033 | //Members Referred: 0 1034 | // 1035 | var entries2 = Helpers.GetStringInBetween("Members Referred: ", "", 1036 | pagemember, false, false); 1037 | //"0\n" 1038 | entries2 = entries2.Trim('\n'); 1039 | entries2 = entries2.Replace(@"\n", ""); 1040 | refmember = int.Parse(entries2); 1041 | ReferencedMembers = refmember; 1042 | return refmember; 1043 | } 1044 | catch (Exception) 1045 | { 1046 | 1047 | throw new Exception("Error : Cannot fetch referenced members count !"); 1048 | } 1049 | } 1050 | 1051 | private static string GetRatio() 1052 | { 1053 | try 1054 | { 1055 | var rat = ""; 1056 | var pagemember = Userpanel; 1057 | //Ratio:0,750 1058 | var entries2 = Helpers.GetStringInBetween("Ratio:", "", 1059 | pagemember, false, false); 1060 | entries2 = entries2.Trim('\n'); 1061 | if (entries2.Contains("green")) 1062 | { 1063 | //0,750 1064 | entries2 = entries2.Replace("", ""); 1065 | entries2 = entries2.Replace("", ""); 1066 | rat = entries2; 1067 | Ratio = rat; 1068 | return rat; 1069 | } 1070 | else if (entries2.Contains("red")) 1071 | { 1072 | //0,750 1073 | entries2 = entries2.Replace("", ""); 1074 | entries2 = entries2.Replace("", ""); 1075 | rat = entries2; 1076 | Ratio = rat; 1077 | return rat; 1078 | } 1079 | else if(entries2.Contains("Infini")) 1080 | { 1081 | rat = "Infini"; 1082 | Ratio = rat; 1083 | return rat; 1084 | } 1085 | 1086 | } 1087 | catch (Exception) 1088 | { 1089 | 1090 | throw new Exception("Error : Cannot fetch ratio count !"); 1091 | } 1092 | return null; 1093 | } 1094 | 1095 | private static string GetUsernameChange() 1096 | { 1097 | 1098 | try 1099 | { 1100 | var usernamechng = ""; 1101 | var pagemember = Userpanel; 1102 | //Username Changes: 2 1103 | var src1 = "username_history&uhuid=" + UserID; 1104 | var src2 = ""; 1105 | var entries2 = Helpers.GetStringInBetween(src1, src2, 1106 | pagemember, false, false); 1107 | //"\">2" 1108 | entries2 = entries2.Trim('"'); 1109 | entries2 = entries2.Replace(@"\", ""); 1110 | entries2 = entries2.Replace(">", ""); 1111 | usernamechng = entries2; 1112 | UsernameChange = usernamechng; 1113 | return usernamechng; 1114 | 1115 | } 1116 | catch (Exception) 1117 | { 1118 | 1119 | throw new Exception("Error : Cannot fetch former username count !"); 1120 | } 1121 | } 1122 | 1123 | private static string GetMerci() 1124 | { 1125 | 1126 | try 1127 | { 1128 | var thanks = ""; 1129 | var pagemember = Userpanel; 1130 | //
Merci Reçu: 146
1131 | var src1 = "Merci Reçu: "; 1132 | var src2 = " "; 1133 | var entries2 = Helpers.GetStringInBetween(src1, src2, 1134 | pagemember, false, false); 1135 | //"\">2" 1136 | entries2 = entries2.Trim('"'); 1137 | entries2 = entries2.Replace(@"\", ""); 1138 | entries2 = entries2.Replace(">", ""); 1139 | thanks = entries2; 1140 | Merci = thanks; 1141 | return thanks; 1142 | 1143 | } 1144 | catch (Exception) 1145 | { 1146 | 1147 | throw new Exception("Error : Cannot fetch 'Merci' count !"); 1148 | } 1149 | } 1150 | 1151 | private static string GetCredit() 1152 | { 1153 | 1154 | try 1155 | { 1156 | var cred = ""; 1157 | var pagemember = Userpanel; 1158 | //1,383 [Donation] 1159 | var src1 = "[1,383 1164 | entries2 = entries2.Trim('"'); 1165 | entries2 = entries2.Replace("http://hack-free.net/newpoints.php", ""); 1166 | //\">1,383 1167 | entries2 = entries2.Replace(">", ""); 1168 | entries2 = entries2.Trim('"'); 1169 | cred = entries2; 1170 | Credit = cred; 1171 | return cred; 1172 | 1173 | } 1174 | catch (Exception) 1175 | { 1176 | 1177 | throw new Exception("Error : Cannot fetch credit count !"); 1178 | } 1179 | } 1180 | 1181 | private static string GetAvatarUrl() 1182 | { 1183 | 1184 | try 1185 | { 1186 | var avatar = ""; 1187 | var pagemember = Userpanel; 1188 | //
1189 | var src1 = "
1219 | var src1 = "action=reports&uid=" + UserID; 1220 | var src2 = ""; 1221 | var entries2 = Helpers.GetStringInBetween(src1, src2, 1222 | pagemember, false, false); 1223 | //\">811 1224 | entries2 = entries2.Trim('"'); 1225 | entries2 = entries2.Replace(">", ""); 1226 | entries2 = entries2.Trim('"'); 1227 | report = entries2; 1228 | ReportedMessage = report; 1229 | return report; 1230 | 1231 | } 1232 | catch (Exception) 1233 | { 1234 | 1235 | throw new Exception("Error : Cannot fetch reported messages count !"); 1236 | } 1237 | } 1238 | 1239 | private static string GetGroupe() 1240 | { 1241 | 1242 | try 1243 | { 1244 | var groupe = ""; 1245 | var pagemember = Userpanel; 1246 | //
1247 | //Journalistes
1248 | var src1 = "
"; 1249 | var src2 = "
"; 1250 | var entries2 = Helpers.GetStringInBetween(src1, src2, 1251 | pagemember, false, false); 1252 | entries2 = entries2.Trim('"'); 1253 | var entries3 = Helpers.GetStringInBetween("title=", "/>", 1254 | entries2, false, false); 1255 | entries3 = entries3.Replace(">", ""); 1256 | entries3 = entries3.Replace(@"\", ""); 1257 | entries3 = entries3.Trim('"'); 1258 | groupe = entries3; 1259 | Groupe = groupe; 1260 | return groupe; 1261 | 1262 | } 1263 | catch (Exception) 1264 | { 1265 | 1266 | throw new Exception("Error : Cannot fetch main group !"); 1267 | } 1268 | } 1269 | 1270 | private static string GetAverto() 1271 | { 1272 | 1273 | try 1274 | { 1275 | var averto = ""; 1276 | var pagemember = Userpanel; 1277 | //Niveau d'avertissement : 1278 | // 0% 1279 | var src1 = " "; 1280 | var src2 = " "; 1281 | var entries2 = Helpers.GetStringInBetween(src1, src2, 1282 | pagemember, false, false); 1283 | entries2 = entries2.Trim('"'); 1284 | averto = entries2; 1285 | Avertissement = averto; 1286 | return averto; 1287 | 1288 | } 1289 | catch (Exception) 1290 | { 1291 | 1292 | throw new Exception("Error : Cannot fetch avertissement !"); 1293 | } 1294 | } 1295 | 1296 | private static string GetReputation() 1297 | { 1298 | 1299 | try 1300 | { 1301 | var rep = ""; 1302 | var pagemember = Userpanel; 1303 | //4 1304 | var entries2 = Helpers.GetStringInBetween("", "", 1305 | pagemember, false, false); 1306 | //4 1307 | rep = entries2; 1308 | Reputation = rep; 1309 | return rep; 1310 | } 1311 | catch (Exception) 1312 | { 1313 | 1314 | throw new Exception("Error : Cannot fetch reputation !"); 1315 | } 1316 | } 1317 | 1318 | private static string GetInscriptionDate() 1319 | { 1320 | 1321 | try 1322 | { 1323 | var date = ""; 1324 | var pagemember = Userpanel; 1325 | //Date d'inscription: 22-05-2015 1326 | var entries2 = Helpers.GetStringInBetween("inscription: ", "", 1327 | pagemember, false, false); 1328 | // 1329 | date = entries2; 1330 | InscriptionDate = date; 1331 | return date; 1332 | } 1333 | catch (Exception) 1334 | { 1335 | 1336 | throw new Exception("Error : Cannot fetch inscription date !"); 1337 | } 1338 | } 1339 | 1340 | #endregion 1341 | } 1342 | } 1343 | --------------------------------------------------------------------------------