Editing Kantai Collection/Vita/Decompilation

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 5: Line 5:
The C# code is located in {{ic|Media/Managed/Assembly-CSharp.dll}}
The C# code is located in {{ic|Media/Managed/Assembly-CSharp.dll}}
The XML "server" data defining ships and accessories and other strings are in {{ic|Media/StreamingAssets/Xml/tables/master/}}
The XML "server" data defining ships and accessories and other strings are in {{ic|Media/StreamingAssets/Xml/tables/master/}}
Some chinese decompilers managed to figure out all the formulas in the game, see japanese translation document: https://twitter.com/KennethWWKK/status/780793591387959297


== Move to PC Unity ==
== Move to PC Unity ==
Line 26: Line 24:


http://resources.infosecinstitute.com/net-reverse-engineering-1cil-programming/#gref
http://resources.infosecinstitute.com/net-reverse-engineering-1cil-programming/#gref
ilasm.exe can display as html or rtf? https://msdn.microsoft.com/en-us/library/f7dy01k1(v=vs.80).aspx


Basic CIL editing of unity and put back into dll: https://www.unknowncheats.me/forum/general-programming-and-reversing/106107-patching-cil-instructions-ida-hxd.html
Basic CIL editing of unity and put back into dll: https://www.unknowncheats.me/forum/general-programming-and-reversing/106107-patching-cil-instructions-ida-hxd.html
Line 44: Line 40:
# Click a line in the C# code that you want to read in IL, such as the "Name equals なし" code
# Click a line in the C# code that you want to read in IL, such as the "Name equals なし" code


=== Change strings within DLLs (the Hard Way) ===
=== Change strings within DLLs ===


An easy test case to prove that we can edit to strings is to do a simple test case:
An easy test case to prove that we can edit to strings is to do a simple test case:


# Use find/replace in Notepad to change all instances of なし to None in [https://github.com/BASLQC/kc-vita-translation/blob/master/en/Xml/tables/master/mst_ship.xml mst_ship.xml].
# Change all instances of なし to None in mst_ships.xml
# Decompile {{ic|Assembly-CSharp.dll}} using [http://stackoverflow.com/questions/6746387/manually-edit-msil-in-compiled-dll islasm.exe]. Choose '''UTF-8 Mode''' (it actually doesn't matter, just be consistent).
# Decompile {{ic|Assembly-CSharp.dll}} using [http://stackoverflow.com/questions/6746387/manually-edit-msil-in-compiled-dll islasm.exe]. Choose '''UTF-8 Mode''' (it actually doesn't matter, just be consistent).
# In line number 974858 Change {{ic|なし}} to {{ic|None}} in this line:  
# In line number 974858 Change {{ic|なし}} to {{ic|None}} in this line:  
Line 59: Line 55:
# Then just run the game again to see if it crashes on the title screen.
# Then just run the game again to see if it crashes on the title screen.
#* If there are no crashes, your mod works!
#* If there are no crashes, your mod works!
#* If there are crashes, you may have forgotten to change all instances of なし to None in mst_ship.xml. See step 1.
#* If there are crashes, you may have forgotten to change  


The relevant code line: https://github.com/limyz/KCKaiVita/blob/master/Assembly-CSharp/dotPeek/Server_Models/Mst_ship.cs#L941
The relevant code line: https://github.com/limyz/KCKaiVita/blob/master/Assembly-CSharp/dotPeek/Server_Models/Mst_ship.cs#L941
Line 65: Line 61:
If the modified Assembly-CSharp.dll works, this proves that DLLs can have their CIL code strings modified.
If the modified Assembly-CSharp.dll works, this proves that DLLs can have their CIL code strings modified.


=== Change strings within DLLs (the graphical way) ===
{{#evu:https://www.youtube.com/watch?v=fAHvevOFdbo|alignment=right}}


.NET Reflector with [http://reflexil.net/ Reflexil] can be used to directly edit the CIL bytecode and recompile it back in. This allows us to visually see Unicode strings and see code separated by classes as they would have originally been in C#.
This is a starter guide to direct CIL editing:
 
http://resources.infosecinstitute.com/net-reverse-engineering-1cil-programming/#gref
 
=== Change strings within DLLs ===
 
An easy test case to prove that we can edit to strings is to do a simple test case:
 
# {{ic|Server_Models/Mst_ship.cs}} Change なし to None
# Change all instances of なし to None in mst_ships.xml
 
The relevant code line: https://github.com/limyz/KCKaiVita/blob/master/Assembly-CSharp/dotPeek/Server_Models/Mst_ship.cs#L941


http://resources.infosecinstitute.com/damn-vulnerable-thick-client-app-part-10/
If the modified Assembly-CSharp.dll works, this proves that DLLs can have their CIL code strings modified.


== Decompiling Unity Assets ==
== Decompiling Unity Assets ==
Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: