|
|
Comments and Discussions
|
|
 |

|
Tnx Andrea,
Please keep it coming,
Splendid piece
|
|
|
|

|
Hi there!
very nice tool
any chances to add support for 64 bit .NET PE files?
would be really cool in a light of Win7, Win8, upcoming Win9 64 bit OSes!
thanks in advance
P.S. looks like the issue is inside old good library
Asmex.FileViewer.ModHeaders
.//
good luck!
|
|
|
|

|
Really good question! I'll have a look and report you back.
Maybe you debugged it yet? Do you want to collaborate to a patch?
|
|
|
|

|
Hi!
wow, I was not expecting any response as usually people like you are quite busy!
so, 1st of all, many thanks!
2ndly, yes, you have a good feeling of matter, I've already debuggged it, understoond the root reason (its obvious - PE32+ has a bit different format (eg QWord for some fields instead of DWord size)
I've made a small fix and it helped me to (wow) patch 64 bit .NET assemblies!
3) I've one more idea that will bring your tool to #1, lets discuss it afterwards
Alex.
good luck!
|
|
|
|

|
New version 2.3 is online, supporting PE+ files! Thank you Alex for spotting this out and providing a patch! Happy debugging!
|
|
|
|

|
Why not just use ILDASM to dump the IL, make the changes, then use ILASM to compile with the strong name key. It's very simple. I assume the company still has the SN key.
Relativity
|
|
|
|

|
good way only if your assembly is not protected/obfuscated!
in nowadays pure assembly is a rare thing
good luck!
|
|
|
|

|
Yes, but you said "He opens the executable and tries to find out the typos - he gets them and he fixes them, at least the worst ones, where the customer name is incorrect (yes, he can only overwrite existing bytes, but consider this enough for this scenario)...."
-Clearly in your scenario the assembly is not obfuscated
-Are the string's obfuscated too? Probably not.
-You can do the same thing with the solution I proposed.
Relativity
|
|
|
|
|

|
Is it possible to remove a reference to public key token inside .baml resource embedded into assembly?
it's simple to remove the outer .dll level pubkeytoken, but reosource one......
any ideas?
good luck!
|
|
|
|

|
I removed Strong-Names from a DLL within a program using this tool, and it does not run anymore; it crashes on startup. When I click Debug I get "A strongly-named assembly is required". I tried also patching the main executable but the result is the same. I even tried ticking all the assembly names and "Patching references" on both files (DLL and executable). Should I do it on _ALL_ the DLLs of the program? Is there a way to find the offending file?
|
|
|
|

|
Cant reflexil in reflector addin do this
|
|
|
|
|

|
Hi,
I had to change a .NET .dll to have 32-bit flags so it could run on 32-bit instance of Amazon EC2. Nothing would work until I used your utility to switch off signing. Awesome utility - thanks!
|
|
|
|

|
Is it possible to sign to an assembly that was compiled without strong name or replace a sign of an assembly that was signed using the same approach?
|
|
|
|

|
Hi Vasili,
please, take a look at previously posted questions under this article (on 2nd comments page). This question has already been asked, but has not a quick answer, it all depends on what kind of assembly you're working on. .NET Framework SN tool can sign and resign an existing DLL, but that one should not use particular programming tricks (like Reflection). Decompiling and reassembling thru ILDasm/ILAsm can be another try, but those are unsupported. You can also have a look at Mono Cecil project.
Hope this helps!
Causing an automatic reboot is a feature for a program, not a bug.
|
|
|
|

|
Oh, sorry, I missed the second page Thanks a lot
|
|
|
|

