Advertisement
Guest User

Untitled

a guest
Aug 5th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.04 KB | None | 0 0
  1. #include <FL/Fl_Window.H>
  2. #include <FL/Fl.H>
  3. #include <FL/Fl_Window.H>
  4. #include <FL/Fl_Box.H>
  5. #include <FL/Fl_Choice.H>
  6. #include <FL/Fl_Button.H>
  7. #include <FL/Fl_Input.H>
  8. #include <FL/Fl_Browser.H>
  9. #include <FL/Fl_Input.H>
  10. #include <FL/Fl_Multiline_Input.H>
  11. #include <FL/x.H>
  12. #include <wininet.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16. #include <time.h>
  17.  
  18. Fl_Box *statusbar;
  19. Fl_Browser *outpackets,*inpackets,*jasonbrowse;
  20. Fl_Input *username,*password,*channel,*inputchat;
  21. Fl_Button *login,*logout,*gochat,*xchat,*sendchat,*onlineScroll;
  22. Fl_Group *logingroup,*chatgroup,*sendgroup,*fungroup;
  23.  
  24. /* Still Not sure how it's generatored */
  25. char csrf_cookie[]={"*WaYiNADWaAe8fC_n0_LE6NksqvfQK4jPk3uiJNJT-kixLk3-2tRrjzvsVOsolgIqJrqbrOl9bB0rIDtrRlhU_6PcUyrwRp_ByX_3y56Q2"};
  26. #include "main.h"
  27. #include "cJSON.h"
  28.  
  29. HINTERNET remote;
  30.  
  31.  
  32. static void login_cb (Fl_Widget *, void *w)
  33. {
  34. char out[100000];
  35. char *response;
  36. /* Create Socket Wireclub */
  37. remote = HTTPSSLOpen("wireclub.com");
  38. if(remote == NULL){statusbar->label("Status: No Connection.");return;}
  39. statusbar->label("Status: Socket Created Successfully.");
  40. Fl::check();
  41. /* Get Cookies From Login Page */
  42. response = LoginPacketGet(remote ,"/login");
  43. if(response == NULL){return;}
  44. statusbar->label("Status: Cookies Successfully Grabbed.");
  45. Fl::check();
  46. /* Login Page With Cookie & User Information */
  47. sprintf(out,"csrf-token=%s&csrf-time=7/1/2018+4:44:48+PM&csrf-user=%s&returnUrl=/&inline=False&Username=%s&Password=%s&TimeZoneOffset=-21600000&Hash=312547393&Script=https://static.wireclub.com/js/p3.58.js&null=Log In",cookie,user,username->value(),password->value());
  48. response = LoginPackePost(remote ,"/account/doLogin", out);
  49. statusbar->label("Status: Successfully Logged In.");
  50. Fl::check();
  51. if(strstr(response,"Wrong username and password combination")!= NULL){MessageBox(0,"Wrong Password","Error",0);GetHTTPTextSSLCleanup(remote);return;}
  52. else{response = GetHTTPTextSSLGet(remote ,"/home?from=login");}
  53.  
  54.  
  55.  
  56. //for(int i=0; i < 70;i++)
  57. //{
  58. /* Chatroom */
  59. //response = GetHTTPTextSSLGet(remote ,"/chat/room/dating_older");
  60. /* Join Update */
  61.  
  62.  
  63. /* Send Text */
  64. //sprintf(out,"/chat/room/dudes/send2?line=hello&sendErrors=0&csrf-token=%s&retry-count=0&_t=%d",cookie,(int)time(NULL));
  65. //char*send_text = GetHTTPTextSSLGet3(remote ,out);
  66. //MessageBox(0,peeps_page,"",0);
  67. /* Leave Room */
  68. //char*leave_page = GetHTTPTextSSLGet3(remote ,"/chat/room/dudes/leaveRoom");
  69. //MessageBox();
  70. //https://www.wireclub.com/chat/room/dudes/removeModerator
  71. //response3 = GetHTTPTextSSLPOST2(remote ,"/chat/room/no__strings__attached/removeModerator","userId=WaYiNADWaAe8fC_n0&csrf-token=WaYiNADWaAe8fC_n0_LE6NksqvfQK4jPk3uiJNJT-kixLk3-2tRrjzvsVOsolgIqJrqbrOl9bB0rIDtrRlhU_6PcUyrwRp_ByX_3y56Q2");
  72. //}
  73.  
  74. /* - have to use the firefox tool(toggle tools), and send and receive
  75. - application needs to be built better, right now seems requests arent being sent: is there ping packet?
  76.  
  77. */
  78. //sprintf(out,"%d",strlen("csrf-token=WaYiNADWaAe8fC_n0_LE6NksqvfQK4jPk3uiJNJT-kixLk3-2tRrjzvsVOsolgIqJrqbrOl9bB0rIDtrRlhU_6PcUyrwRp_ByX_3y56Q2&csrf-time=7%2F2%2F2018+1%3A42%3A16+AM&csrf-user=WaYiNADWaAe8fC_n0&id=Wi2M6ADWaBEUYhLg0&status=True&friendAction=Add Friend"));
  79. //MessageBox(0,out,"",0);
  80.  
  81. //FILE *f_dst = fopen("wire.html", "w+");
  82. //fwrite(response, 1, strlen(response), f_dst);
  83. //fclose(f_dst);
  84. //MessageBox(0,csrftoken,csrfuser,0);
  85. }
  86.  
  87. static void logout_cb (Fl_Widget *, void *w)
  88. {
  89. GetHTTPTextSSLPOST(remote ,"/logout","status=Log+Out");
  90. GetHTTPTextSSLCleanup(remote);
  91. statusbar->label("Status: Successfully Logged Out.");
  92. }
  93. static void gochat_cb (Fl_Widget *, void *w)
  94. {
  95. /* Go To Chatroom */
  96. char out[1000000];
  97. sprintf(out,"/chat/room/%s/join?update=true&since=2115349766143&csrf-token=%s&retry-count=0&_t=%d",channel->value(),csrf_cookie,(int)time(NULL));
  98. char *response = GetHTTPTextSSLGet(remote ,out);
  99. if(strstr(response,"The owner of this room has blocked you")!= NULL)
  100. {
  101. jasonbrowse->add("The owner of this room has blocked you.");
  102. }
  103. else
  104. {
  105. cJSON *json = cJSON_Parse(response);
  106. if (json == NULL)
  107. {
  108. if(cJSON_GetErrorPtr() != NULL)
  109. {
  110. statusbar->label("Error JSON Packet");
  111. cJSON_Delete(json);
  112. }
  113. else{statusbar->label("Error JSON Packet");cJSON_Delete(json);}
  114. }
  115. /*Parse JSON */
  116. cJSON *elem,*assigned,*assign, *array, *data;
  117. memset((char *)out,0,sizeof(out));
  118. int n = cJSON_GetArraySize(json);
  119. for (int i = 0; i < n; i++)
  120. {
  121. elem = cJSON_GetArrayItem(json, i);
  122. if(elem != NULL)
  123. {
  124. if(elem->type == cJSON_Array)
  125. {
  126. int num = cJSON_GetArraySize(elem);
  127. for (int a = 0; a < num; a++)
  128. {
  129. assigned = cJSON_GetArrayItem(elem, a);
  130. if(assigned != NULL)
  131. {
  132. if(assigned->type == cJSON_Array)
  133. {
  134. num = cJSON_GetArraySize(assigned);
  135. for (int b = 0; b < num; b++)
  136. {
  137. array = cJSON_GetArrayItem(assigned, b);
  138. if(array != NULL)
  139. {
  140. if(array->type == cJSON_Array)
  141. {
  142. num = cJSON_GetArraySize(array);
  143. for (int c = 0; c < num; c++)
  144. {
  145. data = cJSON_GetArrayItem(array, c);
  146. if(data != NULL)
  147. {
  148. if(data->type == cJSON_String){sprintf(out,"%s: %s",data->string,data->valuestring);jasonbrowse->add(out);}
  149. if(data->type == cJSON_Number){sprintf(out,"%s: %d",data->string,data->valueint);jasonbrowse->add(out);}
  150. if(data->type == cJSON_False){sprintf(out,"%s: %s",data->string,data->valuestring);jasonbrowse->add(out);}
  151. if(data->type == cJSON_True){sprintf(out,"%s: %s",data->string,data->valuestring);jasonbrowse->add(out);}
  152. }
  153. }
  154. }
  155. if(array->type == cJSON_String){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
  156. if(array->type == cJSON_Number){sprintf(out,"%s: %d",array->string,array->valueint);jasonbrowse->add(out);}
  157. if(array->type == cJSON_False){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
  158. if(array->type == cJSON_True){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
  159. }
  160. }
  161. }
  162. if(assigned->type == cJSON_String){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
  163. if(assigned->type == cJSON_Number){sprintf(out,"%s: %d",assigned->string,assigned->valueint);jasonbrowse->add(out);}
  164. if(assigned->type == cJSON_False){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
  165. if(assigned->type == cJSON_True){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
  166. }
  167. }
  168. }
  169. if(elem->type == cJSON_Object)
  170. {
  171. int num = cJSON_GetArraySize(elem);
  172. for (int a = 0; a < num; a++)
  173. {
  174. assigned = cJSON_GetArrayItem(elem, a);
  175. if(assigned != NULL)
  176. {
  177. if(assigned->type == cJSON_Array)
  178. {
  179. num = cJSON_GetArraySize(assigned);
  180. for (int b = 0; b < num; b++)
  181. {
  182. array = cJSON_GetArrayItem(assigned, b);
  183. if(array != NULL)
  184. {
  185. if(array->type == cJSON_String){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
  186. if(array->type == cJSON_Number){sprintf(out,"%s: %d",array->string,array->valueint);jasonbrowse->add(out);}
  187. if(array->type == cJSON_False){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
  188. if(array->type == cJSON_True){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
  189. }
  190. }
  191. }
  192. if(assigned->type == cJSON_String){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
  193. if(assigned->type == cJSON_Number){sprintf(out,"%s: %d",assigned->string,assigned->valueint);jasonbrowse->add(out);}
  194. if(assigned->type == cJSON_False){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
  195. if(assigned->type == cJSON_True){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
  196. }
  197. }
  198. }
  199. if(elem->type == cJSON_String){sprintf(out,"%s: %s",elem->string,elem->valuestring);jasonbrowse->add(out);}
  200. if(elem->type == cJSON_Number){sprintf(out,"%s: %d",elem->string,elem->valueint);jasonbrowse->add(out);}
  201. if(elem->type == cJSON_False){sprintf(out,"%s: %s",elem->string,elem->valuestring);jasonbrowse->add(out);}
  202. if(elem->type == cJSON_True){sprintf(out,"%s: %s",elem->string,elem->valuestring);jasonbrowse->add(out);}
  203. }
  204. }
  205. }
  206. }
  207. static void xchat_cb (Fl_Widget *, void *w)
  208. {
  209. char out[1000];
  210. char chatname[10000];
  211.  
  212. sprintf(chatname,"/chat/room/%s/leaveRoom",channel->value());
  213. sprintf(out,"csrf-token=%s",csrf_cookie);
  214. char*leave_page = GetHTTPTextSSLPOST(remote ,chatname,out);
  215. }
  216. static void sendchat_cb (Fl_Widget *, void *w)
  217. {
  218. char out[1000];
  219. sprintf(out,"/chat/room/%s/send2?line=%s!&sendErrors=0&csrf-token=%s&retry-count=0&_t=%d",channel->value(),inputchat->value(),csrf_cookie,(int)time(NULL));
  220. char *response = GetHTTPTextSSLGet(remote ,out);
  221. MessageBox(0,response,"",0);
  222. }
  223.  
  224. static void onlinescroll_cb (Fl_Widget *, void *w)
  225. {
  226. char out[1000000];
  227. for(int i=0; i < 100;i++)
  228. {
  229. sprintf(out,"/chat/room/%s/join?update=true&since=2115349766143&csrf-token=%s&retry-count=0&_t=%d",channel->value(),csrf_cookie,(int)time(NULL));
  230. GetHTTPTextSSLGet(remote ,out);
  231. sprintf(out,"/chat/room/%s/send2?line=%s!&sendErrors=0&csrf-token=%s&retry-count=0&_t=%d",channel->value(),inputchat->value(),csrf_cookie,(int)time(NULL));
  232. char *response = GetHTTPTextSSLGet(remote ,out);
  233. GetHTTPTextSSLPOST(remote ,"/logout","status=Log+Out");
  234. }
  235. }
  236.  
  237. int main (int argc, char ** argv)
  238. {
  239. Fl_Window *window;
  240. Fl_Box *box;
  241.  
  242. window = new Fl_Window (1000, 700,"WireClub By VB");
  243.  
  244. statusbar = new Fl_Box(0,700-20,300,20);
  245. statusbar->box(FL_FLAT_BOX); // make the box 'flat' (no decorations)
  246. statusbar->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
  247. statusbar->color(48-2);
  248. statusbar->label("Status: Ready");
  249.  
  250.  
  251.  
  252. inpackets = new Fl_Browser(10,700-160,980,130);
  253. int widths[] = { 150, 150, 150, 150};
  254. inpackets->column_widths(widths);
  255. inpackets->column_char('\t');
  256. inpackets->type(FL_HOLD_BROWSER);
  257. //packets->callback(packets_cb);
  258.  
  259. outpackets = new Fl_Browser(10,700-160-140,980,130);
  260. outpackets->column_widths(widths);
  261. outpackets->column_char('\t');
  262. outpackets->type(FL_HOLD_BROWSER);
  263. //packets->callback(packets_cb);
  264.  
  265. jasonbrowse = new Fl_Browser(10,700-160-140-140,980,130);
  266. jasonbrowse->type(FL_HOLD_BROWSER);
  267.  
  268.  
  269. /* Login Credentials */
  270. logingroup = new Fl_Group(10,15,280,130,"Login");
  271. logingroup->box(FL_ENGRAVED_BOX); logingroup->align(FL_ALIGN_TOP_LEFT); logingroup->labelsize(14);
  272. username = new Fl_Input(90, 30, 170, 25, "Username");
  273. password = new Fl_Input(90, 60, 170, 25, "Password");
  274. login = new Fl_Button(50, 100, 100, 30, "Login");
  275. login->callback(login_cb);
  276. logout = new Fl_Button(160, 100, 100, 30, "Logout");
  277. logout->callback(logout_cb);
  278. logingroup->end();
  279.  
  280. /* Chatroom */
  281. chatgroup = new Fl_Group(300,15,330,60,"Enter Channel");
  282. chatgroup->box(FL_ENGRAVED_BOX); chatgroup->align(FL_ALIGN_TOP_LEFT); chatgroup->labelsize(14);
  283. channel = new Fl_Input(380, 30, 170, 25, "Channel:");
  284. gochat = new Fl_Button(380+175, 30, 30, 25, "Go!");
  285. gochat->callback(gochat_cb);
  286. xchat = new Fl_Button(380+205, 30, 30, 25, "X!");
  287. xchat->callback(xchat_cb);
  288. chatgroup->end();
  289.  
  290. /* Send */
  291. sendgroup = new Fl_Group(300,95,330,60,"Chat Send");
  292. sendgroup->box(FL_ENGRAVED_BOX); sendgroup->align(FL_ALIGN_TOP_LEFT); sendgroup->labelsize(14);
  293. inputchat = new Fl_Input(380, 105, 170, 25, "Input:");
  294. sendchat = new Fl_Button(380+175, 105, 60, 25, "Send");
  295. sendchat->callback(sendchat_cb);
  296. sendgroup->end();
  297.  
  298. /* Fun */
  299. fungroup = new Fl_Group(640,15,330,60,"Entertainment");
  300. fungroup->box(FL_ENGRAVED_BOX); sendgroup->align(FL_ALIGN_TOP_LEFT); sendgroup->labelsize(14);
  301. onlineScroll = new Fl_Button(640+15, 30, 60, 25, "Scroll");
  302. onlineScroll->callback(onlinescroll_cb);
  303. fungroup->end();
  304.  
  305. username->value("smellmypee");
  306. password->value("");
  307.  
  308. window->end ();
  309. window->show (argc, argv);
  310. return(Fl::run());
  311. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement