Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
sa68ru committed Jul 5, 2018
1 parent 33881e7 commit c4c92df
Show file tree
Hide file tree
Showing 55 changed files with 3,527 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Steam-Achievement-Abuser
Getting all achievements in your games
Steam-Achievement-Abuser
Based on: https://github.com/gibbed/SteamAchievementManager

How to use:
1. Download latest release https://github.com/sa68ru/Steam-Achievement-Abuser/releases
2. Unpack in some folder
3. Start Steam
4. Start Steam Achievement Abuser.exe
Done!
Binary file not shown.
Binary file added src/.vs/Steam Achievement Abuser/v15/.suo
Binary file not shown.
59 changes: 59 additions & 0 deletions src/SAM.API/Callback.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/

using System;
using System.Runtime.InteropServices;

namespace SAM.API
{
public abstract class Callback : ICallback
{
public delegate void CallbackFunction(IntPtr param);

public event CallbackFunction OnRun;

public abstract int Id { get; }
public abstract bool IsServer { get; }

public void Run(IntPtr param)
{
this.OnRun(param);
}
}

public abstract class Callback<TParameter> : ICallback
where TParameter : struct
{
public delegate void CallbackFunction(TParameter arg);

public event CallbackFunction OnRun;

public abstract int Id { get; }
public abstract bool IsServer { get; }

public void Run(IntPtr pvParam)
{
var data = (TParameter)Marshal.PtrToStructure(pvParam, typeof(TParameter));
this.OnRun(data);
}
}
}
37 changes: 37 additions & 0 deletions src/SAM.API/Callbacks/AppDataChanged.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/

namespace SAM.API.Callbacks
{
public class AppDataChanged : Callback<Types.AppDataChanged>
{
public override int Id
{
get { return 1001; }
}

public override bool IsServer
{
get { return false; }
}
}
}
37 changes: 37 additions & 0 deletions src/SAM.API/Callbacks/UserStatsReceived.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/

namespace SAM.API.Callbacks
{
public class UserStatsReceived : Callback<Types.UserStatsReceived>
{
public override int Id
{
get { return 1101; }
}

public override bool IsServer
{
get { return false; }
}
}
}
140 changes: 140 additions & 0 deletions src/SAM.API/Client.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace SAM.API
{
public class Client
{
public Wrappers.SteamClient009 SteamClient;
public Wrappers.SteamUser012 SteamUser;
public Wrappers.SteamUserStats007 SteamUserStats;
public Wrappers.SteamUtils005 SteamUtils;
public Wrappers.SteamApps001 SteamApps001;
public Wrappers.SteamApps003 SteamApps003;

private int _Pipe;
private int _User;

private readonly List<ICallback> _Callbacks = new List<ICallback>();

public bool Initialize(long appId)
{
if (appId != 0)
{
Environment.SetEnvironmentVariable("SteamAppId", appId.ToString(CultureInfo.InvariantCulture));
}

if (Steam.GetInstallPath() == null)
{
return false;
}

if (Steam.Load() == false)
{
return false;
}

this.SteamClient = Steam.CreateInterface<Wrappers.SteamClient009>("SteamClient009");
if (this.SteamClient == null)
{
return false;
}

this._Pipe = this.SteamClient.CreateSteamPipe();
if (this._Pipe == 0)
{
return false;
}

this._User = this.SteamClient.ConnectToGlobalUser(this._Pipe);
if (this._User == 0)
{
return false;
}

this.SteamUtils = this.SteamClient.GetSteamUtils004(this._Pipe);
if (appId > 0 && this.SteamUtils.GetAppId() != (uint)appId)
{
return false;
}

this.SteamUser = this.SteamClient.GetSteamUser012(this._User, this._Pipe);
this.SteamUserStats = this.SteamClient.GetSteamUserStats006(this._User, this._Pipe);
this.SteamApps001 = this.SteamClient.GetSteamApps001(this._User, this._Pipe);
this.SteamApps003 = this.SteamClient.GetSteamApps003(this._User, this._Pipe);
return true;
}

~Client()
{
if (this.SteamClient != null)
{
this.SteamClient.ReleaseUser(this._Pipe, this._User);
this._User = 0;
this.SteamClient.ReleaseSteamPipe(this._Pipe);
this._Pipe = 0;
}
}

public TCallback CreateAndRegisterCallback<TCallback>()
where TCallback : ICallback, new()
{
var callback = new TCallback();
this._Callbacks.Add(callback);
return callback;
}

private bool _RunningCallbacks;

public void RunCallbacks(bool server)
{
if (this._RunningCallbacks == true)
{
return;
}

this._RunningCallbacks = true;

Types.CallbackMessage message;
int call;
while (Steam.GetCallback(this._Pipe, out message, out call) == true)
{
var callbackId = message.Id;
foreach (ICallback callback in this._Callbacks.Where(
candidate => candidate.Id == callbackId &&
candidate.IsServer == server))
{
callback.Run(message.ParamPointer);
}

Steam.FreeLastCallback(this._Pipe);
}

this._RunningCallbacks = false;
}
}
}
33 changes: 33 additions & 0 deletions src/SAM.API/ICallback.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/

using System;

namespace SAM.API
{
public interface ICallback
{
int Id { get; }
bool IsServer { get; }
void Run(IntPtr param);
}
}
31 changes: 31 additions & 0 deletions src/SAM.API/INativeWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/

using System;

namespace SAM.API
{
public interface INativeWrapper
{
void SetupFunctions(IntPtr objectAddress);
}
}
33 changes: 33 additions & 0 deletions src/SAM.API/Interfaces/ISteamApps001.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/

using System;
using System.Runtime.InteropServices;

namespace SAM.API.Interfaces
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ISteamApps001
{
public IntPtr GetAppData;
}
}
Loading

0 comments on commit c4c92df

Please sign in to comment.