Tool [LEGACY][Patcher] Terraria Tweaker 1.X.X.X

Status
Not open for further replies.
To everyone getting the CLR20r3 error, I've got some info for you. This is a very prevalent bug on Win 7 machines for all types of dotNet applications. One solution is to move to Win 8 or higher, however that's impractical, so here are better potential solutions:

1. Try this special version of TT that may fix the problem: http://www.mediafire.com/download/xp4avvj50awj6dk/TerrariaTweaker1203OTF-SAPCE.zip
IF YOU ARE EXPERIENCING THE CLR20R3 ERROR, TRY THIS SOLUTION BEFORE ATTEMPTING ANY OTHER SOLUTION BELOW. IF THE SPECIAL VERSION WORKS, PLEASE TELL ME. IF IT DOESN'T, THEN AND ONLY THEN TRY THE BELOW SOLUTIONS. THIS INFORMATION IS EXTREMELY VALUABLE FOR DEBUGGING.

---------------------------------------------------------------------------------------------------------------------------------------------------------------

2. Try the .NET repair tool: https://support.microsoft.com/en-us/kb/2698555 and https://www.microsoft.com/en-us/download/details.aspx?id=30135

3. Install the Microsoft SQL Server 2005 Backwards Compatibility Components (x64 only!): http://download.microsoft.com/downl...C2-A67D-48053B8F9FAD/SQLServer2005_BC_x64.msi

4. Ensure your system locale is set to anything but Unicode. Go to your control panel, then Region and Language, then Administrative, then Change System Locale and ensure it's English or whatever your language is.
 
Hello, I've been having problems with this mod. When I try to start it nothing happens. I have 2013 VC redist and .net 4.5 I've tried the special version of TT too but it doesn't seem to fix it. I've tried the installer and the zip file. Thank you for your attention ^.^
 
Hello, I've been having problems with this mod. When I try to start it nothing happens. I have 2013 VC redist and .net 4.5 I've tried the special version of TT too but it doesn't seem to fix it. I've tried the installer and the zip file. Thank you for your attention ^.^

What do you mean by "nothing happens"? Does the process start but no window appears? Does it start and instantly close? Ensure you are running TT as an admin and that your account has no restrictions (like a GPO) on programs that work like TT. Also, your anti-virus may think TT is a trojan (since it does externally modify another program), so try disabling your AV. If you're on Win 10, supposedly .NET 3.5 is not included, so try to install that. And lastly, try the .NET repair tool.
 
Last edited:
What do you mean by "nothing happens"? Does the process start but no window appears? Does it start and instantly close? Ensure you are running TT as an admin and that your account has no restrictions (like a GPO) on programs that work like TT. Also, your anti-virus may think TT is a trojan (since it does externally modify another program), so try disabling your AV. If you're on Win 10, supposedly .NET 3.5 is not included, so try to install that. And lastly, try the .NET repair tool.
The program shows up in task manager but no windows appear and 1sec later it closes. I'm using windows 8.1 pro 64-bit. I don't have an antivirus program and my account is admin. I will try downloading .NET 3.5 and tell the results later. Thank you for your attention ^.^

Edit: Unfortunately getting .NET 3.5 did nothing.
 
Last edited:
The program shows up in task manager but no windows appear and 1sec later it closes. I'm using windows 8.1 pro 64-bit. I don't have an antivirus program and my account is admin. I will try downloading .NET 3.5 and tell the results later. Thank you for your attention ^.^

Edit: Unfortunately getting .NET 3.5 did nothing.
This is the most puzzling issue I've seen yet, I'll continue to look into it. For now, you can try these:

> Try turning off DEP. To do that, open cmd as an admin and use this command, then restart your computer:
bcdedit /set {current} nx AlwaysOff
DEP will auto-close programs that try to execute things Windows doesn't like. Maybe it's doing it to TT and not notifying you?

> Ensure that the Terraria Tweaker.exe you're running is in a local folder (not on a network drive) and the Mono.Cecil.dll and other included files are in the same folder as the executable.

