const char * CNClient::getClientParameters(void) { if (s_sClientParameters.empty()) { s_sClientParameters = ""; // client-version s_sClientParameters.append("client-version=").append(getVersion()); // screen CCSize size = getScreenSize(); CCFloat scale = getScreenScale(); char szScreen[32]; memset(szScreen, 0, 32); snprintf(szScreen, 32, "%.0fx%.0f@%.1f", size.width, size.height, scale); s_sClientParameters.append("&screen=").append(szScreen); // os std::string sOS = std::string(getSystemName()).append("/").append(getSystemVersion()); s_sClientParameters.append("&os=").append(sOS); // device std::string sDevice = std::string(getDeviceModel()).append("/").append(getHardware()); s_sClientParameters.append("&device=").append(sDevice); // imei s_sClientParameters.append("&imei=").append(getDeviceIdentifier()); } return s_sClientParameters.c_str(); }
void Client::updateClientParameters(void) { std::string string = ""; // client-version string.append("client-version=").append(getVersion()); // screen char screen[32]; memset(screen, 0, 32); snprintf(screen, 32, "%dx%d", getScreenWidth(), getScreenHeight()); string.append("&screen=").append(screen); // os std::string os = std::string(getSystemName()).append("/").append(getSystemVersion()); UrlUtils::escape(os); string.append("&os=").append(os); // device std::string device = std::string(getDeviceModel()).append("/").append(getHardware()); UrlUtils::escape(device); string.append("&device=").append(device); // imei string.append("&imei=").append(getDeviceIdentifier()); m_sClientParameters = string; }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CNewFileSelector* CNewFileSelector::create (CFrame* parent, Style style) { if (parent == 0) { #if DEBUG DebugPrint ("Need frame for CNewFileSelector\n"); #endif return 0; } if (getSystemVersion ().dwMajorVersion >= 6) // Vista return new VistaFileSelector (parent, style); return new XPFileSelector (parent, style); }
int main() { // Initialize services srvInit(); aptInit(); hidInit(NULL); gfxInitDefault(); fsInit(); sdmcInit(); hbInit(); qtmInit(); hidScanInput(); u32 kDown = hidKeysDown(); u32 kHeld = hidKeysHeld(); //Load the configuration loadConfiguration(); //Check kernel version getSystemVersion(); //checks if the CFW has to boot right away or open the GUI if(auto_boot == '2') auto_boot = '2'; //here it checks if the "force GUI" is set, and preservs it if it is set else if(kHeld & KEY_L) auto_boot = '0'; //here it will start the GUI only this time else auto_boot = '1'; //here it won't show the GUI //checks if the CFW has to disable firmlaunch if (kHeld & KEY_R && firmlaunch == '0') firmlaunch = '2'; //here we enable the firmlaunch only this time else if (kHeld & KEY_R && firmlaunch == '1')firmlaunch = '3'; //here we disable the firmlaunch only this time //Then we save the configuration saveConfiguration(); //Proceeds to launch the loader.bin bootCFW_FirstStage(); }
//----------------------------------------------------------------------------- Win32Frame::Win32Frame (IPlatformFrameCallback* frame, const CRect& size, HWND parent) : IPlatformFrame (frame) , windowHandle (0) , parentWindow (parent) , tooltipWindow (0) , backBuffer (0) , deviceContext (0) , inPaint (false) , mouseInside (false) , updateRegionList (0) , updateRegionListSize (0) { initWindowClass (); DWORD style = isParentLayered (parent) ? WS_EX_TRANSPARENT : 0; #if !DEBUG_DRAWING if (getD2DFactory ()) // workaround for Direct2D hotfix (KB2028560) { // when WS_EX_COMPOSITED is set drawing does not work correctly. This seems like a bug in Direct2D wich happens with this hotfix } else if (getSystemVersion ().dwMajorVersion >= 6) // Vista and above style |= WS_EX_COMPOSITED; else backBuffer = createOffscreenContext (size.getWidth (), size.getHeight ()); #endif windowHandle = CreateWindowEx (style, gClassName, TEXT("Window"), WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, (int)size.width (), (int)size.height (), parentWindow, NULL, GetInstance (), NULL); if (windowHandle) { SetWindowLongPtr (windowHandle, GWLP_USERDATA, (__int3264)(LONG_PTR)this); RegisterDragDrop (windowHandle, new CDropTarget (this)); } }
//----------------------------------------------------------------------------- Win32TextEdit::Win32TextEdit (HWND parent, IPlatformTextEditCallback* textEdit) : IPlatformTextEdit (textEdit) , platformControl (0) , platformFont (0) , platformBackColor (0) , oldWndProcEdit (0) { CRect rect = textEdit->platformGetSize (); CFontRef fontID = textEdit->platformGetFont (); CHoriTxtAlign horiTxtAlign = textEdit->platformGetHoriTxtAlign (); int wstyle = 0; if (horiTxtAlign == kLeftText) wstyle |= ES_LEFT; else if (horiTxtAlign == kRightText) wstyle |= ES_RIGHT; else wstyle |= ES_CENTER; CPoint textInset = textEdit->platformGetTextInset (); rect.offset (textInset.x, textInset.y); rect.right -= textInset.x*2; rect.bottom -= textInset.y*2; // get/set the current font LOGFONT logfont = {0}; CCoord fontH = fontID->getSize (); if (fontH > rect.getHeight ()) fontH = rect.getHeight () - 3; if (fontH < rect.getHeight ()) { CCoord adjust = (rect.getHeight () - (fontH + 3)) / (CCoord)2; rect.top += adjust; rect.bottom -= adjust; } UTF8StringHelper stringHelper (textEdit->platformGetText ()); text = stringHelper; DWORD wxStyle = 0; if (getD2DFactory () == 0 && getSystemVersion ().dwMajorVersion >= 6) // Vista and above wxStyle = WS_EX_COMPOSITED; wstyle |= WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL; platformControl = CreateWindowEx (wxStyle, TEXT("EDIT"), stringHelper, wstyle, (int)rect.left, (int)rect.top, (int)rect.getWidth (), (int)rect.getHeight (), parent, NULL, GetInstance (), 0); logfont.lfWeight = FW_NORMAL; logfont.lfHeight = (LONG)-fontH; logfont.lfPitchAndFamily = VARIABLE_PITCH | FF_SWISS; UTF8StringHelper fontNameHelper (fontID->getName ()); VSTGUI_STRCPY (logfont.lfFaceName, fontNameHelper); logfont.lfClipPrecision = CLIP_STROKE_PRECIS; logfont.lfOutPrecision = OUT_STRING_PRECIS; logfont.lfQuality = DEFAULT_QUALITY; logfont.lfCharSet = ANSI_CHARSET; platformFont = CreateFontIndirect (&logfont); SetWindowLongPtr (platformControl, GWLP_USERDATA, (__int3264)(LONG_PTR)this); SendMessage (platformControl, WM_SETFONT, (WPARAM)platformFont, true); SendMessage (platformControl, EM_SETMARGINS, EC_LEFTMARGIN|EC_RIGHTMARGIN, MAKELONG (0, 0)); SendMessage (platformControl, EM_SETSEL, 0, -1); SendMessage (platformControl, EM_LIMITTEXT, 255, 0); SetFocus (platformControl); oldWndProcEdit = (WINDOWSPROC)(LONG_PTR)SetWindowLongPtr (platformControl, GWLP_WNDPROC, (__int3264)(LONG_PTR)procEdit); CColor backColor = textEdit->platformGetBackColor (); platformBackColor = CreateSolidBrush (RGB (backColor.red, backColor.green, backColor.blue)); }
int main() { u32 pad_state; u32 num_calls = 0; InitFS(); while (true) { ClearTop(); Debug(" ALBERTOSONIC'S CFW "); Debug(""); Debug("Getting system version..."); getSystemVersion(); Debug(""); Debug("Your system is %s", systemVersion); Debug(""); if (type == 0) { Debug("Press any key to reboot."); pad_state = InputWait(); break; } else { //Let's continue our patch Debug(""); Debug("Patching..."); if (type == 1){ u8 patch[] = { 0x00, 0x20, 0x3B, 0xE0 }; u32 *dest = 0x080549C4; memcpy(dest, patch, 4); u8 patch1[] = { 0x00, 0x20, 0x08, 0xE0 }; u32 *dest1 = 0x0804239C; memcpy(dest1, patch1, 4); } if (type == 2){ u8 patch[] = { 0x00, 0x20, 0x3B, 0xE0 }; u32 *dest = 0x080523C4; memcpy(dest, patch, 4); u8 patch1[] = { 0x00, 0x20, 0x08, 0xE0 }; u32 *dest1 = 0x08058098; memcpy(dest1, patch1, 4); } if (type == 3){ u8 patch[] = { 0x00, 0x20, 0x3B, 0xE0 }; u32 *dest = 0x0805235C; memcpy(dest, patch, 4); u8 patch1[] = { 0x00, 0x20, 0x08, 0xE0 }; u32 *dest1 = 0x08058100; memcpy(dest1, patch1, 4); } if (type == 4){ u8 patch[] = { 0x6D, 0x20, 0xCE, 0x77 }; u32 *dest = 0x08052FD8; memcpy(dest, patch, 4); u8 patch1[] = { 0x5A, 0xC5, 0x73, 0xC1 }; u32 *dest1 = 0x08058804; memcpy(dest1, patch1, 4); } break; } } // return control to FIRM ARM9 code (performs firmlaunch) return 0; }