Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
JAX20 committed Aug 28, 2018
1 parent a90a166 commit 379801a
Show file tree
Hide file tree
Showing 70 changed files with 946 additions and 0 deletions.
Binary file added .vs/Cheat Preguntados/v14/.suo
Binary file not shown.
28 changes: 28 additions & 0 deletions Cheat Preguntados.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cheat Preguntados", "Cheat Preguntados\Cheat Preguntados.csproj", "{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Debug|x86.ActiveCfg = Debug|x86
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Debug|x86.Build.0 = Debug|x86
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Release|Any CPU.Build.0 = Release|Any CPU
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Release|x86.ActiveCfg = Release|x86
{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Cheat Preguntados/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
138 changes: 138 additions & 0 deletions Cheat Preguntados/Cheat Preguntados.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2304E068-E602-4AE9-8AC4-DFCCEB35D03C}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Cheat_Preguntados</RootNamespace>
<AssemblyName>Cheat Preguntados</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publicar\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Cheat_Preguntados.Core</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Colorful.Console, Version=1.2.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Colorful.Console.1.2.9\lib\net452\Colorful.Console.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FiddlerCore4">
<HintPath>..\..\..\..\..\Desktop\Nueva carpeta\FiddlerCore4.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\..\..\Desktop\Nueva carpeta\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsoleOutput.cs" />
<Compile Include="FiddlerCore\Certificate.cs" />
<Compile Include="FiddlerCore\HandlerFiddlerCore.cs" />
<Compile Include="Core.cs" />
<Compile Include="Game\GameInformation.cs" />
<Compile Include="Game\OpponentProfile.cs" />
<Compile Include="Game\OwnerProfile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Variables.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="FiddlerCore4.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Newtonsoft.Json.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.1 %28x86 y x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
13 changes: 13 additions & 0 deletions Cheat Preguntados/Cheat Preguntados.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publicar\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>es-ES</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
96 changes: 96 additions & 0 deletions Cheat Preguntados/ConsoleOutput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using Console = Colorful.Console;

namespace Cheat_Preguntados
{
public class ConsoleOutput : Core
{
public void ConsoleWelcome()
{
Console.Title = "Cheat for Preguntados - apps.facebook.com/triviacrack";
Console.SetWindowSize(_variables.ConsoleWindowWidth, _variables.ConsoleWindowHeight);
/*if (_ownerProfile != null)
WriteLine($"Bienvenido/a {_ownerProfile.username }", "", ConsoleColor.White);*/
//System.Console.SetWindowSize(89, 30);
List<string> Lines = new List<string>();
Lines.Add("");
Lines.Add(@" _____ _ _ _____ _ _ ");
Lines.Add(@" / ____| | | | | __ \ | | | | ");
Lines.Add(@" | | | |__ ___ __ _| |_| |__) _ __ ___ __ _ _ _ _ __ | |_ __ _ __| | ___ ___ ");
Lines.Add(@" | | | _ \ / _ \/ _ | __| ___| __/ _ \/ _ | | | | _ \| __/ _ |/ _ |/ _ \/ __|");
Lines.Add(@" | |____| | | | __| (_| | |_| | | | | __| (_| | |_| | | | | || (_| | (_| | (_) \__ \");
Lines.Add(@" \_____|_| |_|\___|\____|\__|_| |_| \___|\___ |\____|_| |_|\__\____|\____|\___/|___/");
Lines.Add(@" __/ | ");
Lines.Add(@" |___/ ");
foreach (string Line in Lines)
{
int Spacing = Console.WindowWidth - Line.Length - 1;
string Ln = Line;

for (int s = 0; s < Spacing; s++)
Ln += ' ';
WriteLine(Ln, "", Color.White);
}
Color colorCustom = (Color)new ColorConverter().ConvertFromString("#1D97C");
Write("\n\tAutor JAX", "", colorCustom);
Write(" | ", "", Color.White);
Write($"Versión de desarrollo {_variables.VersionApplication} ", "", colorCustom); Console.Write(Convert.ToString(_variables.VersionBeta ? "Beta" : ""), Color.Red);
Write(" | ", "", Color.White);
Write("github.com/JAX20/", "", colorCustom);
Console.WriteLine("\n");
}

public void ShowDetailsOwner()
{
WriteLine(((Equals(_ownerProfile.userProfile.gender, "male") ? "Bienvenido " : "Bienvenida ") + _ownerProfile.facebookProfile.name), "Cheat", Color.White);
//WriteLine("Cantidad de monedas: " + _ownerProfile.userProfile.coins);
WriteLine("");
}

public void ShowInformationGame()
{
int correct_answer = _gameInformation.spins_data.spins[0].questions[0].question.correct_answer;
for (int n = 1; n <= _variables.ConsoleWindowWidth; n++)
{
Write("-", "", Color.White, Color.Black);
}
WriteLine("");
WriteLine("█ Información de la partida - " + DateTime.Now, "", Color.Gold);
WriteLine(" Categoría: " + _gameInformation.spins_data.spins[0].questions[0].question.category, "", Color.Cyan);
WriteLine(" Pregunta: " + _gameInformation.spins_data.spins[0].questions[0].question.text, "", Color.Cyan);
WriteLine(" Respuestas: " + string.Join(", ", _gameInformation.spins_data.spins[0].questions[0].question.answers), "", Color.Cyan);
Write(" Respuesta correcta: ", "", Color.Cyan);
WriteLine(_gameInformation.spins_data.spins[0].questions[0].question.answers[correct_answer], "", Color.GreenYellow);
}

public void Write(string body, string head = "", Color? foregroundColor = null, Color? backgroundColor = null)
{
Console.ForegroundColor = foregroundColor ?? _variables.DefaultForegroundColor;
Console.BackgroundColor = backgroundColor ?? _variables.DefaultBackgroundColor;

if (head != string.Empty)
Console.Write($"[{head}] ");
Console.Write($"{body}");
}
public void WriteLine(string body, string head = "", Color? foregroundColor = null, Color? backgroundColor = null)
{
Console.ForegroundColor = foregroundColor ?? _variables.DefaultForegroundColor;
Console.BackgroundColor = backgroundColor ?? _variables.DefaultBackgroundColor;

if (head != string.Empty)
Console.Write($"[{head}] ");
Console.WriteLine($"{body}");
}

public void WriteError(string error)
{
WriteLine(error, "Error", Color.Red);
}
public void WriteError(Exception error)
{
WriteLine("Information error: " + error.Message + Environment.NewLine + error.StackTrace, "Error", Color.Red);
}
}
}
59 changes: 59 additions & 0 deletions Cheat Preguntados/Core.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Cheat_Preguntados.FiddlerCore;
using Cheat_Preguntados.Game;
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using Console = Colorful.Console;

namespace Cheat_Preguntados
{
public class Core
{
/*
* Create instances of the class to use later
*/
public static OwnerProfile _ownerProfile = new OwnerProfile();
public static GameInformation _gameInformation;
public static Variables _variables = new Variables();
public static HandlerFiddlerCore _handlerFiddlerCore = new HandlerFiddlerCore();
public static ConsoleOutput _consoleOutput = new ConsoleOutput();

static void Main(string[] args)
{
try
{
handler = new ConsoleEventDelegate(ConsoleEventCallback); //Instance for the method ConsoleEventCallback
SetConsoleCtrlHandler(handler, true); // Call to the API SetConsoleCtrlHandler
_consoleOutput.ConsoleWelcome();
new OwnerProfile(); // Create the instances that are in the constructor
new OpponentProfile(); // Create the instances that are in the constructor
_handlerFiddlerCore.Start();
_consoleOutput.WriteLine("Inicie ahora sesión en FaceBook si aún no lo hizo y luego entre en alguna partida que sea modo Clásico. \nEsperando...", "Cheat");
_variables.ImStarted = true;
_consoleOutput.WriteLine("");
while (true) { System.Threading.Thread.Sleep(500); } // Prevent the application from closing
}
catch (Exception e)
{
_consoleOutput.WriteError(e);
_handlerFiddlerCore.Stop();
Certificate.Uninstall();
_consoleOutput.WriteLine("\n\nThe application will close after pressing a key");
Console.ReadKey();
}
}

#region Console Application Exit
static ConsoleEventDelegate handler;
private delegate bool ConsoleEventDelegate(int eventType);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern void SetConsoleCtrlHandler(ConsoleEventDelegate callback, bool add); // SetConsoleCtrlHandler is a function from kernel32.dll
static bool ConsoleEventCallback(int eventType)
{
if (eventType == 2) // Close windows console
_handlerFiddlerCore.Stop();
return false;
}
#endregion
}
}
39 changes: 39 additions & 0 deletions Cheat Preguntados/FiddlerCore/Certificate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Fiddler;
using System;

namespace Cheat_Preguntados.FiddlerCore
{
class Certificate
{
public static void Install()
{
/*
* Find and create certificates for use in HTTPS interception
*/

// Determine if the self signed root certificate exists
if (!CertMaker.rootCertExists())
{
// Create a self signed root certificate to use as the trust anchor for HTTPS interception certificate chains
if (!CertMaker.createRootCert())
throw new Exception("Unable to create certificate for FiddlerCore.");

// Prompts the user to add it to the trusted store.
if (!CertMaker.trustRootCert())
throw new Exception("Unable to create certificate for FiddlerCore.");
}
}

public static bool Uninstall()
{
// Determine if the self signed root certificate exists
if (CertMaker.rootCertExists())
{
// Removes Fiddler generated certificates. Parameter True for remove root
if (!CertMaker.removeFiddlerGeneratedCerts(true))
return false;
}
return true;
}
}
}
Loading

0 comments on commit 379801a

Please sign in to comment.