mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-22 09:19:01 +00:00
Properly read username from login data
This commit is contained in:
parent
db0a57b44c
commit
e4f764784e
1 changed files with 3 additions and 8 deletions
|
@ -11,6 +11,7 @@ namespace LBPUnion.ProjectLighthouse.Types {
|
|||
// - LBP2 digital, with the RPCN username `jvyden`
|
||||
// POST /LITTLEBIGPLANETPS3_XML/login?applicationID=21414&languageID=1&lbp2=1&beta=0&titleID=NPUA80662&country=us
|
||||
// !<21>0220333||/u||=0<> jvydebruUP9000-NPUA80662_008D
|
||||
// Data is 251 bytes long.
|
||||
/// <summary>
|
||||
/// The data sent from POST /LOGIN.
|
||||
/// </summary>
|
||||
|
@ -20,20 +21,14 @@ namespace LBPUnion.ProjectLighthouse.Types {
|
|||
// public int UnknownNumber { get; set; } // Seems to increment by 1000 every login attempt
|
||||
|
||||
public static LoginData CreateFromString(string str) {
|
||||
do {
|
||||
str = str.Replace("\b", string.Empty); // Trim backspace characters
|
||||
} while(str.Contains('\b'));
|
||||
str = str.Replace("\b", ""); // Remove backspace characters
|
||||
|
||||
using MemoryStream ms = new(Encoding.ASCII.GetBytes(str));
|
||||
using BinaryReader reader = new(ms);
|
||||
|
||||
LoginData loginData = new();
|
||||
|
||||
BinaryHelper.ReadUntilByte(reader, 0x20); // Skips to relevant part
|
||||
|
||||
// byte[] endBytes = reader.ReadBytes((int)(ms.Length - reader.BaseStream.Position));
|
||||
// string end = Encoding.ASCII.GetString(endBytes);
|
||||
|
||||
reader.BaseStream.Position = 80;
|
||||
loginData.Username = BinaryHelper.ReadString(reader).Replace("\0", string.Empty);
|
||||
|
||||
return loginData;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue