-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
989c53d
commit 2f900af
Showing
10 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2f900af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
跟哪里下载?
2f900af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去最新的release。
https://github.com/SwaggyMacro/YangLeGeYang/releases/download/0.6/SheepSheep.exe
2f900af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2f900af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uid取token的接口貌似已经被官方和谐了吧。
使用本项目的助手一样的是免抓包的,只要电脑登微信打开羊了个羊即可。
另外有问题请发起issue喔,https://github.com/SwaggyMacro/YangLeGeYang/issues