Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trying to modify an assembly at runtime

Featured Replies

Posted

Hi everybody,

that was a long time that i didn't try to code anything. So sorry if there're stupid mistakes in my code.

I try to have an assembly that modify itself at runtime

For example, all Nop opcode becomes Ret opcode (don't try to find logic :) )

 

So i inject a method in the .cctor of the assembly. Here's the code :

 

Assembly currentAssembly = Assembly.GetExecutingAssembly();
            Type type = currentAssembly.GetType();
            foreach(MethodInfo method in type.GetMethods())
            {
                RuntimeHelpers.PrepareMethod(method.MethodHandle);
                byte[] iLAsByteArray = method.GetMethodBody().GetILAsByteArray();
                for (int i = 0; i < iLAsByteArray.Length; i++)
                {
                    if ((short)iLAsByteArray == OpCodes.Endfinally.Value)
                    {
                        iLAsByteArray = (byte)OpCodes.Ldarg_0.Value;
                    }
                }
                UpdateILCodes(method, iLAsByteArray, -1);
            }

 

the code is a mess but as i said, i didn't touched a computer for a long time.

 

Thanks for you greatful help :)

Edited by Legend-Modz-V1

  • Author
On 26/12/2016 at 9:10 PM, ilya01 said:

Seems, that are you using injection library. Try to watch source of exaples, how to use it.

But this library is unstable and It does not always work.

i looked on examples for a day but impossible to find solution ;/

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.