Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3da9a923b4 | ||
|
|
f07d93c461 | ||
|
|
6653bcd035 | ||
|
|
85f77c468e | ||
|
|
f16e0b020b | ||
|
|
00b6596237 | ||
|
|
3dfb81b990 | ||
|
|
f3d73d2507 | ||
|
|
b276815960 | ||
|
|
c507e68080 | ||
|
|
cc63fe94a6 | ||
|
|
ddfec75201 | ||
|
|
e174f6d00a | ||
|
|
ce393253a8 | ||
|
|
cf7d75625d | ||
|
|
cca9e0626d | ||
|
|
f02a1164cf | ||
|
|
a49f9ec9de | ||
|
|
eaacb554ac | ||
|
|
eb4d4fa3fa | ||
|
|
9bf5d1c7d3 | ||
|
|
07f58afd98 | ||
|
|
375f17fe49 | ||
|
|
985505b2e7 | ||
|
|
9ad5f6b311 | ||
|
|
6c7614dcac | ||
|
|
3957f2462e | ||
|
|
74ad9297c2 | ||
|
|
ffbc855a0f | ||
|
|
50c3b22c74 | ||
|
|
d1a0f3897f | ||
|
|
4b5554cbe1 | ||
|
|
585e6683cd | ||
|
|
e83d3869cc | ||
|
|
191849e9c2 | ||
|
|
d4aa12cf07 | ||
|
|
85b0b1db52 | ||
|
|
8305a58c39 |
@@ -1,25 +0,0 @@
|
||||
<Window x:Class="WechatBakTool.Dialog.MsgDatetimePicker"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WechatBakTool.Dialog"
|
||||
xmlns:local2="clr-namespace:WechatBakTool.ViewModel"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d"
|
||||
Title="选择导出日期" Height="350" Width="330">
|
||||
<Window.Resources>
|
||||
<local2:DateTypeConverter x:Key="dateTypeConverter" />
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<RadioButton GroupName="Date" Content="全部" HorizontalAlignment="Left" Margin="45,60,0,0" VerticalAlignment="Top" IsChecked="{Binding DateType, Converter={StaticResource ResourceKey=dateTypeConverter}, ConverterParameter=1}"/>
|
||||
<RadioButton GroupName="Date" Content="昨天" HorizontalAlignment="Left" Margin="45,90,0,0" VerticalAlignment="Top" IsChecked="{Binding DateType, Converter={StaticResource ResourceKey=dateTypeConverter}, ConverterParameter=2}"/>
|
||||
<RadioButton GroupName="Date" Content="指定日期" HorizontalAlignment="Left" Margin="45,120,0,0" VerticalAlignment="Top" IsChecked="{Binding DateType, Converter={StaticResource ResourceKey=dateTypeConverter}, ConverterParameter=3}"/>
|
||||
<DatePicker HorizontalAlignment="Left" Margin="45,140,0,0" VerticalAlignment="Top" SelectedDate="{Binding PickDate}"/>
|
||||
<RadioButton GroupName="Date" Content="指定范围日期" HorizontalAlignment="Left" Margin="45,180,0,0" VerticalAlignment="Top" IsChecked="{Binding DateType, Converter={StaticResource ResourceKey=dateTypeConverter}, ConverterParameter=4}"/>
|
||||
<DatePicker Margin="45,200,0,0" VerticalAlignment="Top" SelectedDate="{Binding StartDate}" HorizontalAlignment="Left" Width="100"/>
|
||||
<DatePicker Margin="185,200,0,0" VerticalAlignment="Top" SelectedDate="{Binding EndDate}" HorizontalAlignment="Left" Width="100"/>
|
||||
<Label Content="至" Margin="0,200,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="22"/>
|
||||
<Button Content="提交" Margin="100,265,0,0" VerticalAlignment="Top" Height="40" Click="Button_Click" HorizontalAlignment="Left" Width="140"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using WechatBakTool.ViewModel;
|
||||
|
||||
namespace WechatBakTool.Dialog
|
||||
{
|
||||
/// <summary>
|
||||
/// MsgDatetimePicker.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MsgDatetimePicker : Window
|
||||
{
|
||||
|
||||
public MsgDatetimePicker(DatetimePickerViewModel viewModel)
|
||||
{
|
||||
DataContext = viewModel;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace WechatBakTool.Export
|
||||
public interface IExport
|
||||
{
|
||||
void InitTemplate(WXContact session,string path);
|
||||
bool SetMsg(WXUserReader reader, WXContact session, WorkspaceViewModel viewModel, DatetimePickerViewModel dateModel);
|
||||
bool SetMsg(WXUserReader reader, WXContact session, WorkspaceViewModel viewModel);
|
||||
void SetEnd();
|
||||
void Save(string path = "");
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ namespace WechatBakTool.Export
|
||||
File.AppendAllText(Path, HtmlBody);
|
||||
}
|
||||
|
||||
public bool SetMsg(WXUserReader reader, WXContact contact,WorkspaceViewModel viewModel, DatetimePickerViewModel dateModel)
|
||||
public bool SetMsg(WXUserReader reader, WXContact contact,WorkspaceViewModel viewModel)
|
||||
{
|
||||
if (Session == null)
|
||||
throw new Exception("请初始化模版:Not Use InitTemplate");
|
||||
|
||||
List<WXMsg>? msgList = reader.GetWXMsgs(contact.UserName, dateModel);
|
||||
List<WXMsg>? msgList = reader.GetWXMsgs(contact.UserName);
|
||||
if (msgList == null)
|
||||
throw new Exception("获取消息失败,请确认数据库读取正常");
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ namespace WechatBakTool.Export
|
||||
|
||||
}
|
||||
|
||||
public bool SetMsg(WXUserReader reader, WXContact session, WorkspaceViewModel viewModel, DatetimePickerViewModel dateModel)
|
||||
public bool SetMsg(WXUserReader reader, WXContact session, WorkspaceViewModel viewModel)
|
||||
{
|
||||
if (Contact == null)
|
||||
throw new Exception("请初始化模版:Not Use InitTemplate");
|
||||
|
||||
List<WXMsg>? msgList = reader.GetWXMsgs(Contact.UserName, dateModel);
|
||||
List<WXMsg>? msgList = reader.GetWXMsgs(Contact.UserName);
|
||||
if (msgList == null)
|
||||
throw new Exception("获取消息失败,请确认数据库读取正常");
|
||||
|
||||
|
||||
@@ -136,6 +136,10 @@ namespace WechatBakTool.Helpers
|
||||
throw new Exception("搜索不到微信账号,请确认用户名是否正确,如错误请重新新建工作区,务必确认账号是否正确");
|
||||
}
|
||||
}
|
||||
else if (find_key_type == 3)
|
||||
{
|
||||
string searchString = "-----BEGIN PUBLIC KEY-----";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static string GetMD5(string text)
|
||||
@@ -199,7 +203,6 @@ namespace WechatBakTool.Helpers
|
||||
|
||||
// 分页标志
|
||||
var page_bytes = BitConverter.GetBytes(page_no + 1);
|
||||
page_bytes = page_bytes.Take(4).ToArray();
|
||||
page_bytes.CopyTo(going_to_hashed, DEFAULT_PAGESIZE - reserved - offset + IV_SIZE);
|
||||
var hash_mac_compute = hmac_sha1.ComputeHash(going_to_hashed, 0, going_to_hashed.Length);
|
||||
|
||||
|
||||
@@ -80,8 +80,6 @@ namespace WechatBakTool
|
||||
MainFrame.Navigate(new Uri("pack://application:,,,/Pages/Welcome.xaml?datatime=" + DateTime.Now.Ticks));
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentUserBakConfig = config;
|
||||
if (!config.Decrypt)
|
||||
{
|
||||
MessageBox.Show("请先到创建工作区进行解密");
|
||||
@@ -89,6 +87,7 @@ namespace WechatBakTool
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentUserBakConfig = config;
|
||||
MainFrame.Navigate(new Uri("pack://application:,,,/Pages/Workspace.xaml?datatime=" + DateTime.Now.Ticks));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace WechatBakTool.Model
|
||||
public string Account { get; set; } = "";
|
||||
public string Friends_Number { get; set; } = "-";
|
||||
public string Msg_Number { get; set; } = "-";
|
||||
public string Key { get; set; } = "";
|
||||
public bool Manual { get; set; } = false;
|
||||
}
|
||||
|
||||
public class WXCount
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using JiebaNet.Segmenter.Common;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@@ -14,6 +13,7 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using WechatBakTool.Helpers;
|
||||
using WechatBakTool.Model;
|
||||
using WechatBakTool.ViewModel;
|
||||
@@ -29,20 +29,9 @@ namespace WechatBakTool.Pages
|
||||
public CreateWork()
|
||||
{
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
GetWechatProcessInfos();
|
||||
isManualProcess();
|
||||
}
|
||||
|
||||
private void isManualProcess()
|
||||
{
|
||||
if(Main2.CurrentUserBakConfig!= null)
|
||||
{
|
||||
cb_manual.IsChecked = Main2.CurrentUserBakConfig.Manual;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void GetWechatProcessInfos()
|
||||
{
|
||||
@@ -108,9 +97,9 @@ namespace WechatBakTool.Pages
|
||||
private void btn_create_worksapce_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.IsEnable = false;
|
||||
bool m = (bool)cb_manual.IsChecked!;
|
||||
|
||||
Task.Run(() => {
|
||||
if (ViewModel.KeyType != -1 && !m)
|
||||
if (ViewModel.KeyType != -1)
|
||||
{
|
||||
if (ViewModel.SelectProcess != null)
|
||||
{
|
||||
@@ -152,17 +141,6 @@ namespace WechatBakTool.Pages
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m)
|
||||
{
|
||||
WXWorkspace wXWorkspace = new WXWorkspace(Main2.CurrentUserBakConfig!);
|
||||
ViewModel.LabelStatus = "开始解密数据库";
|
||||
wXWorkspace.DecryptDB("", -1, ViewModel,Main2.CurrentUserBakConfig!.Key);
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
MessageBox.Show("解密完成");
|
||||
((Main2)Window.GetWindow(this)).LoadWorkspace();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("请选择Key获取方式", "错误");
|
||||
@@ -174,40 +152,16 @@ namespace WechatBakTool.Pages
|
||||
private void cb_manual_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("该功能仅限用于网络安全研究用途使用,红队同学请在合规授权下进行相关操作","重要提醒!!!!!!!!!");
|
||||
if(Main2.CurrentUserBakConfig != null)
|
||||
{
|
||||
if (Main2.CurrentUserBakConfig.Manual)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (MessageBox.Show("我确认获取到合规授权,仅用于网络安全用途使用", "信息确认", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
{
|
||||
if (File.Exists("auth.txt"))
|
||||
{
|
||||
string auth = File.ReadAllText("auth.txt");
|
||||
/*
|
||||
*
|
||||
* pwd:
|
||||
* 我已知晓手动模式可能潜在的法律及道德风险,我明白非法使用将要承担相关法律责任。
|
||||
* tips:
|
||||
* 请不要公开宣传手动模式,不提供任何使用解答,谢谢。
|
||||
* 不要编写任何关于手动模式的教程,避免非法传播使用。
|
||||
*
|
||||
*/
|
||||
// 我已知晓手动模式可能潜在的法律及道德风险,我明白非法使用将要承担相关法律责任。
|
||||
if (DecryptionHelper.GetMD5(auth) == "295f634af60d61dfa52a5f35849ac42b")
|
||||
{
|
||||
string genHash = DateTime.Now.ToString();
|
||||
string md5 = DecryptionHelper.GetMD5(genHash);
|
||||
UserBakConfig config = new UserBakConfig();
|
||||
config.Hash = md5;
|
||||
string workspacePath = Path.Combine(Directory.GetCurrentDirectory(), "workspace");
|
||||
config.UserWorkspacePath = Path.Combine(workspacePath, md5);
|
||||
|
||||
WXWorkspace workspace = new WXWorkspace(config);
|
||||
workspace.ManualInit();
|
||||
|
||||
MessageBox.Show("已经创建空的配置文件,请完善该配置文件后,点击开始解密","提示");
|
||||
MessageBox.Show("该功能现阶段暂未启用","错误");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace WechatBakTool.Pages
|
||||
public WXUserReader? UserReader;
|
||||
private List<WXContact>? ExpContacts;
|
||||
private bool Suspend = false;
|
||||
private int Status = 0;
|
||||
public Manager()
|
||||
{
|
||||
DataContext = workspaceViewModel;
|
||||
@@ -52,21 +51,6 @@ namespace WechatBakTool.Pages
|
||||
|
||||
private void btn_export_all_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 0 未开始
|
||||
if(Status == 0 || Status == 2)
|
||||
{
|
||||
Suspend = false;
|
||||
btn_export_all.Content = "暂停";
|
||||
}
|
||||
// 1 进行中
|
||||
else if (Status == 1)
|
||||
{
|
||||
// 开启暂停
|
||||
Suspend = true;
|
||||
Status = 2;
|
||||
btn_export_all.Content = "继续";
|
||||
return;
|
||||
}
|
||||
Task.Run(() =>
|
||||
{
|
||||
bool group = false, user = false;
|
||||
@@ -80,26 +64,19 @@ namespace WechatBakTool.Pages
|
||||
});
|
||||
if (UserReader != null)
|
||||
{
|
||||
if (Status == 0)
|
||||
if (!Suspend)
|
||||
ExpContacts = UserReader.GetWXContacts().ToList();
|
||||
else
|
||||
Suspend = false;
|
||||
|
||||
List<WXContact> process = new List<WXContact>();
|
||||
foreach (var contact in ExpContacts!)
|
||||
{
|
||||
|
||||
if (Suspend)
|
||||
{
|
||||
foreach(WXContact p in process)
|
||||
{
|
||||
ExpContacts.Remove(p);
|
||||
}
|
||||
workspaceViewModel.ExportCount = "已暂停";
|
||||
return;
|
||||
}
|
||||
|
||||
Status = 1;
|
||||
|
||||
if (group && contact.UserName.Contains("@chatroom"))
|
||||
{
|
||||
workspaceViewModel.WXContact = contact;
|
||||
@@ -110,10 +87,7 @@ namespace WechatBakTool.Pages
|
||||
workspaceViewModel.WXContact = contact;
|
||||
ExportMsg(contact);
|
||||
}
|
||||
process.Add(contact);
|
||||
}
|
||||
Status = 0;
|
||||
btn_export_all.Content = "导出";
|
||||
MessageBox.Show("批量导出完成", "提示");
|
||||
}
|
||||
});
|
||||
@@ -137,9 +111,7 @@ namespace WechatBakTool.Pages
|
||||
|
||||
IExport export = new HtmlExport();
|
||||
export.InitTemplate(contact, path);
|
||||
DatetimePickerViewModel dt = new DatetimePickerViewModel();
|
||||
dt.DateType = 1;
|
||||
if (export.SetMsg(UserReader!, contact, workspaceViewModel, dt))
|
||||
if(export.SetMsg(UserReader!, contact, workspaceViewModel))
|
||||
{
|
||||
export.SetEnd();
|
||||
export.Save(path);
|
||||
|
||||
@@ -29,7 +29,6 @@ using Newtonsoft.Json;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Threading;
|
||||
using System.Runtime.CompilerServices;
|
||||
using WechatBakTool.Dialog;
|
||||
|
||||
namespace WechatBakTool.Pages
|
||||
{
|
||||
@@ -159,6 +158,29 @@ namespace WechatBakTool.Pages
|
||||
Debug.WriteLine(ViewModel.SearchString);
|
||||
}
|
||||
|
||||
private void btn_export_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(ViewModel.WXContact == null || UserReader == null)
|
||||
{
|
||||
MessageBox.Show("请选择联系人", "错误");
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
string path = Path.Combine(Main2.CurrentUserBakConfig!.UserWorkspacePath, ViewModel.WXContact.UserName + ".txt");
|
||||
IExport export = new TXTExport();
|
||||
export.InitTemplate(ViewModel.WXContact, path);
|
||||
export.SetMsg(UserReader, ViewModel.WXContact, ViewModel);
|
||||
export.SetEnd();
|
||||
export.Save(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
|
||||
MessageBox.Show("导出完成");
|
||||
}
|
||||
|
||||
private void btn_open_workspace_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -179,20 +201,7 @@ namespace WechatBakTool.Pages
|
||||
MessageBox.Show("请选择导出方式", "错误");
|
||||
return;
|
||||
}
|
||||
|
||||
DatetimePickerViewModel datePickViewModel = new DatetimePickerViewModel();
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
MsgDatetimePicker picker = new MsgDatetimePicker(datePickViewModel);
|
||||
datePickViewModel.DateType = 1;
|
||||
datePickViewModel.PickDate = DateTime.Now.AddDays(-1);
|
||||
if (picker.ShowDialog() != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (ViewModel.SelectExportItem.Value == 3)
|
||||
if(ViewModel.SelectExportItem.Value == 3)
|
||||
{
|
||||
if(UserReader != null && ViewModel.WXContact != null)
|
||||
{
|
||||
@@ -298,7 +307,7 @@ namespace WechatBakTool.Pages
|
||||
export = new HtmlExport();
|
||||
}
|
||||
export.InitTemplate(ViewModel.WXContact, path);
|
||||
export.SetMsg(UserReader, ViewModel.WXContact, ViewModel, datePickViewModel);
|
||||
export.SetMsg(UserReader, ViewModel.WXContact, ViewModel);
|
||||
export.SetEnd();
|
||||
export.Save(path);
|
||||
#if DEBUG
|
||||
@@ -319,61 +328,6 @@ namespace WechatBakTool.Pages
|
||||
MessageBox.Show("用户所有表情预下载完毕");
|
||||
});
|
||||
}
|
||||
/*
|
||||
if (UserReader != null && ViewModel.WXContact != null)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
List<WXMsg> msgs = UserReader.GetWXMsgs(ViewModel.WXContact.UserName).ToList();
|
||||
List<WXContactHT> users = new List<WXContactHT>();
|
||||
if (File.Exists("WXContact.json"))
|
||||
{
|
||||
string text = File.ReadAllText("WXContact.json");
|
||||
text = text.Substring(8, text.Length - 8);
|
||||
users = JsonConvert.DeserializeObject<List<WXContactHT>>(text);
|
||||
}
|
||||
|
||||
int i = 1; int all = 1;
|
||||
List<WXMsg> tmp = new List<WXMsg>();
|
||||
foreach (WXMsg m in msgs)
|
||||
{
|
||||
m.BytesExtra = null;
|
||||
tmp.Add(m);
|
||||
if (all % 10000 == 0)
|
||||
{
|
||||
File.WriteAllText(ViewModel.WXContact.UserName + "-" + i.ToString() + ".json", string.Format("showMsg({0})", JsonConvert.SerializeObject(tmp)));
|
||||
tmp.Clear();
|
||||
i++;
|
||||
}
|
||||
all++;
|
||||
}
|
||||
|
||||
if (users!.Find(x => x.UserName == ViewModel.WXContact.UserName) == null)
|
||||
{
|
||||
WXContactHT html = new WXContactHT();
|
||||
html.NickName = ViewModel.WXContact.NickName;
|
||||
html.UserName = ViewModel.WXContact.UserName;
|
||||
html.LastMsg = ViewModel.WXContact.LastMsg;
|
||||
if (ViewModel.WXContact.Avatar != null)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
ViewModel.WXContact.Avatar.StreamSource.CopyTo(ms);
|
||||
byte[] bytes = new byte[ms.Length];
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
html.AvatarString = Convert.ToBase64String(bytes);
|
||||
}
|
||||
}
|
||||
html.FileCount = i;
|
||||
users.Add(html);
|
||||
}
|
||||
|
||||
File.WriteAllText(ViewModel.WXContact.UserName + "-" + i.ToString() + ".json", string.Format("showMsg({0})", JsonConvert.SerializeObject(tmp)));
|
||||
File.WriteAllText("WXContact.json", string.Format("getUser({0})", JsonConvert.SerializeObject(users)));
|
||||
MessageBox.Show("json已导出");
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private void list_msg_ScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
|
||||
@@ -60,12 +60,6 @@ A:工作区->右键->管理,就见了。<br/>
|
||||
Q:解密工作区提示no such teble:MSG怎么办<br/>
|
||||
A:基本上都是因为刚迁移完,缓存没写入到数据库导致的,建议迁移完重启一次微信后再创建工作区<br/>
|
||||
<br/>
|
||||
Q:解密工作区提示no such teble:XXXXXXX怎么办<br/>
|
||||
A:这个原因基本上是因为解密失败导致的,回落使用固定地址查找方式解密,请确保你的微信版本在version.json内支持<br/>
|
||||
<br/>
|
||||
Q:解密时提示,Unable to load DLL 'libcrypto-1_1' or one of its dependencies怎么办<br/>
|
||||
A:这个是因为加解密库的运行环境不满足,安装vc++2015 x64运行库后再尝试<br/>
|
||||
<br/>
|
||||
|
||||
### 使用说明
|
||||
0.安装.NET Desktop Runtime(注意是6.0版本的Desktop Runtime,如已经安装忽略)<br/>
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using WechatBakTool.Model;
|
||||
|
||||
namespace WechatBakTool.ViewModel
|
||||
{
|
||||
public partial class DatetimePickerViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private DateTime startDate = DateTime.Now.AddMonths(-1);
|
||||
|
||||
[ObservableProperty]
|
||||
private DateTime endDate = DateTime.Now;
|
||||
|
||||
[ObservableProperty]
|
||||
private DateTime pickDate = DateTime.Now.AddDays(-1);
|
||||
|
||||
[ObservableProperty]
|
||||
private int dateType = 1;
|
||||
}
|
||||
|
||||
public class DateTypeConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return (int.Parse(parameter.ToString()!) == (int)value);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return (bool)value ? parameter : Binding.DoNothing;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,6 @@ using System.Net.Http;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Threading;
|
||||
using Newtonsoft.Json;
|
||||
using WechatBakTool.ViewModel;
|
||||
|
||||
namespace WechatBakTool
|
||||
{
|
||||
@@ -380,40 +379,6 @@ namespace WechatBakTool
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public List<WXMsg>? GetWXMsgs(string uid, DatetimePickerViewModel dateModel)
|
||||
{
|
||||
List<WXMsg> tmp = new List<WXMsg>();
|
||||
for (int i = 0; i <= 99; i++)
|
||||
{
|
||||
SQLiteConnection? con = getCon("MSG" + i.ToString());
|
||||
if (con == null)
|
||||
return tmp;
|
||||
|
||||
List<WXMsg>? wXMsgs = null;
|
||||
string query = "";
|
||||
|
||||
if (dateModel.DateType == 2 || dateModel.DateType == 3)
|
||||
{
|
||||
query = "select * from MSG where StrTalker=? and date(createtime,'unixepoch') = ?";
|
||||
wXMsgs = con.Query<WXMsg>(query, uid, dateModel.PickDate.ToString("yyyy-MM-dd"));
|
||||
}
|
||||
else if(dateModel.DateType == 4 )
|
||||
{
|
||||
query = "select * from MSG where StrTalker=? and date(createtime,'unixepoch') >= ? and date(createtime,'unixepoch') <= ?";
|
||||
wXMsgs = con.Query<WXMsg>(query, uid, dateModel.StartDate.ToString("yyyy-MM-dd"), dateModel.EndDate.ToString("yyyy-MM-dd"));
|
||||
}
|
||||
else
|
||||
{
|
||||
query = "select * from MSG where StrTalker=?";
|
||||
wXMsgs = con.Query<WXMsg>(query, uid);
|
||||
}
|
||||
|
||||
tmp.AddRange(ProcessMsg(wXMsgs, uid));
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
private List<WXMsg> ProcessMsg(List<WXMsg> msgs,string uid)
|
||||
{
|
||||
foreach (WXMsg w in msgs)
|
||||
|
||||
@@ -104,42 +104,32 @@ namespace WechatBakTool
|
||||
{
|
||||
return UserBakConfig;
|
||||
}
|
||||
public static void SaveConfig(UserBakConfig userBakConfig, bool manual = false)
|
||||
public static void SaveConfig(UserBakConfig userBakConfig)
|
||||
{
|
||||
if(userBakConfig.UserWorkspacePath != "")
|
||||
{
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(userBakConfig.UserWorkspacePath);
|
||||
if(directoryInfo.Parent != null)
|
||||
{
|
||||
string json_path = Path.Combine(directoryInfo.Parent.FullName, userBakConfig.Manual ? userBakConfig.Hash + ".json" : userBakConfig.UserName + ".json");
|
||||
string json_path = Path.Combine(directoryInfo.Parent.FullName, userBakConfig.UserName + ".json");
|
||||
string json = JsonConvert.SerializeObject(userBakConfig);
|
||||
File.WriteAllText(json_path, json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ManualInit()
|
||||
{
|
||||
Init("", true, "");
|
||||
}
|
||||
private string Init(string path,bool manual = false,string account = "")
|
||||
private string Init(string path,bool manual,string account = "")
|
||||
{
|
||||
string curPath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
if (!manual)
|
||||
{
|
||||
string md5 = GetMd5Hash(path);
|
||||
string[] paths = path.Split(new string[] { "/", "\\" }, StringSplitOptions.None);
|
||||
string username = paths[paths.Length - 1];
|
||||
UserBakConfig.UserResPath = path;
|
||||
UserBakConfig.UserWorkspacePath = Path.Combine(curPath, "workspace", md5);
|
||||
UserBakConfig.Hash = md5;
|
||||
UserBakConfig.UserName = username;
|
||||
UserBakConfig.Account = account;
|
||||
}
|
||||
string md5 = GetMd5Hash(path);
|
||||
string[] paths = path.Split(new string[] { "/", "\\" }, StringSplitOptions.None);
|
||||
string username = paths[paths.Length - 1];
|
||||
UserBakConfig.UserResPath = path;
|
||||
UserBakConfig.UserWorkspacePath = Path.Combine(curPath, "workspace", md5);
|
||||
UserBakConfig.Hash = md5;
|
||||
UserBakConfig.UserName = username;
|
||||
UserBakConfig.Account = account;
|
||||
|
||||
UserBakConfig.Manual = manual;
|
||||
|
||||
if (!Directory.Exists(UserBakConfig.UserResPath) && !manual)
|
||||
if (!Directory.Exists(UserBakConfig.UserResPath))
|
||||
{
|
||||
return "用户资源文件夹不存在,如需使用离线数据,请从工作区读取";
|
||||
}
|
||||
@@ -151,7 +141,6 @@ namespace WechatBakTool
|
||||
|
||||
string db = Path.Combine(UserBakConfig.UserWorkspacePath, "OriginalDB");
|
||||
string decDb = Path.Combine(UserBakConfig.UserWorkspacePath, "DecDB");
|
||||
|
||||
if (!Directory.Exists(db))
|
||||
{
|
||||
Directory.CreateDirectory (db);
|
||||
@@ -160,7 +149,7 @@ namespace WechatBakTool
|
||||
{
|
||||
Directory.CreateDirectory(decDb);
|
||||
}
|
||||
SaveConfig(UserBakConfig, manual);
|
||||
SaveConfig(UserBakConfig);
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<AssemblyVersion>0.9.7.3</AssemblyVersion>
|
||||
<FileVersion>0.9.7.3</FileVersion>
|
||||
<Version>0.9.7.3</Version>
|
||||
<AssemblyVersion>0.9.6.4</AssemblyVersion>
|
||||
<FileVersion>0.9.6.4</FileVersion>
|
||||
<Version>0.9.6.4</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -14,14 +14,5 @@
|
||||
},{
|
||||
"Version":"3.9.8.25",
|
||||
"BaseAddr": 65002192
|
||||
},{
|
||||
"Version":"3.9.9.27",
|
||||
"BaseAddr": 68066576
|
||||
},{
|
||||
"Version":"3.9.9.35",
|
||||
"BaseAddr": 68066576
|
||||
},{
|
||||
"Version":"3.9.9.43",
|
||||
"BaseAddr": 68067216
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user