Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7969603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:15:44+00:00 2026-06-04T07:15:44+00:00

I’ve modified the bytecode of an assembly to get rid off of an error

  • 0

I’ve modified the bytecode of an assembly to get rid off of an error and now when I try to use it I get a InvalidProgramException.
All I’ve done is replace this code with NOPS:

catch (Exception exception1)
{
    Exception exception = exception1;
    if (exception as InvalidValueException == null)
    {
        throw new InvalidGenerationException(2);
    }
    else
    {
        throw exception;
    }
}

IL before:

catch [mscorlib]System.Exception
{
    IL_022f: stloc.s exception
    IL_0231: ldloc.s exception
    IL_0233: isinst Custom.InvalidValueException
    IL_0238: brfalse.s IL_023d

    IL_023a: ldloc.s exception
    IL_023c: throw

    IL_023d: ldc.i4.1
    IL_023e: newobj instance void Custom.InvalidGenerationException ...
    IL_0243: throw
}

IL after:

catch [mscorlib]System.Exception
{
    IL_022f: nop
    IL_0230: nop
    IL_0231: nop
    IL_0232: nop
    IL_0233: nop
    IL_0234: nop
    IL_0235: nop
    IL_0236: nop
    IL_0237: nop
    IL_0238: nop
    IL_0239: nop
    IL_023a: nop
    IL_023b: nop
    IL_023c: nop
    IL_023d: nop
    IL_023e: nop
    IL_023f: nop
    IL_0240: nop
    IL_0241: nop
    IL_0242: nop
    IL_0243: nop
}

Any ideas about why is this wrong?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:15:46+00:00Added an answer on June 4, 2026 at 7:15 am

    Your original catch block will always throw. That is, there’s no way to exit the block “normally”.

    Your modified catch block doesn’t throw so you need to exit the block normally. You’ll need to use leave or leave.s to do that.

    (You might also need to pop the caught exception off the stack to keep things tidy. I’m not sure about that one though, you’ll have to try it and see for yourself.)

    catch [mscorlib]System.Exception
    {
        IL_022f: pop                // not certain if pop is necessary
        IL_0230: leave.s IL_0244
        IL_0232: nop
        IL_0233: nop
        IL_0234: nop
        IL_0235: nop
        IL_0236: nop
        IL_0237: nop
        IL_0238: nop
        IL_0239: nop
        IL_023a: nop
        IL_023b: nop
        IL_023c: nop
        IL_023d: nop
        IL_023e: nop
        IL_023f: nop
        IL_0240: nop
        IL_0241: nop
        IL_0242: nop
        IL_0243: nop
    }
    IL_0244: ret    // or whatever
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.