> Try running TT in Directory Services Repair (DRS) mode. DSR mode is like safemode, but loads more drivers (like your graphics driver and network drivers). Using DSR, we can try to determine if other software on your computer (like Windows Defender maybe, I dunno if that's part of Win 8) is killing TT on purpose, since this software likely wont run in DSR mode. To do this, shutdown your computer, then power it up. When you get to your BIOS screen (the screen immediately before the "Windows is starting screen"), press F8. I recommend hammering the F8 key as soon as the BIOS screen closes. You'll get a black DOS-like screen. Use the arrow keys to select DSR mode, then press enter. If it asks for an OS to loads, press enter again. Then, once logged-in and at your desktop, try to run TT.

> Try this special version of TT for debugging that will (hopefully) give you a verbose error message if it crashes: http://www.mediafire.com/download/uyny0zppci4u1yo/TerrariaTweaker1203OTFSFCP.zip
 
Last edited:
Okay, I looked through help part first before "Whining":naughty:
So, I cant seem to edit the projectile that gets shot out of the wooden bow, I try to make it shoot red fireworks, (id of 167)
But, it stays as the normal arrows. Any idea how to edit the projectile fired?
 
Okay, I looked through help part first before "Whining":naughty:
So, I cant seem to edit the projectile that gets shot out of the wooden bow, I try to make it shoot red fireworks, (id of 167)
But, it stays as the normal arrows. Any idea how to edit the projectile fired?

Well, I dunno what sequences and processes are given to the ai type of 167 in the Projectile class (you should decompile to find out), but apparently they don't manage red fireworks. You're not doing anything wrong, and neither is TT, you're just trying to make something happen that I never created a consistent means of delivery for. Not every modification performed by the Omnipatcher will have a tangible result.
 
Well, I dunno what sequences and processes are given to the ai type of 167 in the Projectile class (you should decompile to find out), but apparently they don't manage red fireworks. You're not doing anything wrong, and neither is TT, you're just trying to make something happen that I never created a consistent means of delivery for. Not every modification performed by the Omnipatcher will have a tangible result.
Ah, that makes sense, considering there are multiple things with the same id.
 
Here is the log (I think it is this)
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="c:\program files (x86)\microsoft visual studio 12.0\team tools\static analysis tools\fxcop\Xml\CodeAnalysisReport.xsl"?>
<FxCopReport Version="12.0">
<Targets>
<Target Name="C:\Users\Overlord\Desktop\Stuff\Terraria Tweaker\Development\Terraria Tweaker PRODUCTION\Terraria Tweaker v1.2.0.3 OTF SFCP\bin\Debug\Terraria Tweaker.exe">
<Modules>
<Module Name="terraria tweaker.exe">
<Namespaces>
<Namespace Name="TerrariaPatcher">
<Types>
<Type Name="IniAPI" Kind="Class" Accessibility="Public" ExternallyVisible="True">
<Members>
<Member Name="#GetPrivateProfileString(System.String,System.String,System.String,System.Char[],System.Int32,System.String)" Kind="Method" Static="True" Accessibility="Private" ExternallyVisible="False">
<Messages>
<Message TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="95" Level="CriticalWarning">Because it is a P/Invoke method, 'IniAPI.GetPrivateProfileString(string, string, string, char[], int, string)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Issue>
</Message>
<Message Id="0" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'section' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="1" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'key' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="2" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'def' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="5" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'filePath' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
</Messages>
</Member>
<Member Name="#GetPrivateProfileString(System.String,System.String,System.String,System.Text.StringBuilder,System.Int32,System.String)" Kind="Method" Static="True" Accessibility="Private" ExternallyVisible="False">
<Messages>
<Message TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="95" Level="CriticalWarning">Because it is a P/Invoke method, 'IniAPI.GetPrivateProfileString(string, string, string, StringBuilder, int, string)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Issue>
</Message>
<Message Id="0" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'section' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="1" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'key' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="2" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'def' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="3" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'retVal' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="5" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'filePath' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
</Messages>
</Member>
<Member Name="#WriteIni(System.String,System.String,System.String,System.String)" Kind="Method" Static="True" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="95" Level="CriticalWarning">Because it is a P/Invoke method, 'IniAPI.WriteIni(string, string, string, string)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Issue>
</Message>
<Message Id="return" TypeName="PInvokeDeclarationsShouldBePortable" Category="Microsoft.Portability" CheckId="CA1901" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Name="Return" Certainty="95" Level="Error">As it is declared in your code, the return type of P/Invoke 'IniAPI.WriteIni(string, string, string, string)' will be 8 bytes wide on 32-bit platforms. This is not correct, as the actual native declaration of this API indicates it should be 4 bytes wide on 32-bit platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of 'long'.</Issue>
<Issue Name="Return" Certainty="95" Level="Error">As it is declared in your code, the return type of P/Invoke 'IniAPI.WriteIni(string, string, string, string)' will be 8 bytes wide on 64-bit platforms. This is not correct, as the actual native declaration of this API indicates it should be 4 bytes wide on 64-bit platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of 'long'.</Issue>
</Message>
<Message TypeName="PInvokesShouldNotBeVisible" Category="Microsoft.Interoperability" CheckId="CA1401" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="50" Level="CriticalError">Change the accessibility of P/Invoke 'IniAPI.WriteIni(string, string, string, string)' so that it is no longer visible from outside its assembly.</Issue>
</Message>
<Message Id="0" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'section' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="1" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'key' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="2" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'val' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="3" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'path' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
</Messages>
</Member>
</Members>
</Type>
</Types>
</Namespace>
</Namespaces>
</Module>
</Modules>
</Target>
</Targets>
<Rules>
<Rule TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060">
<Name>Move P/Invokes to NativeMethods class</Name>
<Description>This type contains members with the DllImport attribute. Members with the DllImport attribute should be contained in classes named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Description>
<Resolution Name="Default">Because it is a P/Invoke method, {0} should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182161.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="95">CriticalWarning</MessageLevel>
<File Name="designrules.dll" Version="12.0.0.0" />
</Rule>
<Rule TypeName="PInvokeDeclarationsShouldBePortable" Category="Microsoft.Portability" CheckId="CA1901">
<Name>P/Invoke declarations should be portable</Name>
<Description>.</Description>
<Resolution Name="Return">As it is declared in your code, the return type of P/Invoke {0} will be {1} bytes wide on {2} platforms. This is not correct, as the actual native declaration of this API indicates it should be {3} bytes wide on {2} platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of {4}.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182284(VS.100).aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="95">Error</MessageLevel>
<File Name="portabilityrules.dll" Version="12.0.0.0" />
</Rule>
<Rule TypeName="PInvokesShouldNotBeVisible" Category="Microsoft.Interoperability" CheckId="CA1401">
<Name>P/Invokes should not be visible</Name>
<Description>Interop layer should not be public. The DllImport attribute should not be applied to publicly accessible members (public or protected).</Description>
<Resolution Name="Default">Change the accessibility of P/Invoke {0} so that it is no longer visible from outside its assembly.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182209.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="50">CriticalError</MessageLevel>
<File Name="interoperabilityrules.dll" Version="12.0.0.0" />
</Rule>
<Rule TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101">
<Name>Specify marshaling for P/Invoke string arguments</Name>
<Description>When marshaling strings as ANSI (or as Auto on Win9x), some characters may be changed. If best-fit mapping is on, strings that appear different in Unicode will be marshaled to identical ANSI strings, which may lead to incorrect security decisions. Turning best-fit mapping off reduces this risk, as all characters without equivalents are mapped to '?'. Also, note that CharSet.Ansi is the default setting for all string marshaling; Unicode marshaling must be specified explicitly, either as a CharSet setting of DllImport or StructLayout, or as a MarshalAs attribute with a Unicode (or system-dependent) UnmanagedType.</Description>
<Resolution Name="ParameterImplicitAnsi">To reduce security risk, marshal parameter {0} as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182319.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="75">Error</MessageLevel>
<File Name="globalizationrules.dll" Version="12.0.0.0" />
</Rule>
</Rules>
<Localized>
<String Key="Category">Category</String>
<String Key="Certainty">Certainty</String>
<String Key="CollapseAll">Collapse All</String>
<String Key="CheckId">Check Id</String>
<String Key="Error">Error</String>
<String Key="Errors">error(s)</String>
<String Key="ExpandAll">Expand All</String>
<String Key="Help">Help</String>
<String Key="Line">Line</String>
<String Key="Messages">message(s)</String>
<String Key="LocationNotStoredInPdb">[Location not stored in Pdb]</String>
<String Key="Project">Project</String>
<String Key="Resolution">Resolution</String>
<String Key="Rule">Rule</String>
<String Key="RuleFile">Rule File</String>
<String Key="RuleDescription">Rule Description</String>
<String Key="Source">Source</String>
<String Key="Status">Status</String>
<String Key="Target">Target</String>
<String Key="Warning">Warning</String>
<String Key="Warnings">warning(s)</String>
<String Key="ReportTitle">Code Analysis Report</String>
</Localized>
</FxCopReport>
 
Here is the log (I think it is this)
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="c:\program files (x86)\microsoft visual studio 12.0\team tools\static analysis tools\fxcop\Xml\CodeAnalysisReport.xsl"?>
<FxCopReport Version="12.0">
<Targets>
<Target Name="C:\Users\Overlord\Desktop\Stuff\Terraria Tweaker\Development\Terraria Tweaker PRODUCTION\Terraria Tweaker v1.2.0.3 OTF SFCP\bin\Debug\Terraria Tweaker.exe">
<Modules>
<Module Name="terraria tweaker.exe">
<Namespaces>
<Namespace Name="TerrariaPatcher">
<Types>
<Type Name="IniAPI" Kind="Class" Accessibility="Public" ExternallyVisible="True">
<Members>
<Member Name="#GetPrivateProfileString(System.String,System.String,System.String,System.Char[],System.Int32,System.String)" Kind="Method" Static="True" Accessibility="Private" ExternallyVisible="False">
<Messages>
<Message TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="95" Level="CriticalWarning">Because it is a P/Invoke method, 'IniAPI.GetPrivateProfileString(string, string, string, char[], int, string)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Issue>
</Message>
<Message Id="0" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'section' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="1" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'key' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="2" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'def' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="5" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'filePath' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
</Messages>
</Member>
<Member Name="#GetPrivateProfileString(System.String,System.String,System.String,System.Text.StringBuilder,System.Int32,System.String)" Kind="Method" Static="True" Accessibility="Private" ExternallyVisible="False">
<Messages>
<Message TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="95" Level="CriticalWarning">Because it is a P/Invoke method, 'IniAPI.GetPrivateProfileString(string, string, string, StringBuilder, int, string)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Issue>
</Message>
<Message Id="0" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'section' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="1" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'key' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="2" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'def' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="3" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'retVal' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="5" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'filePath' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
</Messages>
</Member>
<Member Name="#WriteIni(System.String,System.String,System.String,System.String)" Kind="Method" Static="True" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="95" Level="CriticalWarning">Because it is a P/Invoke method, 'IniAPI.WriteIni(string, string, string, string)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Issue>
</Message>
<Message Id="return" TypeName="PInvokeDeclarationsShouldBePortable" Category="Microsoft.Portability" CheckId="CA1901" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Name="Return" Certainty="95" Level="Error">As it is declared in your code, the return type of P/Invoke 'IniAPI.WriteIni(string, string, string, string)' will be 8 bytes wide on 32-bit platforms. This is not correct, as the actual native declaration of this API indicates it should be 4 bytes wide on 32-bit platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of 'long'.</Issue>
<Issue Name="Return" Certainty="95" Level="Error">As it is declared in your code, the return type of P/Invoke 'IniAPI.WriteIni(string, string, string, string)' will be 8 bytes wide on 64-bit platforms. This is not correct, as the actual native declaration of this API indicates it should be 4 bytes wide on 64-bit platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of 'long'.</Issue>
</Message>
<Message TypeName="PInvokesShouldNotBeVisible" Category="Microsoft.Interoperability" CheckId="CA1401" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="Breaking">
<Issue Certainty="50" Level="CriticalError">Change the accessibility of P/Invoke 'IniAPI.WriteIni(string, string, string, string)' so that it is no longer visible from outside its assembly.</Issue>
</Message>
<Message Id="0" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'section' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="1" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'key' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="2" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'val' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
<Message Id="3" TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101" Status="Active" Created="2015-12-06 21:05:52Z" FixCategory="NonBreaking">
<Issue Name="ParameterImplicitAnsi" Certainty="75" Level="Error">To reduce security risk, marshal parameter 'path' as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Issue>
</Message>
</Messages>
</Member>
</Members>
</Type>
</Types>
</Namespace>
</Namespaces>
</Module>
</Modules>
</Target>
</Targets>
<Rules>
<Rule TypeName="MovePInvokesToNativeMethodsClass" Category="Microsoft.Design" CheckId="CA1060">
<Name>Move P/Invokes to NativeMethods class</Name>
<Description>This type contains members with the DllImport attribute. Members with the DllImport attribute should be contained in classes named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Description>
<Resolution Name="Default">Because it is a P/Invoke method, {0} should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182161.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="95">CriticalWarning</MessageLevel>
<File Name="designrules.dll" Version="12.0.0.0" />
</Rule>
<Rule TypeName="PInvokeDeclarationsShouldBePortable" Category="Microsoft.Portability" CheckId="CA1901">
<Name>P/Invoke declarations should be portable</Name>
<Description>.</Description>
<Resolution Name="Return">As it is declared in your code, the return type of P/Invoke {0} will be {1} bytes wide on {2} platforms. This is not correct, as the actual native declaration of this API indicates it should be {3} bytes wide on {2} platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of {4}.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182284(VS.100).aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="95">Error</MessageLevel>
<File Name="portabilityrules.dll" Version="12.0.0.0" />
</Rule>
<Rule TypeName="PInvokesShouldNotBeVisible" Category="Microsoft.Interoperability" CheckId="CA1401">
<Name>P/Invokes should not be visible</Name>
<Description>Interop layer should not be public. The DllImport attribute should not be applied to publicly accessible members (public or protected).</Description>
<Resolution Name="Default">Change the accessibility of P/Invoke {0} so that it is no longer visible from outside its assembly.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182209.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="50">CriticalError</MessageLevel>
<File Name="interoperabilityrules.dll" Version="12.0.0.0" />
</Rule>
<Rule TypeName="SpecifyMarshalingForPInvokeStringArguments" Category="Microsoft.Globalization" CheckId="CA2101">
<Name>Specify marshaling for P/Invoke string arguments</Name>
<Description>When marshaling strings as ANSI (or as Auto on Win9x), some characters may be changed. If best-fit mapping is on, strings that appear different in Unicode will be marshaled to identical ANSI strings, which may lead to incorrect security decisions. Turning best-fit mapping off reduces this risk, as all characters without equivalents are mapped to '?'. Also, note that CharSet.Ansi is the default setting for all string marshaling; Unicode marshaling must be specified explicitly, either as a CharSet setting of DllImport or StructLayout, or as a MarshalAs attribute with a Unicode (or system-dependent) UnmanagedType.</Description>
<Resolution Name="ParameterImplicitAnsi">To reduce security risk, marshal parameter {0} as Unicode, by setting DllImport.CharSet to CharSet.Unicode, or by explicitly marshaling the parameter as UnmanagedType.LPWStr. If you need to marshal this string as ANSI or system-dependent, specify MarshalAs explicitly, and set BestFitMapping=false; for added security, also set ThrowOnUnmappableChar=true.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182319.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="75">Error</MessageLevel>
<File Name="globalizationrules.dll" Version="12.0.0.0" />
</Rule>
</Rules>
<Localized>
<String Key="Category">Category</String>
<String Key="Certainty">Certainty</String>
<String Key="CollapseAll">Collapse All</String>
<String Key="CheckId">Check Id</String>
<String Key="Error">Error</String>
<String Key="Errors">error(s)</String>
<String Key="ExpandAll">Expand All</String>
<String Key="Help">Help</String>
<String Key="Line">Line</String>
<String Key="Messages">message(s)</String>
<String Key="LocationNotStoredInPdb">[Location not stored in Pdb]</String>
<String Key="Project">Project</String>
<String Key="Resolution">Resolution</String>
<String Key="Rule">Rule</String>
<String Key="RuleFile">Rule File</String>
<String Key="RuleDescription">Rule Description</String>
<String Key="Source">Source</String>
<String Key="Status">Status</String>
<String Key="Target">Target</String>
<String Key="Warning">Warning</String>
<String Key="Warnings">warning(s)</String>
<String Key="ReportTitle">Code Analysis Report</String>
</Localized>
</FxCopReport>

No, that's the code analysis file I generated for the debug version. When you ran it, what happened? Did it crash with an error? Did it crash silently? Did it crash and ask to debug?
 
When i start it, it dont show and nothing happens but terrariatweaker appears in windows task manager so, it start but stop after 5 seconds
 
This is the most puzzling issue I've seen yet, I'll continue to look into it. For now, you can try these:

> Try turning off DEP. To do that, open cmd as an admin and use this command, then restart your computer:
bcdedit /set {current} nx AlwaysOff
DEP will auto-close programs that try to execute things Windows doesn't like. Maybe it's doing it to TT and not notifying you?

> Ensure that the Terraria Tweaker.exe you're running is in a local folder (not on a network drive) and the Mono.Cecil.dll and other included files are in the same folder as the executable.

> Try running TT in Directory Services Repair (DRS) mode. DSR mode is like safemode, but loads more drivers (like your graphics driver and network drivers). Using DSR, we can try to determine if other software on your computer (like Windows Defender maybe, I dunno if that's part of Win 8) is killing TT on purpose, since this software likely wont run in DSR mode. To do this, shutdown your computer, then power it up. When you get to your BIOS screen (the screen immediately before the "Windows is starting screen"), press F8. I recommend hammering the F8 key as soon as the BIOS screen closes. You'll get a black DOS-like screen. Use the arrow keys to select DSR mode, then press enter. If it asks for an OS to loads, press enter again. Then, once logged-in and at your desktop, try to run TT.

> Try this special version of TT for debugging that will (hopefully) give you a verbose error message if it crashes: http://www.mediafire.com/download/uyny0zppci4u1yo/TerrariaTweaker1203OTFSFCP.zip
When I try to turn off DEP it says "the boot configuration data store could not be opened access is denied". DRS mode didn't change anything and the special version still does the same as the others.
 
When I try to turn off DEP it says "the boot configuration data store could not be opened access is denied". DRS mode didn't change anything and the special version still does the same as the others.

You have to run cmd as an admin - right click then "Run as Administrator" for the command to work. Have you tried the .NET repair tool?
 
You have to run cmd as an admin - right click then "Run as Administrator" for the command to work. Have you tried the .NET repair tool?
I turned off DEP and ran the .NET repair tool and the results are still the same. Thank you for your attention ^.^
 
I turned off DEP and ran the .NET repair tool and the results are still the same. Thank you for your attention ^.^

This is really puzzling. Maybe try upgrading to .NET 4.6: https://www.microsoft.com/en-us/download/details.aspx?id=48137

Here's yet another version of TT that will create a log of events so that I might be able to determine if the crash is a result of initialization: http://www.mediafire.com/download/t4h785v68v5h659/TerrariaTweaker1203OTFSLDV.zip
The log will be generated at C:\ttdebug.log, so you can paste the contents of that in a reply
 
This is really puzzling. Maybe try upgrading to .NET 4.6: https://www.microsoft.com/en-us/download/details.aspx?id=48137

Here's yet another version of TT that will create a log of events so that I might be able to determine if the crash is a result of initialization: http://www.mediafire.com/download/t4h785v68v5h659/TerrariaTweaker1203OTFSLDV.zip
The log will be generated at C:\ttdebug.log, so you can paste the contents of that in a reply
Getting .NET 4.6 didn't help and here is the crashlog:
2015-12-10 18:20:39 :: [PROG] Getting assembly info
2015-12-10 18:20:39 :: [PROG] Enabling visual styles
2015-12-10 18:20:39 :: [PROG] Setting compatible text rendering default to false
2015-12-10 18:20:39 :: [PROG] Running instance of main
2015-12-10 18:20:39 :: [MAIN] Initializing components
2015-12-10 18:20:39 :: [MAIN] Setting up tooltips
2015-12-10 18:20:39 :: [MAIN] Reading assembly info
2015-12-10 18:20:39 :: [MAIN] Locating Terraria assembly
2015-12-10 18:20:39 :: [MAIN] Loading from config
Thank you for your attention ^.^
 
Getting .NET 4.6 didn't help and here is the crashlog:
2015-12-10 18:20:39 :: [PROG] Getting assembly info
2015-12-10 18:20:39 :: [PROG] Enabling visual styles
2015-12-10 18:20:39 :: [PROG] Setting compatible text rendering default to false
2015-12-10 18:20:39 :: [PROG] Running instance of main
2015-12-10 18:20:39 :: [MAIN] Initializing components
2015-12-10 18:20:39 :: [MAIN] Setting up tooltips
2015-12-10 18:20:39 :: [MAIN] Reading assembly info
2015-12-10 18:20:39 :: [MAIN] Locating Terraria assembly
2015-12-10 18:20:39 :: [MAIN] Loading from config
Thank you for your attention ^.^

Looks like the crash occurs when trying to parse the ini file that holds the configuration. I've refined the ini processing stuff to better fit the MSDN standards, maybe this will fix the bug. It will be in the 1.2.0.5 update.
 
Last edited:
Status
Not open for further replies.
Back
Top Bottom