NOTE: Please don't copy other people's code unless you have permission. Respect other people's wishes about distributing code. Copying code is plagiarism. This tutorial is only to teach you how to do it.
Please use tomat's fork of ILSpy, which allows you to decompile mods directly in the program: https://github.com/steviegt6/ILSpy. I do not actively make mods anymore, so if you require help you should ask in the tModLoader server.
This is a bite-sized tutorial on how to decompile Terraria mods. If you want to replicate a certain effect that you saw in a mod of your own, you can decompile that mod. Here's how you can do it:
To obtain the
.dll file, we have to use a TML.Patcher, a 3rd party tool for decompiling mods. Here's how you can install and use it:* Open Command Prompt.
| using System; | |
| using System.Linq; | |
| using System.Collections.Generic; | |
| using Microsoft.Xna.Framework.Content.Pipeline; | |
| using Microsoft.Xna.Framework.Content.Pipeline.Processors; | |
| using Microsoft.Xna.Framework.Graphics; | |
| using Microsoft.Xna.Framework.Audio; | |
| using MonoGame.Framework.Content.Pipeline.Builder; | |
| using System.Reflection; | |
| using System.IO; |
| public void iterateAndApplyMethodBetweenTwoPoints(Vector2 pos1, Vector2 pos2, Supplier<FunctionInput> function) { | |
| // If the two points are the same no need to iterate. Just run the provided function | |
| if (pos1.epsilonEquals(pos2)) { | |
| function.invoke(); | |
| return; | |
| } | |
| int matrixX1 = pos1.x; | |
| int matrixY1 = pos1.y; | |
| int matrixX2 = pos2.x; |
| /* | |
| * This is free and unencumbered software released into the public domain. | |
| * | |
| * For more information, please refer to <https://unlicense.org> | |
| */ | |
| //Regular text | |
| #define BLK "\e[0;30m" | |
| #define RED "\e[0;31m" | |
| #define GRN "\e[0;32m" |
| [ | |
| { | |
| "name":"ABAP", | |
| "type":"programming", | |
| "extensions":[ | |
| ".abap" | |
| ] | |
| }, | |
| { | |
| "name":"AGS Script", |
| Monogame/XNA doesn't allow you to alter the style of a string in the middle of drawing it, so instead you have to draw each | |
| individual piece of a string if you want to bold or italicize a word. This involves knowing how long each bit of string is | |
| and calling DrawString() for each one, all while making sure they line up correctly. Add in the ability to word wrap and | |
| scroll the dialogue one letter at a time and it becomes a pretty painful problem to solve. | |
| To start, I wrote a function that can take a dialogue box width and a string with special formatting strings embedded in it. | |
| The string used for the text above is this: | |
| "I can't {red}shake {blue}the {green}feeling {normal}that {italics}something {normal}belongs here... | |
| Something extraordinarily {bold}ordinary." |
This guide is for those who dares to install Windows 10 on slow netbooks (1GB of RAM).
Though Windows update program is over, you still may use old Windows product keys from license stickers to install Windows 10 on old machines.
UPD Jan 2019
This article is quite old, some instructions may be obsolete.
| ;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
| ;by doppelganger (doppelheathen@gmail.com) | |
| ;This file is provided for your own use as-is. It will require the character rom data | |
| ;and an iNES file header to get it to work. | |
| ;There are so many people I have to thank for this, that taking all the credit for | |
| ;myself would be an unforgivable act of arrogance. Without their help this would | |
| ;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
| ;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
