通达信trade.dll自动生成绑定账号dll的工具源代码
-
相关简介:通达信trade.dll自动生成绑定账号dll的工具源代码 代码: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; namespace ConsoleOddCreator { class Program { static void Main() { UInt16
-
文章来源:股海网作者:股海网发布时间:2017-02-01浏览次数:
通达信trade.dll自动生成绑定账号dll的工具源代码
代码:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace ConsoleOddCreator
{
class Program
{
static void Main()
{
UInt16 a3 = 0x55E;
string gpdm = "";
Console.Write("请输入账号:");
string account = Console.ReadLine().Trim();
Console.WriteLine("帐号的奇数位为:");
for(int i= 0; i < account.Length; i+=2) gpdm+=(account[i]);
Console.WriteLine(gpdm);
string result = "";
for (int i = 0; i < gpdm.Length; i++)
{
bool next = true;
int a = gpdm[i];
int b = a3 >> 0x8;
int c = a ^ b;
a3 = (UInt16)(0x207F * (a3 + c) - 0x523D);
for (int j = 65; j < 91 && next; j++)
{
for (int k = 90; k >= 65 && next; k--)
{
int temp = (1755 + c - k);
if (temp % 26 == 0 && temp / 26 == j)
{
result += (Char)j + "" + (Char)k;
next = false;
}
}
}
}
Console.WriteLine("生成的密文为:\n");
Console.WriteLine(result);
Console.WriteLine("正在绑定dll...");
FileStreamReadFile("trade_raw.dll", "trade_" + account.Trim() + ".dll", result);
Console.WriteLine("绑定成功!");
Console.Read();
}
///
/// FileStream读取文件
///
///
///
public static void FileStreamReadFile(string rawFile,string newFileName,string code)
{
var rawBytes = File.ReadAllBytes(rawFile);
byte[] bCode = Encoding.Default.GetBytes(code);
for(int i=0;i<bcode.length;i++)
{
rawBytes[1132713 + i] = bCode[i];
}
File.WriteAllBytes(newFileName, rawBytes);
}
}
}
</bcode.length;i++)
为了不会使用WINHEX小伙伴们的方便,特分享自动修改二进制文件并生成新dll的小工具,附源代码。
http://www.guhai.com.cn/html/FX/tong-da-xin/105810.html
由于等级太低,不能分享exe,请大家自己动手啦