Skip to content

Commit

Permalink
2022-09-21 修复加入羊群
Browse files Browse the repository at this point in the history
  • Loading branch information
SwaggyMacro committed Sep 21, 2022
1 parent 989c53d commit 2f900af
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# YangLeGeYang
羊了个羊辅助

羊了个羊辅助
**2022-09-21 修复加入羊群**
## 🏷️前言
---
本项目可一键通关羊了个羊,请勿滥用本程序持续对游戏服务器造成压力,仅用于学习研究使用,一切后果自负。
Expand Down
4 changes: 4 additions & 0 deletions SheepSheep/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura />
</Weavers>
77 changes: 77 additions & 0 deletions SheepSheep/LoadResoureDll.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SheepSheep
{
public static class LoadResoureDll
{
private static Dictionary<string, Assembly> LoadedDlls = new Dictionary<string, Assembly>();
private static Dictionary<string, object> Assemblies = new Dictionary<string, object>();
private static Assembly AssemblyResolve(object sender, ResolveEventArgs args)
{
try
{
Assembly ass;
var assName = new AssemblyName(args.Name).FullName;
if (LoadedDlls.TryGetValue(assName, out ass) && ass != null)
{
LoadedDlls[assName] = null;
return ass;
}
else
{
return ass;
throw new DllNotFoundException(assName);
}
}
catch (System.Exception ex)
{
MessageBox.Show("error1:\n位置:AssemblyResolve()!\n描述:" + ex.Message);
return null;
}
}

public static void RegistDLL(string pattern = "*.dll")
{
System.IO.Directory.GetFiles("", "");
var ass = new StackTrace(0).GetFrame(1).GetMethod().Module.Assembly;
if (Assemblies.ContainsKey(ass.FullName))
{
return;
}
Assemblies.Add(ass.FullName, null);
AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolve;
var res = ass.GetManifestResourceNames();
var regex = new Regex("^" + pattern.Replace(".", "\\.").Replace("*", ".*").Replace("_", ".") + "$", RegexOptions.IgnoreCase);
foreach (var r in res)
{
if (regex.IsMatch(r))
{
try
{
var s = ass.GetManifestResourceStream(r);
var bts = new byte[s.Length];
s.Read(bts, 0, (int)s.Length);
var da = Assembly.Load(bts);
if (LoadedDlls.ContainsKey(da.FullName))
{
continue;
}
LoadedDlls[da.FullName] = da;
}
catch (Exception ex)
{
MessageBox.Show("error2:加载dll失败\n位置:RegistDLL()!\n描述:" + ex.Message);
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions SheepSheep/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;

Expand All @@ -15,6 +16,7 @@ static class Program
[STAThread]
static void Main()
{
LoadResoureDll.RegistDLL();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Expand Down
Binary file added SheepSheep/Resources/Newtonsoft.Json.dll
Binary file not shown.
Binary file added SheepSheep/Resources/System.Buffers.dll
Binary file not shown.
Binary file added SheepSheep/Resources/System.Memory.dll
Binary file not shown.
Binary file added SheepSheep/Resources/System.Numerics.Vectors.dll
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions SheepSheep/SheepSheep.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -37,21 +39,26 @@
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand Down Expand Up @@ -79,6 +86,7 @@
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="InputDialog.cs" />
<Compile Include="Internal\IPacker.cs" />
<Compile Include="LoadResoureDll.cs" />
<Compile Include="Packer.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down Expand Up @@ -116,5 +124,12 @@
<ItemGroup>
<None Include="Resources\icons8-github-24.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Newtonsoft.Json.dll" />
<EmbeddedResource Include="Resources\System.Buffers.dll" />
<EmbeddedResource Include="Resources\System.Memory.dll" />
<EmbeddedResource Include="Resources\System.Numerics.Vectors.dll" />
<EmbeddedResource Include="Resources\System.Runtime.CompilerServices.Unsafe.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

4 comments on commit 2f900af

@wangyu-88
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

跟哪里下载?

@SwaggyMacro
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangyu-88
Copy link

@wangyu-88 wangyu-88 commented on 2f900af Sep 21, 2022 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SwaggyMacro
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有可以用uid抓token的吗老哥 难捱 @.***  

------------------ 原始邮件 ------------------ 发件人: "SwaggyMacro/YangLeGeYang" @.>; 发送时间: 2022年9月21日(星期三) 下午4:28 @.>; @.@.>; 主题: Re: [SwaggyMacro/YangLeGeYang] 2022-09-21 修复加入羊群 (2f900af) 去最新的release。 https://github.com/SwaggyMacro/YangLeGeYang/releases/download/0.6/SheepSheep.exe — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

uid取token的接口貌似已经被官方和谐了吧。
使用本项目的助手一样的是免抓包的,只要电脑登微信打开羊了个羊即可。
另外有问题请发起issue喔,https://github.com/SwaggyMacro/YangLeGeYang/issues

Please sign in to comment.