|
He wants to know how to write a virus in c# that distributes itself in C#!!!!
Its simple.
POLICE!!!!!
|
|
|
|
|
|
One can disassemble the code of an assembly (in say Visual C# language) complied by using Visual Studio .NET even if it is a Release build. This can be done by using the disassembler "ILDASM.EXE" provided with the VS .NET . It shows all details of the code giving vivid details of all methods, properties, fields, classes, structs, etc. What then is the security of a complied assembly which is in the MSIL version? Tomorrow, anybody can copy your idea and may be even replace some portions of the compiled file, such as the code security portions. Can anyone explain as to whether there is some way out to ensure that a particular assembly could not be disassembled using the aforesaid disassembler or some other similar utility. (here I may point out that an assembly converted to native code by using ngen.exe is only a partial solution in as much as the resultant file cannot be stored in the application directory but is stored in the protected catche). Any solutions or comments?
|
|
|
|
|
You cant prevent disassembly, but you can make reassembly very hard. You can use an obfuscator (but thats really just designed to keep the idiots away), release (iow optimized) builds help too. Have only the least accesible modifiers on classes and members. Another is to make sure you sign all assemblies. If you place your 'security' code in a signed assembly that all your other assemblies depends on, ALL assemblies would have to be altered (resigned) to reconstruct the program. At this point most people says "stuff it" :p
With all that said, I have only seen 1 (one) .NET program that didnt seem 'crackable'. I will not give you details.
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
Hi
Im currently creating a login form and i want to check if the input user name and password matches the data in the database. I have created a table called Users in my database, that contains two columns user name and password. I have declared my sql command text to the sql string and filled my dataset. I then created if else statement such as:
if(username_txt.Text == loginDS1.login.UserNameColumn.ToString() && password_txt.Text == loginDS1.login.PasswordColumn.ToString()
{
main_frm main_frm = new main_frm();
main_frm.Show();
}
else
MessageBox.Show("Incorrect username and password!");
Im a new starter and i really dont know the correct technics however i really need want to learn..... Help!!!
|
|
|
|
|
A few things to consider...
Make sure to use a parameterized query (preferably a stored proc) instead of just a plain query string. I.e.
cmd.CommandText = "usp_GetUserInformation";
cmd.Parameters.Add("@userName", userName); //from username_txt.Text
instead of ...
cmd.CommandText = "select UserName, Password from Users where UserName = '" + username_txt.Text + "'";
The reason for this is to prevent SQL injection attacks.
Another thing...
Don't store the password in plain text in the database. When the user sets up the password, hash it and store the hash. Then when checking the password, hash what they enter the same way and compare it to what is in the db.
Jeff Martin
My Blog
|
|
|
|
|
Hi all,
I need to read the system time and write it to text file when ever the user presses some alphabet keys.
thanks for anykind of help,
Pavan.
Suman
|
|
|
|
|
|
Hi,
thanks for ur reply... if u dont mind can u give me a precise command... i need to read the time upto milliseconds... like hh:mm:ss:ms.... i saw tht tickcounts will do tht but i didnt understand how to use it.
Can u please help me out on this....
Thanks in advance,
Pavan
|
|
|
|
|
how about this.
DateTime[^]
FileStream[^]
You have to start by reading the docs, right?
There are code examples and useful links in both the above docs, if and when you get stuck on a particular part please post again.
|
|
|
|
|
thanks for ur links, i do have gone through them. But i didnt get how to read the time upto NANO or MILLI seconds at the particular instance when we press a specified key on the keyboard, which is the only problem i am having.
I want the format to be like... hh:mm:ss:ms (where ms is milliseconds)
The millisecond property is not related to the system time while it is related to the instance of the application.
it would be greatful if anyone can help me on tht.
thanks,
Suman
|
|
|
|
|
Does anybody know where I can get modern looking bitmaps for commonly used buttons like Bold, Italic, Underline, Undo/Redo, etc.?
Thanks
Eric
|
|
|
|
|
|
|
Hi:
I am currently going through a Wrox book "Professional C++, 2nd Edition". I have been typing in the example code myself and have encountered a strange problem.
Each time an example program uses a "MessageBox" call, the message box is launched, but there is no print on it. The button is there, and it works as expected when you click it but there is no text on the box window OR the push-button.
As a sanity check, I created a basic Windows App using the app wizard. I made one single change to the code: In the constructor for Form1, right after the call to "InitializeComponents", I added the line:
MessageBox("Hello ?");
Same result.
I am using Visual Studio.NET V7.0 with .NET Framework 1.1.4322 SP1. I am running on Windows XP-Pro with all of the latest service packs. I have also transfered the executable code from some of these programs to another machine with the same results.
Has anybody out there had this problem? Any idea what might be going on?
Thanks in advance for you help
Mark
|
|
|
|
|
I can't say that I've ever seen that, but can you confirm, what language are you working in? You said the book you are reading is "Professional C++, 2nd Edition", this is the C# forum. From the looks of your code it does appear to be C++, however you should check the function parameters. The following example I threw together works fine in Visual Studio .NET 2003 using unmanaged C++.
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
MessageBox(NULL, "Hello", "Test", MB_OK);
return 0;
}
|
|
|
|
|
Hi Nick:
Sorry, that was a typo. It IS C# I am talking about and the book is "Professional C#, 2nd Edition."
I have worked through examples where I launch the MessageBox from a push-button handler, from event handlers and event from simple console applications, similar to what you have done above but in C# of course. I get the same result.
In fact, here's a console program that I used:
using System;
namespace Learn.CSharp.MessageBoxTest<br />
{<br />
class MainEntryPoint<br />
{<br />
public static void Main()<br />
{<br />
MessageBox.Show( "Console App", "Hello there!", MessageBoxButtons.OK );<br />
}<br />
}<br />
}
Any ideas?
Thanks,
Mark
|
|
|
|
|
The MessageBox class is defined within the System.Windows.Forms namespace. Assuming that your project has already included a reference to the appropriate assembly, just include it in the using statement:
using System;
using System.Windows.Forms;
namespace Learn.CSharp.MessageBoxTest
{
class MainEntryPoint
{
public static void Main()
{
MessageBox.Show("Console App", "Hello there!", MessageBoxButtons.OK);
}
}
}
|
|
|
|
|
Hi Nick:
The code snippet I provided was missing the "using System.Windows.Forms;" statement but the program I was running was not. The exact program that you recommend in your last response still has the same problem....
Regards,
Mark
|
|
|
|
|
Hi Nick:
This is just a "FYI" type of message:
I finally solved the mystery of the blank message box under .NET. A guy from "Code Guru" tipped me off:
The problem was McAfee Anti Virus V8.0. If you have buffer overflow protection enabled, this will cause the problem I described. Disable BOP or run a hot-fix and the problem disappears.
Cheers,
Mark
|
|
|
|
|
i am developing an application for my final year project, that generate barcodes. my problem is that i want to tell the program to draw a black bar when I enter the number "1" for example, or two black bars when I enter "2"...etc. Could anyone help ?!
Thanks in advance
|
|
|
|
|
|
Hello,
I'm developing an add-in for Word2003 and I have some troubles. I’m using VS .NET 2003 ->extensibility project.
The add-in works fine with the first document in Word I create/open but after It fails, the add-in doesn’t work anymore.
I’m looking for an add-in source code, to see why I always have the same problem, where is the mistake…
In fact all the events (OnConnection, OnDisconnection, etc) only fires with the first document created/opened.
All the source codes I found, didn’t worked…So I’m looking for a complete example source code (in c# .NET)
Do you know where I could find It? Or why does my add-in only works with the first “instance” of Word.
Thanks a lot,
Frenchy
PS: Sorry for my bad English :p
|
|
|
|
|
Are you performing any exception handling in your code? Try settings some break points and stepping through the code during execution to see where it's failing.
|
|
|
|
|
Yes I put try/catch everywhere, as I said, all the events(OnConnection, OnDisconnection, ...) only fire the first time.
All my code is in these events, that's certenly why it doesn't work.
The commandbar with the buttons I created in the "OnConnection" is still in the second document, but the actions, the code doesn't work.
If someone have a complete source code for Word add-in, please tell me where I could find It Or you can send me by mail; frechy@msn.com
Thanks
|
|
|
|
|