|
System.DivideByZeroException was unhandled
Message=Attempted to divide by zero.
Source=StrongNameRemove
StackTrace:
at vu.ch.argee.WindowsAPI.WrapperClasses.ManagedFileMappingAdaptor.GetAllocationGranularityOffset(UInt64& value) in D:\Chrome\StrongNameRemove21_src\vu.ch.argee.MemoryMapping\ManagedFileMappingAdaptor.cs:line 326
at vu.ch.argee.MemoryMapping.FileMappingView.Initialize(IntPtr fileMappingObjectHandle, MappingAccess viewAccess, UInt64 fileOffset, UInt32 numberOfBytesToMap) in D:\Chrome\StrongNameRemove21_src\vu.ch.argee.MemoryMapping\FileMappingView.cs:line 147
at vu.ch.argee.MemoryMapping.FileMappingView..ctor(FileMapping fileMapping) in D:\Chrome\StrongNameRemove21_src\vu.ch.argee.MemoryMapping\FileMappingView.cs:line 46
at StrongNameRemove.Utility.PatchAssemblyStrongSigning(String fileName, UInt32 cliHeaderFlag, Int64 cliHeaderFlagOffset, Int64 strongNameSignatureOffset, Int64 publicKeyIndexOffset, UInt32 assemblyFlag, Int64 assemblyFlagOffset, Int32 blobIndexSize) in D:\Chrome\StrongNameRemove21_src\Utility.cs:line 329
at StrongNameRemove.MainForm.btnPatch_Click(Object sender, EventArgs e) in D:\Chrome\StrongNameRemove21_src\MainForm.cs:line 241
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at StrongNameRemove.Program.Main(String[] args) in D:\Chrome\StrongNameRemove21_src\Program.cs:line 23
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
|
|
|
|

|
Thank you giammin for reporting this crash. This is related to MMF code. I've submitted a new version of application (2.2) and code to CodeProject. Just wait until they publish and approve it. Thank you for your patience and time.
Causing an automatic reboot is a feature for a program, not a bug.
|
|
|
|

|
thank you for your quick reply!
let me know if you need more info about
|
|
|
|

|
Just a heads up - ran on Win 7 x64, got a failure, copied program and target files to 32bit xp virtual box and it ran fine. Thanks.
|
|
|
|

|
I encountered the same issue. Changing the platform target to x86 allows it to run on Windows 7 x64 without crashing.
|
|
|
|

|
This crash is related to MMF library. Completely removed in version 2.2.
Causing an automatic reboot is a feature for a program, not a bug.
|
|
|
|

|
Hi,
- We have application common.dll using Nhibernate 1.0.2 that uses log4net.dll version 1.2.9.
- We also use xxx.dll that MUST use log4net.dll version of 1.2.10.
At the moment we can't used xxx.dll in the aplication while it would mean we have to use two log4net.dlls.
We try to remove signed dll with your application doing next, while we try to insert log4net.dll v 1.2.10 into our application and trick nhiberante.
1. Remove strong naming from log4net.ddl v.1.2.10
2. We used for nhibernate.dll to point to unsigned assembly log4net v 1.2.10
But the Nhibernate discard to load log4net v 1.2.10.
"[System.IO.FileLoadException] {"Could not load file or assembly
'log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)":"log4net, Version=1.2.9.0, Culture=neutral,
PublicKeyToken=null"} System.IO.FileLoadException"
Can it be that also version of referenced dll is checked.
Thank you for your help.
Regards,
Dusan
|
|
|
|

|
This one seems a little challenge. I really don't see how removing strong naming can help with your problem. Even if you could reference log4net 1.2.10 from nHibernate, xxx.dll should be patched too, because it would try to load a signed log4net dll. Moreover, removing strong signing from log4net 1.2.10, doesn't mean nHibernate can load it, even if patched, because it would look at another version (previous 1.2.9) - this can be patched too, but probably something wouldn't work at runtime, because subtle differences in log4net implementation.
At last, I would try another approach: keep your application ad xxx.dll as they are. Start from nHibernate source code (same version you are working on or a recent one) and modify that, removing references to log4net 1.2.9 and adding 1.2.10. If nHibernate can compile without problems, you would get an nHibernate custom version using log4net 1.2.10, but also signed. If it can't compile anymore, you should try to understand how to upgrade it to new log4net methods (I'm not using log4net, so don't know how it changed from 1.2.9 to 1.2.10). Maybe you can also ask some help from nHibernate community and request them to bind to new log4net version.
My general idea is to avoid byte patching if using open source code projects (and you are lucky enough to use them).
Hope this helps!
Causing an automatic reboot is a feature for a program, not a bug.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This article describes how to remove Strong Signing from .NET assemblies without recompiling code.
| Type | Article |
| Licence | CPOL |
| First Posted | 28 Aug 2006 |
| Views | 117,988 |
| Downloads | 3,756 |
| Bookmarked | 161 times |
|
|