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 833799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:34:29+00:00 2026-05-15T04:34:29+00:00

Introduction After watching this video from LIDNUG, about .NET code protection http://secureteam.net/lidnug_recording/Untitled.swf (especially from

  • 0

Introduction

After watching this video from LIDNUG, about .NET code protection http://secureteam.net/lidnug_recording/Untitled.swf (especially from 46:30 to 57:30), I would to locate the call to a MessageBox.Show in an EXE I created.

The only logic in my “TrialApp.exe” is:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        MessageBox.Show("This is trial app");
    }
}

Compiled on the Release configuration: http://rapidshare.com/files/392503054/TrialApp.exe.html

What I do to locate the call

Run the application in WinDBG and break after the message box appears.

Get the CLR stack with !clrstack:

0040e840 5e21350b [InlinedCallFrame: 0040e840] System.Windows.Forms.SafeNativeMethods.MessageBox(System.Runtime.InteropServices.HandleRef, System.String, System.String, Int32)
0040e894 5e21350b System.Windows.Forms.MessageBox.ShowCore(System.Windows.Forms.IWin32Window, System.String, System.String, System.Windows.Forms.MessageBoxButtons, System.Windows.Forms.MessageBoxIcon, System.Windows.Forms.MessageBoxDefaultButton, System.Windows.Forms.MessageBoxOptions, Boolean)
0040e898 002701f0 [InlinedCallFrame: 0040e898] 
0040e934 002701f0 TrialApp.Form1.Form1_Load(System.Object, System.EventArgs)

Get the MethodDesc structure (using the address of Form1_Load) !ip2md 002701f0

MethodDesc:   001762f8
Method Name:  TrialApp.Form1.Form1_Load(System.Object, System.EventArgs)
Class:        00171678
MethodTable:  00176354
mdToken:      06000005
Module:       00172e9c
IsJitted:     yes
CodeAddr:     002701d0
Transparency: Critical
Source file:  D:\temp\TrialApp\TrialApp\Form1.cs @ 22

Dump the IL of this method (by MethodDesc) !dumpil 001762f8

IL_0000: ldstr "This is trial app"
IL_0005: call System.Windows.Forms.MessageBox::Show 
IL_000a: pop 
IL_000b: ret 

So, as the video mentioned, the call to to Show is 5 bytes from the beginning of the method implementation.

Now I open CFFExplorer (just like in the video) and get the RVA of the Form1_Load method: 00002083.

After this, I go to Address Converter (again in CFF Explorer) and navigate to offset 00002083. There we have:

32 72 01 00 00 70 28 16 00 00 0A 26 2A 7A 03 2C
13 02 7B 02 00 00 04 2C 0B 02 7B 02 00 00 04 6F
17 00 00 0A 02 03 28 18 00 00 0A 2A 00 03 30 04 
00 67 00 00 00 00 00 00 00 02 28 19 00 00 0A 02

In the video is mentioned that the first 12 bytes are for the method header so I skip them

                                    2A 7A 03 2C
13 02 7B 02 00 00 04 2C 0B 02 7B 02 00 00 04 6F
17 00 00 0A 02 03 28 18 00 00 0A 2A 00 03 30 04 
00 67 00 00 00 00 00 00 00 02 28 19 00 00 0A 02

5 bytes from the beginning of the implementation should be the opcode for method call (28). Unfortunately, is not there.

   02 7B 02 00 00 04 2C 0B 02 7B 02 00 00 04 6F
17 00 00 0A 02 03 28 18 00 00 0A 2A 00 03 30 04 
00 67 00 00 00 00 00 00 00 02 28 19 00 00 0A 02

Questions:

  1. What am I doing wrong?
  2. Why there is no method call at that position in the file? Or maybe the video is missing some information…
  3. Why the guy in that video replaces the call with 9 zeros?
  • 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-05-15T04:34:30+00:00Added an answer on May 15, 2026 at 4:34 am

    When I use Ildasm.exe and look at the IL with Show Bytes turned on I see this:

    .method private hidebysig instance void  Form1_Load(object sender,
                                                        class [mscorlib]System.EventArgs e) cil managed
    // SIG: 20 02 01 1C 12 15
    {
      // Method begins at RVA 0x20f1
      // Code size       12 (0xc)
      .maxstack  8
      IL_0000:  /* 72   | (70)00000D       */ ldstr      "This is trial app"
      IL_0005:  /* 28   | (0A)00001E       */ call       valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string)
      IL_000a:  /* 26   |                  */ pop
      IL_000b:  /* 2A   |                  */ ret
    } // end of method Form1::Form1_Load
    

    The token values in your dump are not the same, you seem to have a much larger program. But the IL in your dump starts at offset 1, not 12. Not sure why it is off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Really simple question here. After watching an excellent introduction to lenses: http://www.youtube.com/watch?v=efv0SQNde5Q I thought
Hi I am following this tutorial found on this page: http://net.tutsplus.com/tutorials/javascript-ajax/an-introduction-to-the-raphael-js-library/ Here is the
I've been reading a MVC 4 SPA at http://www.asp.net/single-page-application/an-introduction-to-spa . Even after reading I'm
i've done everything according to this tutorial: http://steigert.blogspot.cz/2012/02/1-libgdx-tutorial-introduction.html . Everything compiles fine but after
I'm using this sample code to view a PDF in my iPhone app: http://developer.apple.com/library/ios/#samplecode/ZoomingPDFViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010281-Intro-DontLinkElementID_2
I was watching the WWDC ARC introduction video and I saw something I've never
I watched a little introduction into ASP.NET Dynamic Data, and I noticed this option
I read through the entire tutorial here - http://jekyllbootstrap.com/lessons/jekyll-introduction.html and after I had installed
'm using the project http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-C-ASP-NET-developers to test the PayPal's sandbox. I have a sandbox
I am after a all round installation and introduction to Glassfish. (ie Your boss

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.