├── .gitignore ├── App.config ├── ArcaeaParty.Designer.cs ├── ArcaeaParty.cs ├── ArcaeaParty.csproj ├── ArcaeaParty.resx ├── Classes.cs ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── README.md └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /obj -------------------------------------------------------------------------------- /App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ArcaeaParty.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ArcaeaParty 2 | { 3 | partial class ArcaeaParty 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.WorldMapTree = new System.Windows.Forms.TreeView(); 32 | this.CurrentMap = new System.Windows.Forms.Label(); 33 | this.StepList = new System.Windows.Forms.ListView(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.DoParty = new System.Windows.Forms.Button(); 37 | this.Stamina = new System.Windows.Forms.Label(); 38 | this.Character = new System.Windows.Forms.Label(); 39 | this.ConvertStamina = new System.Windows.Forms.Button(); 40 | this.RefreshBtn = new System.Windows.Forms.Button(); 41 | this.TotalStep = new System.Windows.Forms.Label(); 42 | this.SuspendLayout(); 43 | // 44 | // WorldMapTree 45 | // 46 | this.WorldMapTree.Location = new System.Drawing.Point(12, 29); 47 | this.WorldMapTree.Name = "WorldMapTree"; 48 | this.WorldMapTree.Size = new System.Drawing.Size(186, 383); 49 | this.WorldMapTree.TabIndex = 0; 50 | this.WorldMapTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.OnWorldMapTreeSelect); 51 | // 52 | // CurrentMap 53 | // 54 | this.CurrentMap.AutoSize = true; 55 | this.CurrentMap.BackColor = System.Drawing.SystemColors.Control; 56 | this.CurrentMap.Location = new System.Drawing.Point(12, 423); 57 | this.CurrentMap.Name = "CurrentMap"; 58 | this.CurrentMap.Size = new System.Drawing.Size(0, 12); 59 | this.CurrentMap.TabIndex = 1; 60 | // 61 | // StepList 62 | // 63 | this.StepList.Location = new System.Drawing.Point(204, 29); 64 | this.StepList.Name = "StepList"; 65 | this.StepList.Size = new System.Drawing.Size(280, 383); 66 | this.StepList.TabIndex = 2; 67 | this.StepList.UseCompatibleStateImageBehavior = false; 68 | this.StepList.View = System.Windows.Forms.View.List; 69 | // 70 | // label1 71 | // 72 | this.label1.AutoSize = true; 73 | this.label1.Location = new System.Drawing.Point(12, 11); 74 | this.label1.Name = "label1"; 75 | this.label1.Size = new System.Drawing.Size(29, 12); 76 | this.label1.TabIndex = 3; 77 | this.label1.Text = "Maps"; 78 | // 79 | // label2 80 | // 81 | this.label2.AutoSize = true; 82 | this.label2.Location = new System.Drawing.Point(204, 11); 83 | this.label2.Name = "label2"; 84 | this.label2.Size = new System.Drawing.Size(35, 12); 85 | this.label2.TabIndex = 4; 86 | this.label2.Text = "Steps"; 87 | // 88 | // DoParty 89 | // 90 | this.DoParty.Location = new System.Drawing.Point(491, 385); 91 | this.DoParty.Name = "DoParty"; 92 | this.DoParty.Size = new System.Drawing.Size(75, 26); 93 | this.DoParty.TabIndex = 5; 94 | this.DoParty.Text = "Play"; 95 | this.DoParty.UseVisualStyleBackColor = true; 96 | this.DoParty.Click += new System.EventHandler(this.DoParty_Click); 97 | // 98 | // Stamina 99 | // 100 | this.Stamina.AutoSize = true; 101 | this.Stamina.Location = new System.Drawing.Point(490, 29); 102 | this.Stamina.Name = "Stamina"; 103 | this.Stamina.Size = new System.Drawing.Size(47, 12); 104 | this.Stamina.TabIndex = 6; 105 | this.Stamina.Text = "Stamina"; 106 | // 107 | // Character 108 | // 109 | this.Character.AutoSize = true; 110 | this.Character.Location = new System.Drawing.Point(489, 51); 111 | this.Character.Name = "Character"; 112 | this.Character.Size = new System.Drawing.Size(59, 12); 113 | this.Character.TabIndex = 7; 114 | this.Character.Text = "Character"; 115 | // 116 | // ConvertStamina 117 | // 118 | this.ConvertStamina.Enabled = false; 119 | this.ConvertStamina.Location = new System.Drawing.Point(491, 353); 120 | this.ConvertStamina.Name = "ConvertStamina"; 121 | this.ConvertStamina.Size = new System.Drawing.Size(75, 26); 122 | this.ConvertStamina.TabIndex = 8; 123 | this.ConvertStamina.Text = "Convert"; 124 | this.ConvertStamina.UseVisualStyleBackColor = true; 125 | this.ConvertStamina.Click += new System.EventHandler(this.ConvertStamina_Click); 126 | // 127 | // RefreshBtn 128 | // 129 | this.RefreshBtn.Location = new System.Drawing.Point(491, 321); 130 | this.RefreshBtn.Name = "RefreshBtn"; 131 | this.RefreshBtn.Size = new System.Drawing.Size(75, 26); 132 | this.RefreshBtn.TabIndex = 9; 133 | this.RefreshBtn.Text = "Refresh"; 134 | this.RefreshBtn.UseVisualStyleBackColor = true; 135 | this.RefreshBtn.Click += new System.EventHandler(this.RefreshBtn_Click); 136 | // 137 | // TotalStep 138 | // 139 | this.TotalStep.AutoSize = true; 140 | this.TotalStep.Location = new System.Drawing.Point(490, 73); 141 | this.TotalStep.Name = "TotalStep"; 142 | this.TotalStep.Size = new System.Drawing.Size(59, 12); 143 | this.TotalStep.TabIndex = 10; 144 | this.TotalStep.Text = "TotalStep"; 145 | // 146 | // ArcaeaParty 147 | // 148 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 149 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 150 | this.ClientSize = new System.Drawing.Size(578, 447); 151 | this.Controls.Add(this.TotalStep); 152 | this.Controls.Add(this.RefreshBtn); 153 | this.Controls.Add(this.ConvertStamina); 154 | this.Controls.Add(this.Character); 155 | this.Controls.Add(this.Stamina); 156 | this.Controls.Add(this.DoParty); 157 | this.Controls.Add(this.label2); 158 | this.Controls.Add(this.label1); 159 | this.Controls.Add(this.StepList); 160 | this.Controls.Add(this.CurrentMap); 161 | this.Controls.Add(this.WorldMapTree); 162 | this.MaximumSize = new System.Drawing.Size(594, 486); 163 | this.MinimumSize = new System.Drawing.Size(594, 486); 164 | this.Name = "ArcaeaParty"; 165 | this.Text = "Arcaea Party"; 166 | this.ResumeLayout(false); 167 | this.PerformLayout(); 168 | 169 | } 170 | 171 | #endregion 172 | 173 | private System.Windows.Forms.TreeView WorldMapTree; 174 | private System.Windows.Forms.Label CurrentMap; 175 | private System.Windows.Forms.ListView StepList; 176 | private System.Windows.Forms.Label label1; 177 | private System.Windows.Forms.Label label2; 178 | private System.Windows.Forms.Button DoParty; 179 | private System.Windows.Forms.Label Stamina; 180 | private System.Windows.Forms.Label Character; 181 | private System.Windows.Forms.Button ConvertStamina; 182 | private System.Windows.Forms.Button RefreshBtn; 183 | private System.Windows.Forms.Label TotalStep; 184 | } 185 | } 186 | 187 | -------------------------------------------------------------------------------- /ArcaeaParty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Net.Http; 9 | using System.Security.Cryptography; 10 | using System.Text; 11 | using System.Threading; 12 | using System.Threading.Tasks; 13 | using System.Windows.Forms; 14 | using Newtonsoft.Json; 15 | using Newtonsoft.Json.Linq; 16 | 17 | namespace ArcaeaParty 18 | { 19 | public partial class ArcaeaParty : Form 20 | { 21 | const string AppVersion = "2.3.0"; 22 | const string DeviceId = "<---->"; 23 | 24 | private HttpClient client = new HttpClient(); 25 | private string AccessToken = "<---->"; 26 | private string ArcApiEndpoint = "https://arcapi.lowiro.com/7/"; 27 | private string currentMapId = null; 28 | private Dictionary worldMaps = new Dictionary(); 29 | private int remainStamina; 30 | 31 | delegate void JObjectReceiver(JObject j); 32 | delegate void StringReceiver(string s); 33 | 34 | public ArcaeaParty() 35 | { 36 | InitializeComponent(); 37 | client.BaseAddress = new Uri(ArcApiEndpoint); 38 | Initialize(); 39 | } 40 | 41 | public async void Initialize() 42 | { 43 | //PlayNormal(); 44 | await Login("iAmNotCheater", "iAmNotCheater"); 45 | //await SelfDestruct(); 46 | string songToken = await GetSongToken(); //获取一个提交的令牌 47 | await SubmitScore(songToken, GetSongHash("onelastdrive"), "onelastdrive", 885); //提交成绩 48 | 49 | JObject userInfo = await GetUserInfo(); 50 | Invoke(new JObjectReceiver(UpdateUserInfo), userInfo); 51 | JObject allMapList = await GetAllMapList(); 52 | WorldMapTree.Invoke(new JObjectReceiver(UpdateWorldMapTree), allMapList); 53 | new Thread(AutoPlay).Start(); 54 | } 55 | 56 | public async Task SelfDestruct() 57 | { 58 | string songToken = await GetSongToken(); 59 | await SubmitScore(songToken, "dcaffc07096884df87cb8533c3746ba5", "grievouslady", 1450); 60 | songToken = await GetSongToken(); 61 | await SubmitScore(songToken, "dcaffc07096884df87cb8533c3746ba5", "grievouslady", 1450); 62 | songToken = await GetSongToken(); 63 | await SubmitScore(songToken, "dcaffc07096884df87cb8533c3746ba5", "grievouslady", 1450); 64 | } 65 | public async Task Login(string name, string password) 66 | { 67 | client.DefaultRequestHeaders.Clear(); 68 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{name}:{password}"))); 69 | client.DefaultRequestHeaders.TryAddWithoutValidation("DeviceId", DeviceId); 70 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 71 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); Dictionary keyValuePairs = new Dictionary(); 72 | 73 | keyValuePairs.Add("grant_type", "client_credentials"); 74 | FormUrlEncodedContent formUrlEncodedContent = new FormUrlEncodedContent(keyValuePairs); 75 | 76 | HttpResponseMessage response = await client.PostAsync("auth/login", formUrlEncodedContent); 77 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 78 | 79 | if (json.ContainsKey("success") && (((bool)json["success"]) == true)) 80 | { 81 | AccessToken = (string)json["access_token"]; 82 | } 83 | } 84 | public async Task GetUserInfo() 85 | { 86 | client.DefaultRequestHeaders.Clear(); 87 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 88 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 89 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 90 | 91 | HttpResponseMessage response = await client.GetAsync("user/me"); 92 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 93 | 94 | return json; 95 | } 96 | public async Task SetCurrentCharactor(int id) 97 | { 98 | client.DefaultRequestHeaders.Clear(); 99 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 100 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 101 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 102 | 103 | Dictionary keyValuePairs = new Dictionary 104 | { 105 | { "character", id.ToString() }, 106 | { "skill_sealed", "false" } 107 | }; 108 | 109 | FormUrlEncodedContent formUrlEncodedContent = new FormUrlEncodedContent(keyValuePairs); 110 | HttpResponseMessage response = await client.PostAsync("world/map/me", formUrlEncodedContent); 111 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 112 | 113 | return json; 114 | } 115 | public async Task SetCurrentMap(string mapid) 116 | { 117 | client.DefaultRequestHeaders.Clear(); 118 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 119 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 120 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 121 | 122 | Dictionary keyValuePairs = new Dictionary 123 | { 124 | { "map_id", mapid } 125 | }; 126 | 127 | FormUrlEncodedContent formUrlEncodedContent = new FormUrlEncodedContent(keyValuePairs); 128 | HttpResponseMessage response = await client.PostAsync("world/map/me", formUrlEncodedContent); 129 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 130 | 131 | return json; 132 | } 133 | public async Task GetAllMapList() 134 | { 135 | client.DefaultRequestHeaders.Clear(); 136 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 137 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 138 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 139 | 140 | HttpResponseMessage response = await client.GetAsync("world/map/me"); 141 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 142 | 143 | return json; 144 | } 145 | public async Task GetSpecificMap(string mapid) 146 | { 147 | client.DefaultRequestHeaders.Clear(); 148 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 149 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 150 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 151 | 152 | HttpResponseMessage response = await client.GetAsync($"world/map/me/{mapid}"); 153 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 154 | 155 | return json; 156 | } 157 | public async Task GetWorldRanking(string songid) 158 | { 159 | client.DefaultRequestHeaders.Clear(); 160 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 161 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 162 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 163 | 164 | HttpResponseMessage response = await client.GetAsync($"score/song?song_id={songid}&difficulty=2&start=0&limit=10"); 165 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 166 | 167 | return json; 168 | } 169 | public async Task GetSongToken() 170 | { 171 | client.DefaultRequestHeaders.Clear(); 172 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 173 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 174 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 175 | 176 | HttpResponseMessage response = await client.GetAsync("score/token"); 177 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 178 | 179 | if (json.ContainsKey("success") && (((bool)json["success"]) == true)) 180 | { 181 | return (string)json["value"]["token"]; 182 | } 183 | 184 | return null; 185 | } 186 | public async Task GetWorldSongToken(string songid) 187 | { 188 | client.DefaultRequestHeaders.Clear(); 189 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 190 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 191 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 192 | 193 | HttpResponseMessage response = await client.GetAsync($"score/token/world?songid={songid}&difficulty=2"); 194 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 195 | 196 | return json; 197 | } 198 | public async Task ConvertFragmentStamina() 199 | { 200 | client.DefaultRequestHeaders.Clear(); 201 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 202 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 203 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 204 | 205 | StringContent st = new StringContent(""); 206 | 207 | HttpResponseMessage response = await client.PostAsync("purchase/me/stamina/fragment", st); 208 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 209 | 210 | return json; 211 | } 212 | public async Task SubmitScore(string songToken, string songHash, string songid, int noteCount, int shiny = 0) 213 | { 214 | client.DefaultRequestHeaders.Clear(); 215 | client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", AccessToken); 216 | client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 217 | client.DefaultRequestHeaders.TryAddWithoutValidation("AppVersion", AppVersion); 218 | 219 | Dictionary keyValuePairs = new Dictionary 220 | { 221 | { "song_token", songToken }, 222 | {"song_hash", songHash}, 223 | {"song_id" ,songid}, 224 | {"difficulty", "2" }, 225 | {"score", (10000000 + shiny).ToString("D8")}, 226 | {"shiny_perfect_count",shiny.ToString() }, 227 | {"perfect_count",noteCount.ToString() }, 228 | {"near_count", "0"}, 229 | {"miss_count","0" }, 230 | {"health","100" }, 231 | {"modifier","0" }, 232 | }; 233 | 234 | string toHash = $"{songToken}{songHash}{songid}2{keyValuePairs["score"]}{keyValuePairs["shiny_perfect_count"]}{keyValuePairs["perfect_count"]}001000moeuguu"; 235 | string submissionHash = BitConverter.ToString(MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(toHash))).Replace("-", "").ToLower(); 236 | keyValuePairs.Add("submission_hash", submissionHash); 237 | 238 | FormUrlEncodedContent formUrlEncodedContent = new FormUrlEncodedContent(keyValuePairs); 239 | 240 | HttpResponseMessage response = await client.PostAsync("score/song", formUrlEncodedContent); 241 | JObject json = (JObject)JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); 242 | 243 | return json; 244 | } 245 | 246 | public string GetSongHash(string songid) 247 | { 248 | string text = File.ReadAllText(@"H:\Arcaea\arcaea_1.9.0c\assets\songs\" + songid + @"\2.aff"); 249 | return BitConverter.ToString(MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(text))).Replace("-", "").ToLower(); 250 | } 251 | public async void SetCurrentMapId(string mapId) 252 | { 253 | currentMapId = mapId; 254 | CurrentMap.Text = mapId; 255 | JObject mapInfo = await GetSpecificMap(mapId); 256 | WorldMapTree.Invoke(new JObjectReceiver(UpdateCurrentMap), mapInfo); 257 | } 258 | public async void PlayParty() 259 | { 260 | string songid = "flyburg"; 261 | int noteCount = (await GetWorldRanking(songid))["value"][0]["perfect_count"].Value(); 262 | string hash = GetSongHash(songid); 263 | Step s = worldMaps[currentMapId].steps[worldMaps[currentMapId].curr_position]; 264 | if (s.restrict_type != null) 265 | { 266 | switch (s.restrict_type) 267 | { 268 | case "song_id": 269 | songid = s.restrict_id; 270 | hash = GetSongHash(songid); 271 | noteCount = (await GetWorldRanking(songid))["value"][0]["perfect_count"].Value(); 272 | break; 273 | case "pack_id": 274 | songid = "merlin"; 275 | hash = GetSongHash(songid); 276 | noteCount = (await GetWorldRanking(songid))["value"][0]["perfect_count"].Value(); 277 | break; 278 | default: 279 | MessageBox.Show("Restriction:\n" + s.restrict_type + "\n" + s.restrict_id); 280 | return; 281 | } 282 | } 283 | JObject j = await GetWorldSongToken(songid); 284 | remainStamina = j["value"]["stamina"].Value(); 285 | string token = j["value"]["token"].Value(); 286 | JObject j2 = await SubmitScore(token, hash, songid, noteCount); 287 | JObject userInfo = await GetUserInfo(); 288 | Invoke(new JObjectReceiver(UpdateUserInfo), userInfo); 289 | JObject mapInfo = await GetSpecificMap(currentMapId); 290 | WorldMapTree.Invoke(new JObjectReceiver(UpdateCurrentMap), mapInfo); 291 | } 292 | public async void ConvertStaminaAsync() 293 | { 294 | await ConvertFragmentStamina(); 295 | JObject userInfo = await GetUserInfo(); 296 | Invoke(new JObjectReceiver(UpdateUserInfo), userInfo); 297 | } 298 | public async void RefreshAsync() 299 | { 300 | JObject userInfo = await GetUserInfo(); 301 | Invoke(new JObjectReceiver(UpdateUserInfo), userInfo); 302 | } 303 | public async void PlayNormal() 304 | { 305 | string songid = "onelastdrive"; 306 | int noteCount = (await GetWorldRanking(songid))["value"][0]["perfect_count"].Value(); 307 | string hash = GetSongHash(songid); 308 | string token = await GetSongToken(); 309 | JObject j2 = await SubmitScore(token, hash, songid, noteCount, 755); 310 | bool succeed = true; 311 | } 312 | 313 | public void UpdateWorldMapTree(JObject j) 314 | { 315 | WorldMapTree.BeginUpdate(); 316 | 317 | SetCurrentMapId(j["value"]["current_map"].Value()); 318 | List maps = new List(); 319 | foreach (var map in j["value"]["maps"]) 320 | { 321 | maps.Add(map.ToObject()); 322 | } 323 | 324 | WorldMapTree.Nodes.Clear(); 325 | worldMaps.Clear(); 326 | 327 | try 328 | { 329 | List<(TreeNode, int)> roots = new List<(TreeNode, int)>(); 330 | 331 | foreach (var m in maps) 332 | { 333 | if (roots.Where((b) => b.Item2 == m.chapter).Count() == 0) 334 | { 335 | roots.Add((new TreeNode(m.chapter.ToString()), m.chapter)); 336 | } 337 | var node = roots.Where((b) => b.Item2 == m.chapter).ToArray()[0].Item1.Nodes.Add(m.map_id); 338 | worldMaps.Add(m.map_id, m); 339 | } 340 | 341 | roots.Sort(((TreeNode, int) a, (TreeNode, int) b) => a.Item2.CompareTo(b.Item2)); 342 | foreach (var root in roots) WorldMapTree.Nodes.Add(root.Item1); 343 | } 344 | catch (Exception Ex) 345 | { 346 | MessageBox.Show(Ex.ToString()); 347 | WorldMapTree.Nodes.Clear(); 348 | worldMaps.Clear(); 349 | } 350 | 351 | WorldMapTree.EndUpdate(); 352 | } 353 | public void UpdateCurrentMap(JObject j) 354 | { 355 | WorldMap map = j["value"]["maps"][0].ToObject(); 356 | worldMaps[currentMapId] = map; 357 | 358 | StepList.BeginUpdate(); 359 | 360 | StepList.Clear(); 361 | 362 | try 363 | { 364 | List steps = map.steps.ToList(); 365 | steps.Sort((Step a, Step b) => a.position.CompareTo(b.position)); 366 | 367 | foreach (Step step in steps) 368 | { 369 | StepList.Items.Add($"{step.position} {(map.curr_position == step.position ? step.capture - map.curr_capture : (map.curr_position > step.position ? 0 : step.capture)).ToString("f1")}/{step.capture.ToString("f1")}"); 370 | } 371 | 372 | StepList.EnsureVisible(map.curr_position); 373 | StepList.Items[map.curr_position].Selected = true; 374 | StepList.Select(); 375 | } 376 | catch (Exception Ex) 377 | { 378 | MessageBox.Show(Ex.ToString()); 379 | StepList.Clear(); 380 | } 381 | 382 | StepList.EndUpdate(); 383 | 384 | TotalStep.Text = map.steps.Sum((s) => s.capture).ToString(); 385 | } 386 | public void UpdateUserInfo(JObject j) 387 | { 388 | if (j["value"].Contains("curr_ts")) 389 | { 390 | long curr_ts = j["value"]["curr_ts"].Value(); 391 | long next_convert = j["value"]["next_fragstam_ts"].Value(); 392 | ConvertStamina.Enabled = curr_ts > next_convert; 393 | remainStamina = j["value"]["stamina"].Value(); 394 | Stamina.Text = remainStamina.ToString(); 395 | Character.Text = j["value"]["character"].Value().ToString(); 396 | } 397 | } 398 | 399 | private async void OnWorldMapTreeSelect(object sender, TreeViewEventArgs e) 400 | { 401 | if (!worldMaps.ContainsKey(e.Node.Text)) return; 402 | WorldMap map = worldMaps[e.Node.Text]; 403 | JObject ret = await SetCurrentMap(e.Node.Text); 404 | if (!ret["success"].Value()) return; 405 | SetCurrentMapId(e.Node.Text); 406 | } 407 | 408 | private async void AutoPlay() 409 | { 410 | while (true) 411 | { 412 | try 413 | { 414 | string songid = "flyburg"; 415 | int noteCount = (await GetWorldRanking(songid))["value"][0]["perfect_count"].Value(); 416 | string hash = GetSongHash(songid); 417 | Step s = worldMaps[currentMapId].steps[worldMaps[currentMapId].curr_position]; 418 | if (s.restrict_type != null) 419 | { 420 | switch (s.restrict_type) 421 | { 422 | case "song_id": 423 | songid = s.restrict_id; 424 | hash = GetSongHash(songid); 425 | noteCount = (await GetWorldRanking(songid))["value"][0]["perfect_count"].Value(); 426 | break; 427 | default: 428 | MessageBox.Show("Restriction:\n" + s.restrict_type + "\n" + s.restrict_id); 429 | return; 430 | } 431 | } 432 | JObject j = await GetWorldSongToken(songid); 433 | remainStamina = j["value"]["stamina"].Value(); 434 | string token = j["value"]["token"].Value(); 435 | JObject j2 = await SubmitScore(token, hash, songid, noteCount); 436 | JObject userInfo = await GetUserInfo(); 437 | Invoke(new JObjectReceiver(UpdateUserInfo), userInfo); 438 | JObject mapInfo = await GetSpecificMap(currentMapId); 439 | WorldMapTree.Invoke(new JObjectReceiver(UpdateCurrentMap), mapInfo); 440 | } 441 | catch (Exception) 442 | { 443 | } 444 | Thread.Sleep(1000 * 60 * 60 * 2 + 3000); 445 | } 446 | } 447 | private void ConvertStamina_Click(object sender, EventArgs e) 448 | { 449 | ConvertStaminaAsync(); 450 | } 451 | private void DoParty_Click(object sender, EventArgs e) 452 | { 453 | PlayParty(); 454 | } 455 | private void RefreshBtn_Click(object sender, EventArgs e) 456 | { 457 | RefreshAsync(); 458 | } 459 | } 460 | } 461 | -------------------------------------------------------------------------------- /ArcaeaParty.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {3BF385D4-9C11-40E1-B085-D41EBC457894} 8 | WinExe 9 | ArcaeaParty 10 | ArcaeaParty 11 | v4.7.1 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 37 | False 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Form 54 | 55 | 56 | ArcaeaParty.cs 57 | 58 | 59 | 60 | 61 | 62 | ArcaeaParty.cs 63 | 64 | 65 | ResXFileCodeGenerator 66 | Resources.Designer.cs 67 | Designer 68 | 69 | 70 | True 71 | Resources.resx 72 | 73 | 74 | 75 | SettingsSingleFileGenerator 76 | Settings.Designer.cs 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ArcaeaParty.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 | -------------------------------------------------------------------------------- /Classes.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 ArcaeaParty 8 | { 9 | [Serializable] 10 | public class RewardItem 11 | { 12 | public string id; 13 | public string type; 14 | } 15 | [Serializable] 16 | public class Reward 17 | { 18 | public RewardItem[] items; 19 | public int position; 20 | } 21 | [Serializable] 22 | public class Step 23 | { 24 | public int position; 25 | public double capture; 26 | public string restrict_id; 27 | public string restrict_type; 28 | } 29 | [Serializable] 30 | public class WorldMap 31 | { 32 | public string map_id; 33 | public int chapter; 34 | public long available_from; 35 | public long available_to; 36 | public bool is_repeatable; 37 | public string require_id; 38 | public string require_type; 39 | public int require_value; 40 | public string coordinate; 41 | public int step_count; 42 | public int stamina_cost; 43 | public string custom_bg; 44 | public bool is_available; 45 | public bool is_legacy; 46 | public int curr_position; 47 | public double curr_capture; 48 | public bool is_locked; 49 | public Reward[] rewards; 50 | public Step[] steps; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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 ArcaeaParty 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 ArcaeaParty()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ArcaeaParty")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ArcaeaParty")] 13 | [assembly: AssemblyCopyright("Copyright © 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("3bf385d4-9c11-40e1-b085-d41ebc457894")] 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 | -------------------------------------------------------------------------------- /Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ArcaeaParty.Properties 12 | { 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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ArcaeaParty.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ArcaeaParty.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | "发现与公布问题是为了防止有人将问题用于不法用途" 2 | 3 | ArcaeaParty 是早期研究的结果,其目的是实现自动爬梯,通过提交虚假的成绩结果,欺骗服务器进行结算,达到目的。 4 | 5 | 众所周知,现在有越来越多的人使用软件提交虚假成绩,排行榜上甚至出现Lost为负数的情况,我觉得这样的排行榜也没有什么意义。 6 | 7 | 正如lowiro很早以前和我说过,如果我公开的话,他们会考虑关闭排行榜功能。我同意了他的想法,他也承诺做出改进。一个月后,在服务端加了一些校验。但事实上没有什么用,我现在觉得关闭就关闭吧。 8 | 9 | 当然,我们也知道,没有任何加密手段可以完全防止作弊行为。但是鄙人觉得攻与防是一个动态的过程,因为你的游戏火爆,自然有人发起进攻,不作为自然是你的失职。 10 | 11 | 此程序代码不保证可以运行,请利用者自行分析处理,所作违法用途与作者无关。 12 | 13 | 14 | "Making an exploit public is to prevent someone taking advantage of it" 15 | 16 | ArcaeaParty is my early research on Arcaea's web service. This piece of code was aimed to climb event ladder automatically, by submitting fake results to fool the server. 17 | 18 | As we know, more and more people (in China, don't know the situation in other regions) use software to submit fake results. 19 | 20 | There are some results even has a negative 'Lost' count which is really bull shit. I think this kind of leaderboard is meaningless if lowiro doesn't make change. 21 | 22 | Last year, when i submit this to lowiro, they want me to keep this as a secret, otherwise they may consider closing the leaderboard. 23 | 24 | But since i am (obviously) not the only one capable of creating this secret, and the leaderboard, in my opinion, doesn't matter even they actually shut it down. 25 | 26 | Of cource, there is no such method that can prevent all cheating behaviours, but i think 'attack' and 'defence' should be progressive. Because your game is very hot around the world, there must be someone try to attack your system, and you should improve your defence. 27 | 28 | This program is not guaranteed to be operational, the user should analyse it. I am not responsible for any illegal usage. 29 | 30 | Please forgive my poor english. -------------------------------------------------------------------------------- /packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------