Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FL/Fl_Window.H>
- #include <FL/Fl.H>
- #include <FL/Fl_Window.H>
- #include <FL/Fl_Box.H>
- #include <FL/Fl_Choice.H>
- #include <FL/Fl_Button.H>
- #include <FL/Fl_Input.H>
- #include <FL/Fl_Browser.H>
- #include <FL/Fl_Input.H>
- #include <FL/Fl_Multiline_Input.H>
- #include <FL/x.H>
- #include <wininet.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <time.h>
- Fl_Box *statusbar;
- Fl_Browser *outpackets,*inpackets,*jasonbrowse;
- Fl_Input *username,*password,*channel,*inputchat;
- Fl_Button *login,*logout,*gochat,*xchat,*sendchat,*onlineScroll;
- Fl_Group *logingroup,*chatgroup,*sendgroup,*fungroup;
- /* Still Not sure how it's generatored */
- char csrf_cookie[]={"*WaYiNADWaAe8fC_n0_LE6NksqvfQK4jPk3uiJNJT-kixLk3-2tRrjzvsVOsolgIqJrqbrOl9bB0rIDtrRlhU_6PcUyrwRp_ByX_3y56Q2"};
- #include "main.h"
- #include "cJSON.h"
- HINTERNET remote;
- static void login_cb (Fl_Widget *, void *w)
- {
- char out[100000];
- char *response;
- /* Create Socket Wireclub */
- remote = HTTPSSLOpen("wireclub.com");
- if(remote == NULL){statusbar->label("Status: No Connection.");return;}
- statusbar->label("Status: Socket Created Successfully.");
- Fl::check();
- /* Get Cookies From Login Page */
- response = LoginPacketGet(remote ,"/login");
- if(response == NULL){return;}
- statusbar->label("Status: Cookies Successfully Grabbed.");
- Fl::check();
- /* Login Page With Cookie & User Information */
- 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());
- response = LoginPackePost(remote ,"/account/doLogin", out);
- statusbar->label("Status: Successfully Logged In.");
- Fl::check();
- if(strstr(response,"Wrong username and password combination")!= NULL){MessageBox(0,"Wrong Password","Error",0);GetHTTPTextSSLCleanup(remote);return;}
- else{response = GetHTTPTextSSLGet(remote ,"/home?from=login");}
- //for(int i=0; i < 70;i++)
- //{
- /* Chatroom */
- //response = GetHTTPTextSSLGet(remote ,"/chat/room/dating_older");
- /* Join Update */
- /* Send Text */
- //sprintf(out,"/chat/room/dudes/send2?line=hello&sendErrors=0&csrf-token=%s&retry-count=0&_t=%d",cookie,(int)time(NULL));
- //char*send_text = GetHTTPTextSSLGet3(remote ,out);
- //MessageBox(0,peeps_page,"",0);
- /* Leave Room */
- //char*leave_page = GetHTTPTextSSLGet3(remote ,"/chat/room/dudes/leaveRoom");
- //MessageBox();
- //https://www.wireclub.com/chat/room/dudes/removeModerator
- //response3 = GetHTTPTextSSLPOST2(remote ,"/chat/room/no__strings__attached/removeModerator","userId=WaYiNADWaAe8fC_n0&csrf-token=WaYiNADWaAe8fC_n0_LE6NksqvfQK4jPk3uiJNJT-kixLk3-2tRrjzvsVOsolgIqJrqbrOl9bB0rIDtrRlhU_6PcUyrwRp_ByX_3y56Q2");
- //}
- /* - have to use the firefox tool(toggle tools), and send and receive
- - application needs to be built better, right now seems requests arent being sent: is there ping packet?
- */
- //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"));
- //MessageBox(0,out,"",0);
- //FILE *f_dst = fopen("wire.html", "w+");
- //fwrite(response, 1, strlen(response), f_dst);
- //fclose(f_dst);
- //MessageBox(0,csrftoken,csrfuser,0);
- }
- static void logout_cb (Fl_Widget *, void *w)
- {
- GetHTTPTextSSLPOST(remote ,"/logout","status=Log+Out");
- GetHTTPTextSSLCleanup(remote);
- statusbar->label("Status: Successfully Logged Out.");
- }
- static void gochat_cb (Fl_Widget *, void *w)
- {
- /* Go To Chatroom */
- char out[1000000];
- 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));
- char *response = GetHTTPTextSSLGet(remote ,out);
- if(strstr(response,"The owner of this room has blocked you")!= NULL)
- {
- jasonbrowse->add("The owner of this room has blocked you.");
- }
- else
- {
- cJSON *json = cJSON_Parse(response);
- if (json == NULL)
- {
- if(cJSON_GetErrorPtr() != NULL)
- {
- statusbar->label("Error JSON Packet");
- cJSON_Delete(json);
- }
- else{statusbar->label("Error JSON Packet");cJSON_Delete(json);}
- }
- /*Parse JSON */
- cJSON *elem,*assigned,*assign, *array, *data;
- memset((char *)out,0,sizeof(out));
- int n = cJSON_GetArraySize(json);
- for (int i = 0; i < n; i++)
- {
- elem = cJSON_GetArrayItem(json, i);
- if(elem != NULL)
- {
- if(elem->type == cJSON_Array)
- {
- int num = cJSON_GetArraySize(elem);
- for (int a = 0; a < num; a++)
- {
- assigned = cJSON_GetArrayItem(elem, a);
- if(assigned != NULL)
- {
- if(assigned->type == cJSON_Array)
- {
- num = cJSON_GetArraySize(assigned);
- for (int b = 0; b < num; b++)
- {
- array = cJSON_GetArrayItem(assigned, b);
- if(array != NULL)
- {
- if(array->type == cJSON_Array)
- {
- num = cJSON_GetArraySize(array);
- for (int c = 0; c < num; c++)
- {
- data = cJSON_GetArrayItem(array, c);
- if(data != NULL)
- {
- if(data->type == cJSON_String){sprintf(out,"%s: %s",data->string,data->valuestring);jasonbrowse->add(out);}
- if(data->type == cJSON_Number){sprintf(out,"%s: %d",data->string,data->valueint);jasonbrowse->add(out);}
- if(data->type == cJSON_False){sprintf(out,"%s: %s",data->string,data->valuestring);jasonbrowse->add(out);}
- if(data->type == cJSON_True){sprintf(out,"%s: %s",data->string,data->valuestring);jasonbrowse->add(out);}
- }
- }
- }
- if(array->type == cJSON_String){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
- if(array->type == cJSON_Number){sprintf(out,"%s: %d",array->string,array->valueint);jasonbrowse->add(out);}
- if(array->type == cJSON_False){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
- if(array->type == cJSON_True){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
- }
- }
- }
- if(assigned->type == cJSON_String){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
- if(assigned->type == cJSON_Number){sprintf(out,"%s: %d",assigned->string,assigned->valueint);jasonbrowse->add(out);}
- if(assigned->type == cJSON_False){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
- if(assigned->type == cJSON_True){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
- }
- }
- }
- if(elem->type == cJSON_Object)
- {
- int num = cJSON_GetArraySize(elem);
- for (int a = 0; a < num; a++)
- {
- assigned = cJSON_GetArrayItem(elem, a);
- if(assigned != NULL)
- {
- if(assigned->type == cJSON_Array)
- {
- num = cJSON_GetArraySize(assigned);
- for (int b = 0; b < num; b++)
- {
- array = cJSON_GetArrayItem(assigned, b);
- if(array != NULL)
- {
- if(array->type == cJSON_String){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
- if(array->type == cJSON_Number){sprintf(out,"%s: %d",array->string,array->valueint);jasonbrowse->add(out);}
- if(array->type == cJSON_False){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
- if(array->type == cJSON_True){sprintf(out,"%s: %s",array->string,array->valuestring);jasonbrowse->add(out);}
- }
- }
- }
- if(assigned->type == cJSON_String){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
- if(assigned->type == cJSON_Number){sprintf(out,"%s: %d",assigned->string,assigned->valueint);jasonbrowse->add(out);}
- if(assigned->type == cJSON_False){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
- if(assigned->type == cJSON_True){sprintf(out,"%s: %s",assigned->string,assigned->valuestring);jasonbrowse->add(out);}
- }
- }
- }
- if(elem->type == cJSON_String){sprintf(out,"%s: %s",elem->string,elem->valuestring);jasonbrowse->add(out);}
- if(elem->type == cJSON_Number){sprintf(out,"%s: %d",elem->string,elem->valueint);jasonbrowse->add(out);}
- if(elem->type == cJSON_False){sprintf(out,"%s: %s",elem->string,elem->valuestring);jasonbrowse->add(out);}
- if(elem->type == cJSON_True){sprintf(out,"%s: %s",elem->string,elem->valuestring);jasonbrowse->add(out);}
- }
- }
- }
- }
- static void xchat_cb (Fl_Widget *, void *w)
- {
- char out[1000];
- char chatname[10000];
- sprintf(chatname,"/chat/room/%s/leaveRoom",channel->value());
- sprintf(out,"csrf-token=%s",csrf_cookie);
- char*leave_page = GetHTTPTextSSLPOST(remote ,chatname,out);
- }
- static void sendchat_cb (Fl_Widget *, void *w)
- {
- char out[1000];
- 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));
- char *response = GetHTTPTextSSLGet(remote ,out);
- MessageBox(0,response,"",0);
- }
- static void onlinescroll_cb (Fl_Widget *, void *w)
- {
- char out[1000000];
- for(int i=0; i < 100;i++)
- {
- 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));
- GetHTTPTextSSLGet(remote ,out);
- 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));
- char *response = GetHTTPTextSSLGet(remote ,out);
- GetHTTPTextSSLPOST(remote ,"/logout","status=Log+Out");
- }
- }
- int main (int argc, char ** argv)
- {
- Fl_Window *window;
- Fl_Box *box;
- window = new Fl_Window (1000, 700,"WireClub By VB");
- statusbar = new Fl_Box(0,700-20,300,20);
- statusbar->box(FL_FLAT_BOX); // make the box 'flat' (no decorations)
- statusbar->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- statusbar->color(48-2);
- statusbar->label("Status: Ready");
- inpackets = new Fl_Browser(10,700-160,980,130);
- int widths[] = { 150, 150, 150, 150};
- inpackets->column_widths(widths);
- inpackets->column_char('\t');
- inpackets->type(FL_HOLD_BROWSER);
- //packets->callback(packets_cb);
- outpackets = new Fl_Browser(10,700-160-140,980,130);
- outpackets->column_widths(widths);
- outpackets->column_char('\t');
- outpackets->type(FL_HOLD_BROWSER);
- //packets->callback(packets_cb);
- jasonbrowse = new Fl_Browser(10,700-160-140-140,980,130);
- jasonbrowse->type(FL_HOLD_BROWSER);
- /* Login Credentials */
- logingroup = new Fl_Group(10,15,280,130,"Login");
- logingroup->box(FL_ENGRAVED_BOX); logingroup->align(FL_ALIGN_TOP_LEFT); logingroup->labelsize(14);
- username = new Fl_Input(90, 30, 170, 25, "Username");
- password = new Fl_Input(90, 60, 170, 25, "Password");
- login = new Fl_Button(50, 100, 100, 30, "Login");
- login->callback(login_cb);
- logout = new Fl_Button(160, 100, 100, 30, "Logout");
- logout->callback(logout_cb);
- logingroup->end();
- /* Chatroom */
- chatgroup = new Fl_Group(300,15,330,60,"Enter Channel");
- chatgroup->box(FL_ENGRAVED_BOX); chatgroup->align(FL_ALIGN_TOP_LEFT); chatgroup->labelsize(14);
- channel = new Fl_Input(380, 30, 170, 25, "Channel:");
- gochat = new Fl_Button(380+175, 30, 30, 25, "Go!");
- gochat->callback(gochat_cb);
- xchat = new Fl_Button(380+205, 30, 30, 25, "X!");
- xchat->callback(xchat_cb);
- chatgroup->end();
- /* Send */
- sendgroup = new Fl_Group(300,95,330,60,"Chat Send");
- sendgroup->box(FL_ENGRAVED_BOX); sendgroup->align(FL_ALIGN_TOP_LEFT); sendgroup->labelsize(14);
- inputchat = new Fl_Input(380, 105, 170, 25, "Input:");
- sendchat = new Fl_Button(380+175, 105, 60, 25, "Send");
- sendchat->callback(sendchat_cb);
- sendgroup->end();
- /* Fun */
- fungroup = new Fl_Group(640,15,330,60,"Entertainment");
- fungroup->box(FL_ENGRAVED_BOX); sendgroup->align(FL_ALIGN_TOP_LEFT); sendgroup->labelsize(14);
- onlineScroll = new Fl_Button(640+15, 30, 60, 25, "Scroll");
- onlineScroll->callback(onlinescroll_cb);
- fungroup->end();
- username->value("smellmypee");
- password->value("");
- window->end ();
- window->show (argc, argv);
- return(Fl::run());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement