Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.25 KB | None | 0 0
  1. public Bitmap resizeicon(int index)
  2. {
  3. Bitmap result;
  4. using (WebResponse response = WebRequest.Create("http://www.margonem.pl/obrazki/postacie/" + this.staty[index][8]).GetResponse())
  5. {
  6. using (Stream responseStream = response.GetResponseStream())
  7. {
  8. Image image = Image.FromStream(responseStream);
  9. result = new Bitmap(image, Convert.ToInt32((double)image.Width * 1.5), Convert.ToInt32((double)image.Height * 1.5));
  10. }
  11. }
  12. return result;
  13. }
  14.  
  15. // Token: 0x06000038 RID: 56 RVA: 0x00003B3C File Offset: 0x00001D3C
  16. public static string Mucka()
  17. {
  18. return new Random().ToString();
  19. }
  20.  
  21. // Token: 0x06000039 RID: 57 RVA: 0x00003B48 File Offset: 0x00001D48
  22. public void relog()
  23. {
  24. try
  25. {
  26. CookieContainer cookieContainer = new CookieContainer();
  27. HttpClient httpClient = new HttpClient(new HttpClientHandler
  28. {
  29. CookieContainer = cookieContainer
  30. });
  31. httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Dalvik/1.6.0 (Linux; U; Android 4.4.2; GT-I9500 Build/KOT49H)");
  32. Uri uri = new Uri("http://" + this.staty[this.data][3] + ".margonem.pl");
  33. for (int i = 0; i < this.cvalue.Length; i++)
  34. {
  35. cookieContainer.Add(uri, new Cookie(this.cname[i], this.cvalue[i]));
  36. }
  37. cookieContainer.Add(uri, new Cookie("mchar_id", this.staty[this.data][0]));
  38. HttpResponseMessage result = httpClient.GetAsync(string.Concat(new string[]
  39. {
  40. "http://",
  41. this.staty[this.data][3],
  42. ".margonem.pl/engine?t=init&initlvl=1&mucka=",
  43. this.mucka,
  44. "&mobile=1"
  45. })).Result;
  46. }
  47. catch (Exception)
  48. {
  49. this.relog();
  50. }
  51. }
  52.  
  53. // Token: 0x0600003A RID: 58 RVA: 0x00003C68 File Offset: 0x00001E68
  54. public async void relog2()
  55. {
  56. int num = 0;
  57. try
  58. {
  59. CookieContainer cookieContainer = new CookieContainer();
  60. HttpClient httpClient = new HttpClient(new HttpClientHandler
  61. {
  62. CookieContainer = cookieContainer
  63. });
  64. httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Dalvik/1.6.0 (Linux; U; Android 4.4.2; GT-I9500 Build/KOT49H)");
  65. Uri uri = new Uri("http://" + this.staty[this.expchar][3] + ".margonem.pl");
  66. for (int i = 0; i < this.cvalue.Length; i++)
  67. {
  68. cookieContainer.Add(uri, new Cookie(this.cname[i], this.cvalue[i]));
  69. }
  70. cookieContainer.Add(uri, new Cookie("mchar_id", this.staty[this.expchar][0]));
  71. HttpResponseMessage result = httpClient.GetAsync(string.Concat(new string[]
  72. {
  73. "http://",
  74. this.staty[this.expchar][3],
  75. ".margonem.pl/engine?t=init&initlvl=1&mucka=",
  76. this.savemucka[this.expchar][0],
  77. "&mobile=1"
  78. })).Result;
  79. this.Request();
  80. }
  81. catch (Exception)
  82. {
  83. num = 1;
  84. }
  85. if (num == 1)
  86. {
  87. await Task.Delay(1000);
  88. this.relog1();
  89. }
  90. }
  91.  
  92. // Token: 0x0600003B RID: 59 RVA: 0x00003CA4 File Offset: 0x00001EA4
  93. public async void getnormalmaps()
  94. {
  95. int num = 0;
  96. try
  97. {
  98. CookieContainer cookieContainer = new CookieContainer();
  99. HttpClient httpClient = new HttpClient(new HttpClientHandler
  100. {
  101. CookieContainer = cookieContainer
  102. });
  103. httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Dalvik/1.6.0 (Linux; U; Android 4.4.2; GT-I9500 Build/KOT49H)");
  104. Uri uri = new Uri("http://" + this.staty[this.data][3] + ".margonem.pl");
  105. for (int i = 0; i < this.cvalue.Length; i++)
  106. {
  107. cookieContainer.Add(uri, new Cookie(this.cname[i], this.cvalue[i]));
  108. }
  109. this.mucka = GMargonem.Mucka();
  110. this.savemucka[this.data].Add(this.mucka);
  111. cookieContainer.Add(uri, new Cookie("mchar_id", this.staty[this.data][0]));
  112. JObject jobject = JObject.Parse(httpClient.GetAsync(string.Concat(new string[]
  113. {
  114. "http://",
  115. this.staty[this.data][3],
  116. ".margonem.pl/engine?t=init&initlvl=1&mucka=",
  117. this.mucka,
  118. "&mobile=1"
  119. })).Result.Content.ReadAsStringAsync().Result);
  120. this.tokenmap = jobject["mobile_token"].ToString();
  121. string result = httpClient.GetAsync(string.Concat(new string[]
  122. {
  123. "http://",
  124. this.staty[this.data][3],
  125. ".margonem.pl/engine?t=init&initlvl=2&mucka=",
  126. this.mucka,
  127. "&mobile=1&mobile_token=",
  128. GMargonem.Md5(this.tokenmap, "humantorch-")
  129. })).Result.Content.ReadAsStringAsync().Result;
  130. JObject json = JObject.Parse(result);
  131. if (json.ToString().Contains("Przerwa"))
  132. {
  133. this.logintexte.Text = "Technical Break. Please try again later.";
  134. this.przerwa = true;
  135. await Task.Delay(4000);
  136. Application.Exit();
  137. }
  138. else if (json.ToString().Contains("zalogowany"))
  139. {
  140. this.logintexte.Text = "User is not logged in! Exiting.";
  141. this.przerwa = true;
  142. await Task.Delay(2000);
  143. Application.Exit();
  144. }
  145. else if (json.ToString().Contains("wait_for") || json.ToString().Contains("stop"))
  146. {
  147. this.getnormalmaps();
  148. }
  149. else
  150. {
  151. this.nmaps[this.data] = new List<string>();
  152. bool flag = true;
  153. for (int j = 0; j < this.mapynormal.Length; j++)
  154. {
  155. if (flag)
  156. {
  157. this.nmaps[this.data].Add(json["mobile_maps"][this.mapynormal[j]]["name"].ToString());
  158. this.nmaps[this.data].Add(this.mapynormal[j]);
  159. }
  160. flag = Extensions.Value<bool>(json["mobile_maps"][this.mapynormal[j]]["done"]);
  161. }
  162. }
  163. json = null;
  164. }
  165. catch (Exception)
  166. {
  167. num = 1;
  168. }
  169. if (num == 1)
  170. {
  171. await Task.Delay(1500);
  172. this.getnormalmaps();
  173. }
  174. }
  175.  
  176. // Token: 0x0600003C RID: 60 RVA: 0x00003CE0 File Offset: 0x00001EE0
  177. private void addedchars_SelectedIndexChanged(object sender, EventArgs e)
  178. {
  179. this.poz = this.addedchars.SelectedIndex;
  180. this.normalmaps.Items.Clear();
  181. int num = 0;
  182. int count = this.nmaps[this.poz].Count;
  183. for (int i = 0; i < count / 2; i++)
  184. {
  185. this.normalmaps.Items.Add(this.nmaps[this.poz][num]);
  186. num += 2;
  187. }
  188. if (this.dodano[this.poz].Contains("true"))
  189. {
  190. this.normalmaps.SelectedIndex = int.Parse(this.mapsid[this.poz][1]);
  191. }
  192. this.getsettings();
  193. this.arrowclass();
  194. }
  195.  
  196. // Token: 0x0600003D RID: 61 RVA: 0x00003DA4 File Offset: 0x00001FA4
  197. private void gettoken()
  198. {
  199. try
  200. {
  201. this.dead = false;
  202. this.deadtime = 0;
  203. CookieContainer cookieContainer = new CookieContainer();
  204. HttpClient httpClient = new HttpClient(new HttpClientHandler
  205. {
  206. CookieContainer = cookieContainer
  207. });
  208. httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Dalvik/1.6.0 (Linux; U; Android 4.4.2; GT-I9500 Build/KOT49H)");
  209. Uri uri = new Uri("http://" + this.staty[this.expchar][3] + ".margonem.pl");
  210. for (int i = 0; i < this.cvalue.Length; i++)
  211. {
  212. cookieContainer.Add(uri, new Cookie(this.cname[i], this.cvalue[i]));
  213. }
  214. cookieContainer.Add(uri, new Cookie("mchar_id", this.staty[this.expchar][0]));
  215. JObject jobject = JObject.Parse(httpClient.GetAsync(string.Concat(new string[]
  216. {
  217. "http://",
  218. this.staty[this.expchar][3],
  219. ".margonem.pl/engine?t=init&initlvl=1&mucka=",
  220. this.savemucka[this.expchar][0],
  221. "&mobile=1"
  222. })).Result.Content.ReadAsStringAsync().Result);
  223. if (jobject.ToString().Contains("stop"))
  224. {
  225. this.relogbool = true;
  226. }
  227. else if (jobject.ToString().Contains("dead"))
  228. {
  229. this.dead = true;
  230. this.deadtime = (int.Parse(jobject["dead"].ToString()) + 50) / 60;
  231. }
  232. else
  233. {
  234. this.token1 = jobject["mobile_token"].ToString();
  235. }
  236. }
  237. catch (Exception)
  238. {
  239. this.relogbool = true;
  240. }
  241. }
  242.  
  243. // Token: 0x0600003E RID: 62 RVA: 0x00003F74 File Offset: 0x00002174
  244. private void getitems()
  245. {
  246. try
  247. {
  248. this.iloscpotek = 0;
  249. this.potvalue = 0;
  250. this.arrvalue = 0;
  251. this.ilearrowz = 0;
  252. this.blesstimeleft = 0;
  253. this.ammovalue = 0;
  254. this.usedbless = false;
  255. this.healz.Clear();
  256. this.arrowz.Clear();
  257. this.expbon.Clear();
  258. CookieContainer cookieContainer = new CookieContainer();
  259. HttpClient httpClient = new HttpClient(new HttpClientHandler
  260. {
  261. CookieContainer = cookieContainer
  262. });
  263. httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Dalvik/1.6.0 (Linux; U; Android 4.4.2; GT-I9500 Build/KOT49H)");
  264. Uri uri = new Uri("http://" + this.staty[this.expchar][3] + ".margonem.pl");
  265. for (int i = 0; i < this.cvalue.Length; i++)
  266. {
  267. cookieContainer.Add(uri, new Cookie(this.cname[i], this.cvalue[i]));
  268. }
  269. cookieContainer.Add(uri, new Cookie("mchar_id", this.staty[this.expchar][0]));
  270. JObject jobject = JObject.Parse(httpClient.GetAsync(string.Concat(new string[]
  271. {
  272. "http://",
  273. this.staty[this.expchar][3],
  274. ".margonem.pl/engine?t=init&initlvl=3&mucka=",
  275. this.savemucka[this.expchar][0],
  276. "&mobile=1&mobile_token=",
  277. GMargonem.Md5(this.token1, "humantorch-")
  278. })).Result.Content.ReadAsStringAsync().Result);
  279. if (jobject.ToString().Contains("leczy") || jobject.ToString().Contains("ammo") || jobject.ToString().Contains("npc_expbon"))
  280. {
  281. object arg = JsonConvert.DeserializeObject<GMargonem.Inventory>(jobject.ToString());
  282. if (GMargonem.<>o__133.<>p__1 == null)
  283. {
  284. GMargonem.<>o__133.<>p__1 = CallSite<Func<CallSite, object, IEnumerable>>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(IEnumerable), typeof(GMargonem)));
  285. }
  286. Func<CallSite, object, IEnumerable> target = GMargonem.<>o__133.<>p__1.Target;
  287. CallSite <>p__ = GMargonem.<>o__133.<>p__1;
  288. if (GMargonem.<>o__133.<>p__0 == null)
  289. {
  290. GMargonem.<>o__133.<>p__0 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "Item", typeof(GMargonem), new CSharpArgumentInfo[]
  291. {
  292. CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
  293. }));
  294. }
  295. using (IEnumerator enumerator = target(<>p__, GMargonem.<>o__133.<>p__0.Target(GMargonem.<>o__133.<>p__0, arg)).GetEnumerator())
  296. {
  297. while (enumerator.MoveNext())
  298. {
  299. if (GMargonem.<>o__133.<>p__2 == null)
  300. {
  301. GMargonem.<>o__133.<>p__2 = CallSite<Func<CallSite, object, KeyValuePair<string, GMargonem.Itemz>>>.Create(Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof(KeyValuePair<string, GMargonem.Itemz>), typeof(GMargonem)));
  302. }
  303. KeyValuePair<string, GMargonem.Itemz> keyValuePair = GMargonem.<>o__133.<>p__2.Target(GMargonem.<>o__133.<>p__2, enumerator.Current);
  304. if (this.staty[this.expchar][9] == "h" || this.staty[this.expchar][9] == "t")
  305. {
  306. Match match = Regex.Match(keyValuePair.Value.stat, "ammo=(.*?);");
  307. Match match2 = Regex.Match(keyValuePair.Value.stat, "lvl=(.*?);");
  308. if (keyValuePair.Value.st > 0 && match.Success)
  309. {
  310. this.czymastrzaly = true;
  311. }
  312. if (match.Success && keyValuePair.Value.st == 0)
  313. {
  314. this.ammovalue += int.Parse(match.Groups[1].Value);
  315. if (match2.Success)
  316. {
  317. if (int.Parse(match2.Groups[1].Value) <= int.Parse(this.staty[this.expchar][2]))
  318. {
  319. GMargonem.arrowitem item = new GMargonem.arrowitem
  320. {
  321. id = int.Parse(keyValuePair.Key),
  322. val = int.Parse(match.Groups[1].Value)
  323. };
  324. this.arrowz.Add(item);
  325. this.ilearrowz++;
  326. }
  327. }
  328. else
  329. {
  330. GMargonem.arrowitem item2 = new GMargonem.arrowitem
  331. {
  332. id = int.Parse(keyValuePair.Key),
  333. val = int.Parse(match.Groups[1].Value)
  334. };
  335. this.arrowz.Add(item2);
  336. this.ilearrowz++;
  337. }
  338. }
  339. this.arrowsleft.Text = this.ammovalue.ToString();
  340. }
  341. else
  342. {
  343. this.arrowsleft.Text = "-";
  344. }
  345. Match match3 = Regex.Match(keyValuePair.Value.stat, "leczy=(.*?);");
  346. Match match4 = Regex.Match(keyValuePair.Value.stat, "amount=(.*?);");
  347. Match match5 = Regex.Match(keyValuePair.Value.stat, "leczy=(.*)");
  348. if (match4.Success)
  349. {
  350. this.potsamount += int.Parse(match4.Groups[1].Value);
  351. }
  352. if (match3.Success && match4.Success)
  353. {
  354. GMargonem.healitem item3 = new GMargonem.healitem
  355. {
  356. amount = int.Parse(match4.Groups[1].Value),
  357. heal = int.Parse(match3.Groups[1].Value),
  358. id = int.Parse(keyValuePair.Key)
  359. };
  360. this.healz.Add(item3);
  361. this.iloscpotek++;
  362. }
  363. else if (match5.Success && match4.Success)
  364. {
  365. GMargonem.healitem item4 = new GMargonem.healitem
  366. {
  367. amount = int.Parse(match4.Groups[1].Value),
  368. heal = int.Parse(match5.Groups[1].Value),
  369. id = int.Parse(keyValuePair.Key)
  370. };
  371. this.healz.Add(item4);
  372. this.iloscpotek++;
  373. }
  374. Match match6 = Regex.Match(keyValuePair.Value.stat, "npc_expbon=(.*?);");
  375. Match match7 = Regex.Match(keyValuePair.Value.stat, "ttl=(.*)");
  376. Match match8 = Regex.Match(keyValuePair.Value.stat, "amount=(.*?);");
  377. if (match6.Success && match7.Success && match8.Success && keyValuePair.Value.st == 0 && this.ustawienia[this.expchar][5])
  378. {
  379. GMargonem.expbless item5 = new GMargonem.expbless
  380. {
  381. exppercent = int.Parse(match6.Groups[1].Value),
  382. amount = int.Parse(match8.Groups[1].Value),
  383. czas = int.Parse(match7.Groups[1].Value),
  384. id = int.Parse(keyValuePair.Key)
  385. };
  386. this.expbon.Add(item5);
  387. }
  388. else if (match6.Success && match7.Success && match8.Success && keyValuePair.Value.st != 0 && this.ustawienia[this.expchar][5])
  389. {
  390. this.usedbless = true;
  391. this.blesstimeleft = int.Parse(match7.Groups[1].Value);
  392. }
  393. }
  394. goto IL_7B1;
  395. }
  396. }
  397. if (jobject.ToString().Contains("stop"))
  398. {
  399. this.relogbool = true;
  400. }
  401. IL_7B1:;
  402. }
  403. catch (Exception)
  404. {
  405. this.relogbool = true;
  406. }
  407. }
  408.  
  409. // Token: 0x0600003F RID: 63 RVA: 0x00004774 File Offset: 0x00002974
  410. private void getevent()
  411. {
  412. try
  413. {
  414. CookieContainer cookieContainer = new CookieContainer();
  415. HttpClient httpClient = new HttpClient(new HttpClientHandler
  416. {
  417. CookieContainer = cookieContainer
  418. });
  419. httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Dalvik/1.6.0 (Linux; U; Android 4.4.2; GT-I9500 Build/KOT49H)");
  420. Uri uri = new Uri("http://" + this.staty[this.expchar][3] + ".margonem.pl");
  421. for (int i = 0; i < this.cvalue.Length; i++)
  422. {
  423. cookieContainer.Add(uri, new Cookie(this.cname[i], this.cvalue[i]));
  424. }
  425. cookieContainer.Add(uri, new Cookie("mchar_id", this.staty[this.expchar][0]));
  426. JObject jobject = JObject.Parse(httpClient.GetAsync(string.Concat(new string[]
  427. {
  428. "http://",
  429. this.staty[this.expchar][3],
  430. ".margonem.pl/engine?t=init&initlvl=4&mucka=",
  431. this.savemucka[this.expchar][0],
  432. "&mobile=1&mobile_token=",
  433. GMargonem.Md5(this.token1, "humantorch-")
  434. })).Result.Content.ReadAsStringAsync().Result);
  435. if (jobject.ToString().Contains("stop"))
  436. {
  437. this.relogbool = true;
  438. }
  439. else
  440. {
  441. this.ev = jobject["ev"].ToString();
  442. }
  443. }
  444. catch (Exception)
  445. {
  446. this.relogbool = true;
  447. }
  448. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement