Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function backGround(colors)
- g2d.BeginQuads()
- g2d.SetColor(colors.white)
- g2d.SetCoordXY(0, 0)
- g2d.Add()
- g2d.SetColor(colors.black)
- g2d.SetCoordXY(480, 0)
- g2d.Add()
- g2d.SetColor(colors.white)
- g2d.SetCoordXY(480, 272)
- g2d.Add()
- g2d.SetColor(colors.black)
- g2d.SetCoordXY(0, 272)
- g2d.Add()
- g2d.End()
- end
- function fadeText(x, y, text, font, size, alpha, endAlpha, addAlpha, color)
- while true do
- g2d.Clear()
- if font ~= nil then -- If a font is referenced
- font:print(x, y, text, size, Color.create(Color.getR(color), Color.getG(color), Color.getB(color), alpha), 0, 0, intraFont.CENTER) -- Prints the text with the font
- else
- xtream.print(x, y, text, Color.create(Color.getR(color), Color.getG(color), Color.getB(color), alpha)) -- Else prints with the original font
- end
- alpha = alpha + addAlpha -- Increment alpha
- if addAlpha ~= 0 then -- If addAlpha isn't null
- if addAlpha > 0 and alpha > endAlpha then -- If addAlpha is positive and has reached its maximum value
- return true
- elseif addAlpha < 0 and alpha < endAlpha then -- If addAlpha is negative and has reached its maximum value
- return true
- end
- else -- If alpha is null
- break
- end
- g2d.Flip(g2d.VSYNC)
- end
- end
- function getInfos(filePath, hexVals)
- returnVals = {}
- file = io.open(filePath, "r")
- for i = 1, #hexVals do
- file:seek("set", hexVals[i])
- returnVals[i] = file:read()
- end
- io.close(file)
- return returnVals
- end
- function mainMenu(_table)
- for i = 1, #_table.options do
- _font:print(240, 100 + i * 15, i == 3 and _table.options[3].." et PSPGo" or _table.options[i], 0.85, i == _table.select and _table.selColor or _table.unselColor, 0, 0, intraFont.CENTER)
- end
- Xtream.print(350, 250, "Press O to quit", _table.unselColor)
- if pad:up() and not oldpad:up() then
- _table.select = _table.select - (_table.select > 1 and 1 or 0)
- elseif pad:down() and not oldpad:down() then
- _table.select = _table.select + (_table.select < #_table.options and 1 or 0)
- end
- if pad:cross() and not oldpad:cross() then
- pspModel = tonumber(string.sub(_table.options[_table.select], 5)) / 1000
- return pspModel
- elseif pad:circle() and not oldpad:circle() then
- Utility.message("Made by Plongeurspros and Dynodzzo\n Performed with XtreamLua Player", 0)
- Xtream.exitGame()
- end
- end
- Colors = {
- white = Color.create(255, 255, 255),
- black = Color.create(0, 0, 0),
- green = Color.create(17, 140, 33),
- }
- hexValues = {
- {"0x37E0", "0x2940", "0x2960"},
- {"0x3BE0", "0x2D40", "0x2D60"},
- {"0x3FE0", "0x2F40", "0x2F60"},
- }
- menuTable = {options = {}, select = 1, selColor = Colors.white, unselColor = Colors.green}
- menuTable.options = {"PSP 1000", "PSP 2000", "PSP 3000"}
- passNames = {"Parental password - ", "PSN password - ", "PSN e-mail adress - "}
- pspModel = nil
- values = false
- pressSart = false
- _font = intraFont.load("flash0:/font/ltn8.pgf")
- oldpad = Ctrl.read()
- fadeText(240, 136, "Welcome into", _font, 0.8, 0, 255, 2, Colors.white)
- Xtream.delay(450)
- fadeText(240, 136, "Welcome into", _font, 0.8, 255, 0, -2, Colors.white)
- Xtream.delay(450)
- fadeText(240, 136, "PSP PassFinder", _font, 1, 0, 255, 2, Colors.white)
- Xtream.delay(500)
- while true do
- g2d.Clear()
- pad = Ctrl.read()
- if pressStart ~= true then
- _font:print(240, 136, "PSP PassFinder", 1, Colors.white, 0, 0, intraFont.CENTER)
- _font:print(240, 160, "Press start", 0.7, Colors.white, 0, 0, intraFont.CENTER)
- if pad:start() and not oldpad:start() then
- pressStart = true
- end
- else
- backGround(Colors)
- if pspModel == nil then
- mainMenu(menuTable, pspModel)
- else
- if values ~= true then
- returnValues = getInfos("flash1:/registry/system.dreg", hexValues[pspModel])
- values = true
- else
- for i = 1, #returnValues do
- if pspModel ~= 3 then
- _font:print(240, 100 + i * 15, i == 1 and passNames[i]..string.sub(returnValues[i], 1, -8) or passNames[i]..string.sub(returnValues[i], 1, -8), 0.85, Colors.white, 0, 0, intraFont.CENTER)
- else
- _font:print(240, 100 + i * 10, i == 1 and passNames[i]..string.sub(returnValues[i], 1, -7) or passNames[i]..string.sub(returnValues[i], 1, -9), 0.85, Colors.white, 0, 0, intraFont.CENTER)
- end
- if pad:circle() and not oldpad:circle() then
- values = false
- pspModel = nil
- menuTable.select = 1
- end
- end
- Xtream.print(270, 250, "Press O to return to the menu", Colors.green)
- end
- end
- end
- oldpad = pad
- g2d.Flip(g2d.VSYNC)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement