├── README.md
├── fidder
├── packages.config
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── data.cs
├── Program.cs
├── Form1.Designer.cs
├── fidder.csproj
├── Form1.resx
└── Form1.cs
├── fidder.sln
├── .gitattributes
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | # FiddlerCore
2 | 这个一个启动代理服务器,让app或者模拟器连接,抓取所有连接包的程序(类似Fiddler)net封装
3 |
4 |
5 | 怎么让手机模拟器连上代理,直接点击wifi链接然后修改端口是8877
6 |
--------------------------------------------------------------------------------
/fidder/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/fidder/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/fidder/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/fidder/data.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace fidder
8 | {
9 | public class data
10 | {
11 | public data()
12 | {
13 |
14 | id = "";
15 | content = "";
16 | }
17 | public string id { get; set; }
18 | public string content { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/fidder/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace fidder
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new 船货不二抓取系统());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/fidder/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace fidder.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/fidder/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("fidder")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("fidder")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("a975d847-e8af-488d-ab0c-dc42489bd33d")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
33 | // 方法是按如下所示使用“*”: :
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/fidder.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2026
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fidder", "fidder\fidder.csproj", "{A975D847-E8AF-488D-AB0C-DC42489BD33D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {A975D847-E8AF-488D-AB0C-DC42489BD33D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {A975D847-E8AF-488D-AB0C-DC42489BD33D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {A975D847-E8AF-488D-AB0C-DC42489BD33D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {A975D847-E8AF-488D-AB0C-DC42489BD33D}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {3A4FF419-8570-460A-890F-3788E26A56A8}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/fidder/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace fidder.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("fidder.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/fidder/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace fidder
2 | {
3 | partial class 船货不二抓取系统
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要修改
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.btnstart = new System.Windows.Forms.Button();
32 | this.btnout = new System.Windows.Forms.Button();
33 | this.label5 = new System.Windows.Forms.Label();
34 | this.txtlog = new System.Windows.Forms.TextBox();
35 | this.SuspendLayout();
36 | //
37 | // btnstart
38 | //
39 | this.btnstart.Location = new System.Drawing.Point(546, 58);
40 | this.btnstart.Margin = new System.Windows.Forms.Padding(2);
41 | this.btnstart.Name = "btnstart";
42 | this.btnstart.Size = new System.Drawing.Size(56, 18);
43 | this.btnstart.TabIndex = 0;
44 | this.btnstart.Text = "开始";
45 | this.btnstart.UseVisualStyleBackColor = true;
46 | this.btnstart.Click += new System.EventHandler(this.btnstart_Click);
47 | //
48 | // btnout
49 | //
50 | this.btnout.Location = new System.Drawing.Point(607, 58);
51 | this.btnout.Margin = new System.Windows.Forms.Padding(2);
52 | this.btnout.Name = "btnout";
53 | this.btnout.Size = new System.Drawing.Size(56, 18);
54 | this.btnout.TabIndex = 1;
55 | this.btnout.Text = "退出";
56 | this.btnout.UseVisualStyleBackColor = true;
57 | this.btnout.Click += new System.EventHandler(this.btnout_Click);
58 | //
59 | // label5
60 | //
61 | this.label5.AutoSize = true;
62 | this.label5.Location = new System.Drawing.Point(-12, -11);
63 | this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
64 | this.label5.Name = "label5";
65 | this.label5.Size = new System.Drawing.Size(65, 12);
66 | this.label5.TabIndex = 41;
67 | this.label5.Text = "日志记录:";
68 | //
69 | // txtlog
70 | //
71 | this.txtlog.Location = new System.Drawing.Point(21, 88);
72 | this.txtlog.Margin = new System.Windows.Forms.Padding(2);
73 | this.txtlog.Multiline = true;
74 | this.txtlog.Name = "txtlog";
75 | this.txtlog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
76 | this.txtlog.Size = new System.Drawing.Size(680, 328);
77 | this.txtlog.TabIndex = 42;
78 | //
79 | // 船货不二抓取系统
80 | //
81 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
82 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
83 | this.ClientSize = new System.Drawing.Size(726, 498);
84 | this.Controls.Add(this.txtlog);
85 | this.Controls.Add(this.label5);
86 | this.Controls.Add(this.btnout);
87 | this.Controls.Add(this.btnstart);
88 | this.Margin = new System.Windows.Forms.Padding(2);
89 | this.Name = "船货不二抓取系统";
90 | this.Text = "船货不二抓取系统";
91 | this.ResumeLayout(false);
92 | this.PerformLayout();
93 |
94 | }
95 |
96 | #endregion
97 |
98 | private System.Windows.Forms.Button btnstart;
99 | private System.Windows.Forms.Button btnout;
100 | private System.Windows.Forms.Label label5;
101 | private System.Windows.Forms.TextBox txtlog;
102 | }
103 | }
104 |
105 |
--------------------------------------------------------------------------------
/fidder/fidder.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {A975D847-E8AF-488D-AB0C-DC42489BD33D}
8 | WinExe
9 | fidder
10 | fidder
11 | v4.5
12 | 512
13 | true
14 |
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 | ..\packages\FiddlerCore2.1.0.0\lib\net40\BasicFormatsForCore.dll
38 |
39 |
40 | ..\packages\FiddlerCore2.1.0.0\lib\net40\BCMakeCert.dll
41 |
42 |
43 | ..\packages\FiddlerCore2.1.0.0\lib\net40\CertMaker.dll
44 |
45 |
46 | ..\packages\FiddlerCore2.1.0.0\lib\net40\FiddlerCore4.dll
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | Form
64 |
65 |
66 | Form1.cs
67 |
68 |
69 |
70 |
71 | Form1.cs
72 |
73 |
74 | ResXFileCodeGenerator
75 | Resources.Designer.cs
76 | Designer
77 |
78 |
79 | True
80 | Resources.resx
81 | True
82 |
83 |
84 |
85 | SettingsSingleFileGenerator
86 | Settings.Designer.cs
87 |
88 |
89 | True
90 | Settings.settings
91 | True
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/fidder/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/fidder/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/fidder/Form1.cs:
--------------------------------------------------------------------------------
1 | using Fiddler;
2 | using System;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Data;
7 | using System.Drawing;
8 | using System.IO;
9 | using System.Linq;
10 | using System.Net;
11 | using System.Text;
12 | using System.Text.RegularExpressions;
13 | using System.Threading;
14 | using System.Threading.Tasks;
15 | using System.Windows.Forms;
16 |
17 | namespace fidder
18 | {
19 | public partial class 船货不二抓取系统 : Form
20 | {
21 | static Proxy oSecureEndpoint;
22 | static string sSecureEndpointHostname = "localhost";
23 | static int iSecureEndpointPort = 8888;
24 | private IList dataList = new List();
25 | RegFunc rf = new RegFunc();
26 | public 船货不二抓取系统()
27 | {
28 | InitializeComponent();
29 | string strHostName = Dns.GetHostName();
30 | IPHostEntry ipEntry = Dns.GetHostEntry(strHostName); //取得本机IP
31 | txtlog.AppendText("代理端口为8877" + Environment.NewLine);
32 | foreach (var item in ipEntry.AddressList)
33 | {
34 | if (item.ToString().IndexOf('.') > 0)
35 | {
36 | txtlog.AppendText("IP:" + item.ToString() + Environment.NewLine);
37 | }
38 |
39 | }
40 | txtlog.AppendText("请先修改wifi代理" + Environment.NewLine);
41 |
42 | string path = "down\\";
43 | if (Directory.Exists(path))
44 | {
45 |
46 | }
47 | else
48 | {
49 | Directory.CreateDirectory(path);
50 |
51 | }
52 |
53 | }
54 |
55 | private void btnstart_Click(object sender, EventArgs e)
56 | {
57 |
58 | btnout.Enabled = true;
59 | btnstart.Enabled = false;
60 | Control.CheckForIllegalCrossThreadCalls = false;
61 | //设置别名
62 | Fiddler.FiddlerApplication.SetAppDisplayName("FiddlerCoreDemoApp");
63 |
64 | //启动方式
65 | FiddlerCoreStartupFlags oFCSF = FiddlerCoreStartupFlags.Default;
66 |
67 | //定义http代理端口
68 | int iPort = 8877;
69 | //启动代理程序,开始监听http请求
70 | //端口,是否使用windows系统代理(如果为true,系统所有的http访问都会使用该代理)我使用的是
71 | Fiddler.FiddlerApplication.Startup(iPort, false, true, true);
72 |
73 | // 我们还将创建一个HTTPS监听器,当FiddlerCore被伪装成HTTPS服务器有用
74 | // 而不是作为一个正常的CERN样式代理服务器。
75 | //oSecureEndpoint = FiddlerApplication.CreateProxyEndpoint(iSecureEndpointPort, true, sSecureEndpointHostname);
76 | txtlog.AppendText("启动代理成功" + Environment.NewLine);
77 |
78 | List oAllSessions = new List();
79 |
80 | ////请求出错时处理
81 | //Fiddler.FiddlerApplication.BeforeReturningError += FiddlerApplication_BeforeReturningError;
82 |
83 | //在发送请求之前执行的操作
84 | Fiddler.FiddlerApplication.BeforeRequest += delegate (Fiddler.Session oS)
85 | {
86 | //请求的全路径
87 | Console.WriteLine("Before request for:\t" + oS.fullUrl);
88 | // 为了使反应篡改,必须使用缓冲模式
89 | // 被启用。这允许FiddlerCore以允许修改
90 | // 在BeforeResponse处理程序中的反应,而不是流
91 | // 响应给客户机作为响应进来。
92 |
93 | oS.bBufferResponse = true;
94 | Monitor.Enter(oAllSessions);
95 | oAllSessions.Add(oS);
96 | Monitor.Exit(oAllSessions);
97 | oS["X-AutoAuth"] = "(default)";
98 |
99 | /* 如果请求是要我们的安全的端点,我们将回显应答。
100 |
101 | 注:此BeforeRequest是越来越要求我们两个主隧道代理和我们的安全的端点,
102 | 让我们来看看它的Fiddler端口连接到(pipeClient.LocalPort)客户端,以确定是否该请求
103 | 被发送到安全端点,或为了达到**安全端点被仅仅发送到主代理隧道(例如,一个CONNECT)。
104 | 因此,如果你运行演示和参观的https://本地主机:7777在浏览器中,你会看到
105 | Session list contains...
106 |
107 | 1 CONNECT http://localhost:7777
108 | 200 <-- CONNECT tunnel sent to the main proxy tunnel, port 8877
109 | 2 GET https://localhost:7777/
110 | 200 text/html <-- GET request decrypted on the main proxy tunnel, port 8877
111 | 3 GET https://localhost:7777/
112 | 200 text/html <-- GET request received by the secure endpoint, port 7777
113 | */
114 |
115 | //oS.utilCreateResponseAndBypassServer();
116 | //oS.oResponse.headers.SetStatus(200, "Ok");
117 | //string str = oS.GetResponseBodyAsString();
118 | //oS.utilSetResponseBody(str + "aaaaaaaaaaaaaaaaaaaaa");
119 |
120 | if ((oS.oRequest.pipeClient.LocalPort == iSecureEndpointPort) && (oS.hostname == sSecureEndpointHostname))
121 | {
122 | oS.utilCreateResponseAndBypassServer();
123 | oS.oResponse.headers.SetStatus(200, "Ok");
124 | oS.oResponse["Content-Type"] = "text/html; charset=UTF-8";
125 | oS.oResponse["Cache-Control"] = "private, max-age=0";
126 | oS.utilSetResponseBody("Request for httpS://" + sSecureEndpointHostname + ":" + iSecureEndpointPort.ToString() + " received. Your request was:
" + oS.oRequest.headers.ToString());
127 | }
128 | //if ((oS.oRequest.pipeClient.LocalPort == 8877) && (oS.hostname == "www.baidu.com"))
129 | //{
130 | // string url = oS.fullUrl;
131 | // oS.utilCreateResponseAndBypassServer();
132 | // oS.oResponse.headers.SetStatus(200, "Ok");
133 | // oS.oResponse["Content-Type"] = "text/html; charset=UTF-8";
134 | // oS.oResponse["Cache-Control"] = "private, max-age=0";
135 | // oS.utilSetResponseBody("Request for httpS://" + sSecureEndpointHostname + ":" + iSecureEndpointPort.ToString() + " received. Your request was:
" + oS.oRequest.headers.ToString());
136 | //}
137 | };
138 |
139 | /*
140 | // 下面的事件,您可以检查由Fiddler阅读每一响应缓冲区。
141 | * 请注意,这不是为绝大多数应用非常有用,因为原始缓冲区几乎是无用的;它没有解压,它包括标题和正文字节数等。
142 | //
143 | // 本次仅适用于极少数的应用程序这就需要一个原始的,未经处理的字节流获取有用
144 | Fiddler.FiddlerApplication.OnReadResponseBuffer += new EventHandler(FiddlerApplication_OnReadResponseBuffer);
145 | */
146 |
147 |
148 | Fiddler.FiddlerApplication.BeforeResponse += delegate (Fiddler.Session oS)
149 | {
150 |
151 |
152 | if (oS.fullUrl.IndexOf("http://www.chuanhuobu2.com/mercury/api/ships/detail?") >= 0)
153 | {
154 | //已抓到数据http://www.chuanhuobu2.com/mercury/api/ships/detail?ship=10299742&origin=0
155 | //已抓到数据{ "id":10299742,"version":1741228,"item":{ "startPort":"徐州","blankStart":"","aimPort":"","date":"08月14日±4天","dateText":"今天","weight":"2500吨","weightText":2500,"note":""},"state":{ "ordered":0,"pause":0,"showTime":"1小时前"},"tag":{ "level":"10级","relation":null,"certified":true,"goodPhone":true,"idcardCertified":true,"honestyAvatar":false,"geoLocation":"","photo":null},"user":{ "name":"毛传北","avatar":null,"newAvatar":null,"mobiles":"15951271769","vessel":"豫泓翔588"},"attitude":{ "friend":0,"baddie":0} }
156 | //已抓到数据http://www.chuanhuobu2.com/mercury/api/ships/detail?ship=10299742&origin=0
157 | //已抓到数据{ "id":10299742,"version":1741228,"item":{ "startPort":"徐州","blankStart":"","aimPort":"","date":"08月14日±4天","dateText":"今天","weight":"2500吨","weightText":2500,"note":""},"state":{ "ordered":0,"pause":0,"showTime":"1小时前"},"tag":{ "level":"10级","relation":null,"certified":true,"goodPhone":true,"idcardCertified":true,"honestyAvatar":false,"geoLocation":"","photo":null},"user":{ "name":"***","newAvatar":null,"mobiles":"159********","vessel":"豫泓翔***"},"attitude":{ "friend":0,"baddie":0} }
158 |
159 | oS.utilDecodeResponse();
160 | string content = oS.GetResponseBodyAsString();
161 | Regex rx = new Regex(@"^0{0,1}(13[4-9]|15[7-9]|15[0-2]|18[7-8])[0-9]{8}$");
162 | txtlog.AppendText("已抓到数据" + oS.GetResponseBodyAsString() + Environment.NewLine);
163 | if (System.Text.RegularExpressions.Regex.IsMatch(rf.GetStr(content, "\"mobiles\":\"", "\","), @"^[0-9]*$"))
164 | {
165 | txtlog.AppendText("手机号是" + rf.GetStr(content, "\"mobiles\":", ",") + "可以保存" + Environment.NewLine);
166 | CleanData(content, "");
167 | }
168 | else
169 | {
170 | txtlog.AppendText("手机号是" + rf.GetStr(content, "\"mobiles\":", ",") + "需要查看哦" + Environment.NewLine);
171 | dataList.Add(new data { id = rf.GetStr(content, "\"id\":", ","), content = content });
172 | }
173 |
174 |
175 | }
176 | else if (oS.fullUrl.IndexOf("http://www.chuanhuobu2.com/mercury/api/pallets/make-link-contact") >= 0)
177 | {
178 | //已抓到数据http://www.chuanhuobu2.com/mercury/api/pallets/make-link-contact
179 | //已抓到数据{ "id":10278241,"mobiles":["18136310777"],"ordered":0,"pause":0,"avatar":null,"status":0,"username":"冯对桃","vesselName":"徐货9780","attitude":{ "friend":0,"baddie":0},"originScore":0}
180 | oS.utilDecodeResponse();
181 | string content = oS.GetResponseBodyAsString();
182 | if (content.Length > 50)
183 | {
184 | CleanData("", content);
185 |
186 | }
187 | else {
188 | txtlog.AppendText("数据异常"+ content + Environment.NewLine);
189 | }
190 |
191 | }
192 |
193 |
194 | if (txtlog.Lines.Count() > 3000)
195 | {
196 | txtlog.Text = "";
197 | txtlog.AppendText("清空缓存" + Environment.NewLine);
198 | }
199 |
200 |
201 | };
202 |
203 | }
204 |
205 | public void CleanData(string one, string two)
206 | {
207 | string content = "";
208 | string mobiles = ""; string vesselName = "";
209 | string _datastr = "";
210 | string Path = "down\\船期数据.txt";
211 | if (!File.Exists(Path))
212 | {
213 | using (new FileStream(Path, FileMode.Create, FileAccess.Write)) { };
214 | }
215 | //获取手机号
216 | if (one == "")
217 | {
218 |
219 | for (int i = 0; i < dataList.Count; i++)
220 | {
221 | if (dataList[i].id == rf.GetStr(two, "\"id\":", ","))
222 | {
223 | content = dataList[i].content;
224 | dataList.Remove(dataList[i]);
225 | break;
226 | }
227 |
228 | }
229 | #region 相同
230 | _datastr += "" + rf.GetStr(content, "\"id\":", ",") + "";
231 | _datastr += "" + rf.GetStr(content, "\"version\":", ",") + "";
232 | _datastr += "" + rf.GetStr(content, "\"startPort\":\"", "\",") + "";
233 | _datastr += "" + rf.GetStr(content, "\"blankStart\":\"", "\",") + "";
234 | _datastr += "" + rf.GetStr(content, "\"aimPort\":\"", "\",") + "";
235 | _datastr += "" + rf.GetStr(content, "\"date\":\"", "\",") + "";
236 | _datastr += "" + rf.GetStr(content, "\"dateText\":\"", "\",") + "";
237 | _datastr += "" + rf.GetStr(content, "\"weight\":\"", "\",") + "";
238 | _datastr += "" + rf.GetStr(content, "\"weightText\":\"", "\"") + "";
239 | _datastr += "" + rf.GetStr(content, "\"pause\":", ",") + "";
240 | _datastr += "" + rf.GetStr(content, "\"showTime\":\"", "\"") + "";
241 |
242 | _datastr += "" + rf.GetStr(content, "\"level\":\"", "\"") + "";
243 | _datastr += "" + rf.GetStr(content, "\"relation\":", ",") + "";
244 | _datastr += "" + rf.GetStr(content, "\"certified\":", ",") + "";
245 | _datastr += "" + rf.GetStr(content, "\"goodPhone\":", ",") + "";
246 | _datastr += "" + rf.GetStr(content, "\"idcardCertified\":", ",") + "";
247 | _datastr += "" + rf.GetStr(content, "\"honestyAvatar\":", ",") + "";
248 | _datastr += "" + rf.GetStr(content, "\"geoLocation\":", ",") + "";
249 | _datastr += "" + rf.GetStr(content, "\"file\":\"", "\",") + "";
250 | _datastr += "";
251 | _datastr += "" + rf.GetStr(content, "\"location\":\"", "\",") + "";
252 |
253 | #endregion
254 |
255 | _datastr += "" + rf.GetStr(two, "\"username\":\"", "\",") + "";
256 | _datastr += "" + rf.GetStr(two, "\"vesselName\":\"", "\",") + "";
257 | _datastr += "" + rf.GetStr(two, "\"mobiles\":\\[\"", "\"],") + "";
258 | mobiles = rf.GetStr(two, "\"mobiles\":\\[\"", "\"],");
259 | vesselName = rf.GetStr(two, "\"vesselName\":\"", "\",");
260 | }
261 | else if (two == "")
262 | {
263 | //直接保存
264 | content = one;
265 | #region 相同
266 | _datastr += "" + rf.GetStr(content, "\"id\":", ",") + "";
267 | _datastr += "" + rf.GetStr(content, "\"version\":", ",") + "";
268 | _datastr += "" + rf.GetStr(content, "\"startPort\":\"", "\",") + "";
269 | _datastr += "" + rf.GetStr(content, "\"blankStart\":\"", "\",") + "";
270 | _datastr += "" + rf.GetStr(content, "\"aimPort\":\"", "\",") + "";
271 | _datastr += "" + rf.GetStr(content, "\"date\":\"", "\",") + "";
272 | _datastr += "" + rf.GetStr(content, "\"dateText\":\"", "\",") + "";
273 | _datastr += "" + rf.GetStr(content, "\"weight\":\"", "\",") + "";
274 | _datastr += "" + rf.GetStr(content, "\"weightText\":", ",") + "";
275 | _datastr += "" + rf.GetStr(content, "\"pause\":", ",") + "";
276 | _datastr += "" + rf.GetStr(content, "\"showTime\":\"", "\"") + "";
277 | _datastr += "" + rf.GetStr(content, "\"level\":\"", "\"") + "";
278 | _datastr += "" + rf.GetStr(content, "\"relation\":", ",") + "";
279 | _datastr += "" + rf.GetStr(content, "\"certified\":", ",") + "";
280 | _datastr += "" + rf.GetStr(content, "\"goodPhone\":", ",") + "";
281 | _datastr += "" + rf.GetStr(content, "\"idcardCertified\":", ",") + "";
282 | _datastr += "" + rf.GetStr(content, "\"honestyAvatar\":", ",") + "";
283 | _datastr += "" + rf.GetStr(content, "\"geoLocation\":", ",") + "";
284 | _datastr += "" + rf.GetStr(content, "\"file\":\"", "\",") + "";
285 | _datastr += "";
286 | _datastr += "" + rf.GetStr(content, "\"location\":\"", "\",") + "";
287 | #endregion
288 |
289 | _datastr += "" + rf.GetStr(content, "\"name\":\"", "\",") + "";
290 | _datastr += "" + rf.GetStr(content, "\"vessel\":\"", "\"") + "";
291 | _datastr += "" + rf.GetStr(content, "\"mobiles\":\"", "\",") + "";
292 | mobiles = rf.GetStr(content, "\"mobiles\":\"", "\",");
293 | vesselName = rf.GetStr(content, "\"vessel\":\"", "\"");
294 |
295 | }
296 |
297 | using (StreamWriter sw = new StreamWriter(Path, true, Encoding.Default))
298 | {
299 |
300 | sw.Write(_datastr + "\r\n");
301 | txtlog.AppendText("已抓到" + rf.GetStr(two, "\"username\":\"", "\",") + "船舶" + vesselName + "的手机号" + mobiles + Environment.NewLine);
302 | }
303 |
304 | }
305 |
306 | private void btnout_Click(object sender, EventArgs e)
307 | {
308 | btnstart.Enabled = true;
309 | if (null != oSecureEndpoint) oSecureEndpoint.Dispose();
310 | Fiddler.FiddlerApplication.Shutdown();
311 | txtlog.AppendText("断开代理成功" + Environment.NewLine);
312 | btnout.Enabled = false;
313 | Thread.Sleep(500);
314 |
315 | }
316 |
317 | private void txtview_TextChanged(object sender, EventArgs e)
318 | {
319 |
320 | }
321 | }
322 | class RegFunc
323 | {
324 | public ArrayList GetStrArr(string pContent, string regBegKey, string regEndKey)
325 | {
326 | ArrayList arr = new ArrayList();
327 | string regular = "(?<={0})(.|\n)*?(?={1})";
328 | regular = string.Format(regular, regBegKey, regEndKey);
329 | Regex regex = new Regex(regular, RegexOptions.IgnoreCase);
330 | MatchCollection mc = regex.Matches(pContent);
331 | foreach (Match m in mc)
332 | {
333 | arr.Add(m.Value.Trim());
334 | }
335 | return arr;
336 | }
337 |
338 | public string GetStr(string pContent, string regBegKey, string regEndKey)
339 | {
340 | string regstr = "";
341 | string regular = "(?<={0})(.|\n)*?(?={1})";
342 | regular = string.Format(regular, regBegKey, regEndKey);
343 | Regex regex = new Regex(regular, RegexOptions.IgnoreCase);
344 | Match m = regex.Match(pContent);
345 | if (m.Length > 0)
346 | {
347 | regstr = m.Value.Trim();
348 | }
349 | return regstr;
350 | }
351 |
352 |
353 |
354 | }
355 | }
356 |
--------------------------------------------------------------------------------