Results 1 to 18 of 18

Thread: Expose Code? [Finished For Now]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19

    Expose Code? [Finished For Now]

    Is there a way reveal the code of an executable file?

    Christos
    Last edited by Christos; Apr 15th, 2004 at 05:39 PM.

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19

    Is this a bad question?

    I'm wondering if I ask a bad question?

    Christos

  3. #3
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Do you mean decompile the executable? If so, yes.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19
    Yes, I quess that is what I mean. I have a small applcation and I would like to analyze the code.

    Christo

  5. #5
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    There's a few ways to do this, http://www.remotesoft.com/salamander/ is recommended a lot. There are also some built-in tools like ildasm.exe. Search around for .net decompilers

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19
    Thanks for the link. I was surprised to see the price. Maybe someone can give me some hints on this application I attached ( I renamed it from .exe to .txt. I'm trying to create a similar app and am having trouble building an interface that will display my array like this on. Any assistance would be appreciated.

    Christos
    Attached Files Attached Files

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Should be a fairly simple matter of just creating new labels at run time while loopin through the array, set their position and size and set ther text value to the array value.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  8. #8
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim tst As Label
    3.  
    4.         tst = New Label()
    5.  
    6.         tst.Height = 10
    7.         tst.Width = 10
    8.         tst.Text = 1
    9.  
    10.         tst.Show()
    11.  
    12.         Me.Controls.Add(tst)
    13.  
    14.     End Sub

    this shows how to create a label at runtime. Now just apply this to a loop of the array and increment tst.Left and tst.Top as necessary

    I hope you get my meaning. Trying to leave you a little to figure on your own. If you are still having trouble though say so...
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  9. #9
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Thumbs up

    Well, hot dang Cander.... I'm getting ready to start work on an app where I know I'll need to do something like that. Now I know how to do it!




    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19
    I have only been doing this for about 3 weeks and I'm still having trouble relating to the syntax. Are you saying that each value within the array gets it's own label? It looks like some type of gris but as I understand datagrids, those are for databases.

    Christos

  11. #11
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    yeah you are basically creating a new label for each valkue in the array and drawing a grid with them.. Give me a few minutes and ill write a full example
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19
    This is the text of my project if it helps.

    Christos
    Attached Files Attached Files

  13. #13
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Example of displaying a 2d array as a sort of grid

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim tst As Label
    3.         Dim arr(2, 2) As Integer
    4.         Dim lfthold As Integer
    5.         Dim tophold As Integer
    6.  
    7.         Dim a As Integer
    8.         Dim b As Integer
    9.  
    10.         arr(0, 0) = 1
    11.         arr(0, 1) = 2
    12.         arr(1, 0) = 3
    13.         arr(1, 1) = 4
    14.  
    15.         ' first row
    16.         For a = 0 To 1
    17.             For b = 0 To 1
    18.                 tst = New Label
    19.                 tst.BackColor = System.Drawing.Color.LightBlue
    20.                 tst.Height = 15
    21.                 tst.Width = 15
    22.                 tst.Top = tophold
    23.                 tst.Left = lfthold
    24.  
    25.                 tst.Text = arr(a, b)
    26.  
    27.                 tst.Show()
    28.                 Me.Controls.Add(tst)
    29.                 lfthold += 20
    30.             Next
    31.             lfthold = 0
    32.             Tophold += 20
    33.         Next
    34.     End Sub
    35. End Class

    for averaging and summing, well you can see how to loop above in the code, just apply that to it and use the Math you should know already
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19
    I think I'm more confused now. I really apreciate yoour patience on my ignorance. I inserted your example to my form and nothing showed in the form. Maybe I just need to step back for a few minutes and resume after a ???

    Christos

  15. #15
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Well make sure you didnt put in the End Class I accidently included and that your forms name is Form1 and that there isnt another Form1_Load event
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19
    I created a new form to test the code and it worked fine. It must be something else in my original form.

    Did you get a chance to play with the app I sent? What do you think?

    Christos

  17. #17
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Glad you got it working.

    The app was cool. Im not sure what use I would have out of it, but its interesting as a concept tool to emulate for your class. Working with arrays is a neccessary skill. So just keep at it!
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  18. #18

    Thread Starter
    Junior Member
    Join Date
    Apr 2004
    Posts
    19

    Expose Code - Final reply

    Although I may be back for more.

    Thanks for everything.

    Christos

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width