Reverse Engineering RET Homepage RET Members Reverse Engineering Projects Reverse Engineering Papers Reversing Challenges Reverser Tools RET Re-Search Engine Reverse Engineering Forum Reverse Engineering Links

Go Back   Reverse Engineering Team Board > Reverse Engineering Board > .NET Reverse Engineering
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #11  
Old 12-09-2009, 11:22 AM
remko remko is offline
Member
 
Join Date: Dec 2009
Posts: 8
Default

I tried sn already it reports: target.exe does not represent a strongly named assembly

ILDasm doesn't work on the original exe, it reports Protected module -- cannot disassemble.

Maybe I can set a breakpoint and inspect the value? Can you recommend a debugger for this?
Reply With Quote
  #12  
Old 12-09-2009, 08:07 PM
remko remko is offline
Member
 
Join Date: Dec 2009
Posts: 8
Unhappy

Using debugger I watched the result and it is 0x00000005 so I inserted opcode ldc.i4.5.
Using reflector the code is now:
Code:
public static string Method_00(int num1)
{
    byte[] buffer;
    lock (typeof(Class_01))
    {
        if (Field_00 == null)
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            Field_00 = executingAssembly.GetManifestResourceStream(executingAssembly.ManifestModule.ModuleVersionId.ToString("B"));
            byte[] publicKeyToken = executingAssembly.GetName().GetPublicKeyToken();
            if (publicKeyToken != null)
            {
                int num = 0;
                do
                {
                    Field_01 = 7;
                    num += 2;
                }
                while (num < (publicKeyToken.Length - 1));
            }
            Field_01 = 5;
        }
But still crashes
Reply With Quote
  #13  
Old 12-09-2009, 11:46 PM
bball0002 bball0002 is offline
Senior Member
 
Join Date: Mar 2009
Posts: 72
Default

For SmartAss'd targets, I usually use a loader. You can use a loader to modify the method while it's in memory. Just use CFF Explorer to get the Virtual Offset of the opcode that you want to patch, and patch it in memory. If you don't want to make your own loader you can use DUP to create one for you.

Modifying the method in memory bypasses all of those checks that SmartAssembly makes to the methods/exe.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump





Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.