Results 1 to 7 of 7
  1. #1
    MrPutin's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    4
    My Mood
    Blah

    Four small errors

    Hey.
    I have downloaded one good program and I have decompiled it. I want to change some adresses and then to build it, but in Visual Studio I have 4 errors found... One is "Duplicate System Runtime Versioning Target Framework attribute", other about names which do not exist. You can see it in the screenshots. I am totally beginner, so although I have found some information about it, I cannot repair the source code.
    I hope skilled programmer will have it done in 4 minutes...

    Could anybody help me? I really need it!

    Thanks a lot.



    Second one.



    Uploaded with ImageShack.us

    Uploaded with ImageShack.us

    Code:
    // Assembly Hack-Dayz, Version 1.0.0.0
    
    [assembly: System.Reflection.AssemblyCompany("")]
    [assembly: System.Reflection.AssemblyProduct("Hack-Dayz")]
    [assembly: System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)]
    [assembly: System.Reflection.AssemblyTitle("Hack-Dayz")]
    [assembly: System.Reflection.AssemblyDescription("")]
    [assembly: System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | System.Diagnostics.DebuggableAttribute.DebuggingModes.Default)]
    [assembly: System.Runtime.CompilerServices.CompilationRelaxations(8)]
    [assembly: System.Runtime.InteropServices.Guid("5862f95c-7600-42ad-85a2-a5334007131d")]
    [assembly: System.Reflection.AssemblyCopyright("Copyright \x00a9  2012")]
    [assembly: System.Reflection.AssemblyFileVersion("1.0.0.0")]
    [assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.0,Profile=Client", FrameworkDisplayName=".NET Framework 4 Client Profile")]
    [assembly: System.Runtime.InteropServices.ComVisible(false)]
    [assembly: System.Reflection.AssemblyTrademark("")]
    
    ----
    
    namespace WindowsApplication1.My
    {
        using Microsoft.VisualBasic.ApplicationServices;
        using Microsoft.VisualBasic.CompilerServices;
        using System;
        using System.CodeDom.Compiler;
        using System.ComponentModel;
        using System.Configuration;
        using System.Diagnostics;
        using System.Runtime.CompilerServices;
    
        [GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), CompilerGenerated, EditorBrowsable(EditorBrowsableState.Advanced)]
        internal sealed class MySettings : ApplicationSettingsBase
        {
            private static bool addedHandler;
            private static object addedHandlerLockObject = RuntimeHelpers.GetObjectValue(new object());
            private static MySettings defaultInstance = ((MySettings) SettingsBase.Synchronized(new MySettings()));
    
            [DebuggerNonUserCode, EditorBrowsable(EditorBrowsableState.Advanced)]
            private static void AutoSaveSettings(object sender, EventArgs e)
            {
                if (MyProject.Application.SaveMySettingsOnExit)
                {
                    MySettingsProperty.Settings.Save();
                }
            }
    
            public static MySettings Default
            {
                get
                {
                    if (!addedHandler)
                    {
                        object addedHandlerLockObject = MySettings.addedHandlerLockObject;
                        ObjectFlowControl.CheckForSyncLockOnValueType(addedHandlerLockObject);
                        lock (addedHandlerLockObject)
                        {
                            if (!addedHandler)
                            {
                                MyProject.Application.Shutdown += new ShutdownEventHandler(MySettings.AutoSaveSettings);
                                addedHandler = true;
                            }
                        }
                    }
                    return defaultInstance;
                }
            }
        }
    }

  2. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Might be a silly question, but the part about ..
    Code:
    [assembly: System.Reflection.AssemblyCompany("")]
    [assembly: System.Reflection.AssemblyProduct("Hack-Dayz")]
    [assembly: System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)]
    [assembly: System.Reflection.AssemblyTitle("Hack-Dayz")]
    [assembly: System.Reflection.AssemblyDescription("")]
    [assembly: System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | System.Diagnostics.DebuggableAttribute.DebuggingModes.Default)]
    [assembly: System.Runtime.CompilerServices.CompilationRelaxations(8)]
    [assembly: System.Runtime.InteropServices.Guid("5862f95c-7600-42ad-85a2-a5334007131d")]
    [assembly: System.Reflection.AssemblyCopyright("Copyright \x00a9  2012")]
    [assembly: System.Reflection.AssemblyFileVersion("1.0.0.0")]
    [assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.0,Profile=Client", FrameworkDisplayName=".NET Framework 4 Client Profile")]
    [assembly: System.Runtime.InteropServices.ComVisible(false)]
    [assembly: System.Reflection.AssemblyTrademark("")]
    (error 1: Duplicate System Runtime Versioning Target Framework attribute)
    did you type all that manually into your new project? When you create a new project in msvs, it should automatically add all those properties for you (when you tell it the project name / target framework etc). ??
    (aka. how did it get in there twice? A bug in msvs, or you typed it in?)

    --not sure about the legality of 'copying'/'modifying' someone's program like that. (?)

    Do you know about Classes, variable scope, functions etc? Or is this your first time programming? Just new to C#?
    Last edited by abuckau907; 01-24-2013 at 11:19 AM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  3. #3
    MrPutin's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    4
    My Mood
    Blah
    I am totally beginner. I just need to optimalize the program. So I do not know anything.
    Copying - I think it will not be problem because the program will be only for me.

  4. #4
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    MyProject.Application.SaveMySettingsOnExit should be Properties.Settings.Default.SaveMySettingsOnExit ? but..

    "SaveMySettingsOnExit" isn't declared.

    Code:
    internal sealed class MySettings : ApplicationSettingsBase
        {
            private static bool addedHandler;
            private static object addedHandlerLockObject = RuntimeHelpers.GetObjectValue(new object());
            private static MySettings defaultInstance = ((MySettings) SettingsBase.Synchronized(new MySettings()));
    
            [DebuggerNonUserCode, EditorBrowsable(EditorBrowsableState.Advanced)]
            private static void AutoSaveSettings(object sender, EventArgs e)
            {
                if (MyProject.Application.SaveMySettingsOnExit)
                {
                    MySettingsProperty.Settings.Save();
                }
            }
    
            public static MySettings Default
            {
                get
                {
                    if (!addedHandler)
                    {
                        object addedHandlerLockObject = MySettings.addedHandlerLockObject;
                        ObjectFlowControl.CheckForSyncLockOnValueType(addedHandlerLockObject);
                        lock (addedHandlerLockObject)
                        {
                            if (!addedHandler)
                            {
                                MyProject.Application.Shutdown += new ShutdownEventHandler(MySettings.AutoSaveSettings);
                                addedHandler = true;
                            }
                        }
                    }
                    return defaultInstance;
                }
            }
        }
    ^^ie. 3 private things, and 1 public. Where is the variable for "AutoSaveOnExit"?

    you have to declare a local variable in the properties class (Settings.Designer.cs) named AutoSaveOnExit..or um..SaveMySettingsOnExit.

    Code:
    internal sealed class MySettings : ApplicationSettingsBase
        {
            public bool SaveMySettingsOnExit = true; // or false I guess
            private static bool addedHandler;
            private static object addedHandlerLockObject = RuntimeHelpers.GetObjectValue(new object());
            private static MySettings defaultInstance = ((MySettings) SettingsBase.Synchronized(new MySettings()));
    
            [DebuggerNonUserCode, EditorBrowsable(EditorBrowsableState.Advanced)]
            private static void AutoSaveSettings(object sender, EventArgs e)
            {
                if (MyProject.Application.SaveMySettingsOnExit)
                {
                    MySettingsProperty.Settings.Save();
                }
            }
    
            public static MySettings Default
            {
                get
                {
                    if (!addedHandler)
                    {
                        object addedHandlerLockObject = MySettings.addedHandlerLockObject;
                        ObjectFlowControl.CheckForSyncLockOnValueType(addedHandlerLockObject);
                        lock (addedHandlerLockObject)
                        {
                            if (!addedHandler)
                            {
                                MyProject.Application.Shutdown += new ShutdownEventHandler(MySettings.AutoSaveSettings);
                                addedHandler = true;
                            }
                        }
                    }
                    return defaultInstance;
                }
            }
        }
    and also change MySettingsProperty.Settings.Save to Properties.Settings.Default.Save();


    I do mostly vb.net sorry. I might be wrong.

    My suggestion -- analyze what settings the program is saving. Are there a lot? Maybe forget about storing them in "Settings" and just create a global variable for each setting, since it's just for you. And erase all the code related to saving settings.

    edit: you changed the namespace from "Settings" to "My" so....

    MySettingsProperty.Settings.Save == Properties.My.Default.Save();

    -- and also, I'm not sure how you modified the "properties" class, because when I create a new project in c# 4.0, my default looks like this (I'm not sure where you got the addHandle / addHandlerLockObject) (?)

    Code:
    namespace WindowsFormsApplication1.Properties
    {
    
    
        [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
        internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
        {
    
            private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
    
            public static Settings Default
            {
                get
                {
                    return defaultInstance;
                }
            }
            public string DoShit = "hellno"; // not default, testing namespace/visibility.
    
        }
    }
    ------
    Code:
    if (Properties.My.Default.SaveMySettingsOnExit)
    {
    Properties.My.Default.Save();
    }


    any of the errors go away? Hopefully only 2 now?

    ---------- Post added at 02:17 PM ---------- Previous post was at 01:29 PM ----------

    or, upload the entire project's source somewhere (remove any lines you deem sensitive of course) (w/ 2 antivirus scans, as dictated by forum rules)

    and I'll modify the code and re-upload project.

    ---------- Post added at 03:13 PM ---------- Previous post was at 02:17 PM ----------

    or, if you have TeamViewer (and understand security details involved?), I can connect to you and show you.
    Last edited by abuckau907; 01-24-2013 at 01:18 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  5. #5
    MrPutin's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    4
    My Mood
    Blah
    That would be awesome... I really need it, because it is my school project. At all, I have scanned it with Virustotal and it in one case says there is a scanner inside. Thats why I want to tell you the program is a decompiled key stealer, it means malware, which has attacked my PC in the past. And because my project is "Malware" I have chosen this one bad program, because I know how does it work and I can show its badness to other people. And example of its uploading with the source code will be nice! :-)
    I need only to help with the errors, the website is already made.

    For URL check your profile.
    Thanks a lot.

  6. #6
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Why does your project have 2 copies of all the files? How are you 'disassembling' the program back into source code? Just make a new project and add the important parts by hand: I'm not sure how you created that msvs project you posted to my wall, but it has more than 4 small errors. I don't think I can help, sorry.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  7. #7
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

Similar Threads

  1. [Solved] 4D1(four Delta one) help error when map is loaded fully I get errors
    By Vincent Dominguez in forum Call of Duty Modern Warfare 2 Help
    Replies: 3
    Last Post: 07-30-2012, 03:11 PM
  2. [Help Request] Small Errors (Beginner To Hack Making)
    By Nuckets in forum Combat Arms Coding Help & Discussion
    Replies: 2
    Last Post: 12-13-2011, 01:18 AM
  3. Hellbreath Int Error?
    By RebornAce in forum General
    Replies: 10
    Last Post: 03-06-2009, 09:04 PM
  4. K Warrock error :(
    By i eat trees in forum WarRock - International Hacks
    Replies: 2
    Last Post: 01-26-2006, 08:40 PM