public static void Main(string[] args) { using (ProcessEdit shaiya = new ProcessEdit()) { do { Console.WriteLine("Please start Shaiya.."); System.Threading.Thread.Sleep(1000); } while(shaiya.OpenProcessAndThread("game") == false); Console.Clear(); Console.WriteLine("Shaiya successful attached!"); Console.WriteLine("\nPlease enter your desired Charname (the full length!)"); Console.Write("Charname: "); string charname = Console.ReadLine(); if (charname.Length <= 13) { Console.WriteLine("\n\nCharname only contains " + charname.Length + " (max is 13) and is already valid!"); } else { string validCharname = charname.Substring(0, 13); string patternMask = new string( 'x', 13 ); // all chars must match! byte[] baCharname = System.Text.ASCIIEncoding.Default.GetBytes(validCharname); uint patLoc = shaiya.FindPattern(baCharname, patternMask); if (patLoc != 0) { string patData = ""; if (patLoc > 0) { patData = shaiya.ReadASCIIString(patLoc, 13); } #if DEBUG Console.WriteLine("[Debug] Pattern Location: 0x{0:X08}", patLoc); Console.WriteLine("[Debug] Pattern Data (13 chars): {0}", patData); #endif Console.Write("\ntry to update Memory with real name.."); if (shaiya.WriteASCIIString(patLoc, charname) == true) { Console.WriteLine(" success!"); } else { Console.WriteLine(" failed.."); } } else { Console.WriteLine("FAILED to find Namestring?"); } } Console.WriteLine("\n\nPress any Key to exit"); Console.ReadKey(); } }
public static void Main(string[] args) { try { WriteInfo("initialize Shaiya Loader.."); using (ProcessEdit shaiya = new ProcessEdit()) { if (File.Exists("game.exe") == false) { WriteError("Game.exe not found in this location?"); Console.ReadKey(); return; } int tryCount = 0; Process p = Process.Start("game.exe"); System.Threading.Thread.Sleep(50); while (shaiya.OpenProcessAndThread(p.Id) == false && tryCount < 1000) { ; } if (shaiya.IsThreadOpen == false || shaiya.IsProcessOpen == false) { WriteError("failed to attach Shaiya Process.. oO"); p.Kill(); Console.ReadKey(); return; } Console.Clear(); WriteStatus("Shaiya Loader initialized."); WriteInfo("start reading Debug Values..."); byte[] testBuf1 = shaiya.ReadBytes(0x0040AB0F, 2); byte[] testBuf2 = shaiya.ReadBytes(0x0040AB33, 2); byte[] testBuf3 = shaiya.ReadBytes(0x0040AB7A, 6); byte[] testBuf4 = shaiya.ReadBytes(0x0040AE6D, 6); WriteDebug("buf1: " + HexHelper.Encode(testBuf1)); WriteDebug("buf2: " + HexHelper.Encode(testBuf2)); WriteDebug("buf3: " + HexHelper.Encode(testBuf3)); WriteDebug("buf4: " + HexHelper.Encode(testBuf4)); WriteInfo("start writing Climb Patch Values..."); shaiya.WriteBytes(0x004416BA, new byte[6] { 0, 0, 0, 0, 0, 0 }); WriteStatus("All Operations finished - Press any Key to exit"); Console.ReadKey(); } } catch (Exception e) { WriteError("Exception thrown!\n\n"); Console.WriteLine(e); Console.ReadKey(); } }
public static void Main( string[] args ) { try { WriteInfo( "initialize Shaiya Loader.." ); using( ProcessEdit shaiya = new ProcessEdit() ) { if( File.Exists( "game.exe" ) == false ) { WriteError( "Game.exe not found in this location?" ); Console.ReadKey(); return; } int tryCount = 0; Process p = Process.Start( "game.exe" ); System.Threading.Thread.Sleep( 50 ); while( shaiya.OpenProcessAndThread( p.Id ) == false && tryCount < 1000 ) ; if( shaiya.IsThreadOpen == false || shaiya.IsProcessOpen == false ) { WriteError( "failed to attach Shaiya Process.. oO" ); p.Kill(); Console.ReadKey(); return; } Console.Clear(); WriteStatus( "Shaiya Loader initialized." ); WriteInfo( "start reading Debug Values..." ); byte[] testBuf1 = shaiya.ReadBytes( 0x0040AB0F, 2 ); byte[] testBuf2 = shaiya.ReadBytes( 0x0040AB33, 2 ); byte[] testBuf3 = shaiya.ReadBytes( 0x0040AB7A, 6 ); byte[] testBuf4 = shaiya.ReadBytes( 0x0040AE6D, 6 ); WriteDebug( "buf1: " + HexHelper.Encode( testBuf1 ) ); WriteDebug( "buf2: " + HexHelper.Encode( testBuf2 ) ); WriteDebug( "buf3: " + HexHelper.Encode( testBuf3 ) ); WriteDebug( "buf4: " + HexHelper.Encode( testBuf4 ) ); WriteInfo( "start writing Climb Patch Values..." ); shaiya.WriteBytes( 0x004416BA, new byte[ 6 ] { 0, 0, 0, 0, 0, 0 } ); WriteStatus( "All Operations finished - Press any Key to exit" ); Console.ReadKey(); } } catch( Exception e ) { WriteError( "Exception thrown!\n\n" ); Console.WriteLine( e ); Console.ReadKey(); } }
public static void Main( string[] args ) { using( ProcessEdit shaiya = new ProcessEdit() ) { do { Console.WriteLine( "Please start Shaiya.." ); System.Threading.Thread.Sleep( 1000 ); } while( shaiya.OpenProcessAndThread( "game" ) == false ); Console.Clear(); Console.WriteLine( "Shaiya successful attached!" ); Console.WriteLine( "\nPlease enter your desired Charname (the full length!)" ); Console.Write( "Charname: " ); string charname = Console.ReadLine(); if( charname.Length <= 13 ) { Console.WriteLine( "\n\nCharname only contains " + charname.Length + " (max is 13) and is already valid!" ); } else { string validCharname = charname.Substring( 0, 13 ); string patternMask = new string( 'x', 13 ); // all chars must match! byte[] baCharname = System.Text.ASCIIEncoding.Default.GetBytes( validCharname ); uint patLoc = shaiya.FindPattern( baCharname, patternMask ); if( patLoc != 0 ) { string patData = ""; if( patLoc > 0 ) patData = shaiya.ReadASCIIString( patLoc, 13 ); #if DEBUG Console.WriteLine( "[Debug] Pattern Location: 0x{0:X08}", patLoc ); Console.WriteLine( "[Debug] Pattern Data (13 chars): {0}", patData ); #endif Console.Write( "\ntry to update Memory with real name.." ); if( shaiya.WriteASCIIString( patLoc, charname ) == true ) Console.WriteLine( " success!" ); else Console.WriteLine( " failed.." ); } else { Console.WriteLine( "FAILED to find Namestring?" ); } } Console.WriteLine( "\n\nPress any Key to exit" ); Console.ReadKey(); } }