|
I thought ILMerge only worked for IL assemblies. C++ with assembly code would compile directly to machine code. Would ILMerge still work then? And even if it did work then, I don't understand how that would make things more direct than creating a few projects and having a couple references in Visual Studio.
|
|
|
|
|
That's why I was planning C++/CLI, it makes mixed assemblies right?
At the very least, mixed assemblies exist in the wild, even though I'm not sure how they were made..
|
|
|
|
|
I suggest you stop trying to write your piece of malware (which is really the only thing it can be, if you want to disable interrupts)
|
|
|
|
|
Why in the world do you think the OP is creating malware or is trying to disable interrupts? Did the OP modify the question, because I don't see any mention of disabling interrupts. There are many uses for assembly language in higher level languages, usually relating to performance. For example, at the bottom of my SlimList article, I mention that I can use BSR (an assembly command) to do a quicker base 2 integer log calculation than would be possible using plain C#.
|
|
|
|
|
Did you miss this[^]?
Maybe you where occupied in darker areas?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Luc Pattyn wrote: Did you miss this[^]?
Yep.
Luc Pattyn wrote: Maybe you where occupied in darker areas?
QuickAnswers... a dark place indeed.
|
|
|
|
|
yes it can be done using c++ project wrapper then you would add reference to that dll into .net ,
but be careful , when you do so , you lose the portability that microsoft struggles for when it creates .NET technology , it can't be run on different OS because your embedded assembly code will be targetted for specific platform .
Requirements to create the c++ wrapper dll
1 - Decorate the method in c++ as "extern" to stop the compiler from changing the method name when you compile your DLL .
2 - you can even call the dll methods without using unsafe declaration , because it will be treated like any dll referenced in .NET project.
i hope this helps
Human knowledge belongs to the world.
|
|
|
|
|
Strictly speaking, you can't as others have said.
However this thread[^] says that you can use simple assembler instructions inline. WARNING You have to register to download the code. No personal details are required though.
I also doubt that it compiles down to a binary file, don't know because I haven't looked at it myself yet. Still it might be fun even if not actually useful.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
|
How can I write sql sentence with byte[] parameter?
NOTE: I don't want to use SqlParameter.
string sql = "INSERT INTO MyFile(FileId, BinaryFile) VALUES('" + fileId + "','" + file + "')";
....
command.ExecuteNonQuery();
fieldId is int variable, file is byte[] variable.
In database; FileId is int field, file is varbinary(MAX) field.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:29am.
|
|
|
|
|
I don't want to use SQL Parameter. I use MS SQL.
|
|
|
|
|
Tough, you have to. And it's the right thing to do, every time.
|
|
|
|
|
First of all, please don't use sql like this. As you are using SQL Server, you should really use command parameters (this helps circumvent SQL Injection Attacks). Then you could set the data easily, as detailed here:
using (SqlCommand cmd = new SqlCommand("MyFile(FileId, BinaryFile) VALUES(@fileid, @file", connection)
{
cmd.Parameters.AddWithValue("@fileid", fileid);
cmd.Parameters.AddWithValue("@file", file) ;
cmd.ExecuteNonQuery();
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
That's like saying you want to swim but you don't want to get wet. Maybe if you tell us your reasons why you don't want to use a parameter object we could help you with a solution that better fits your needs. Otherwise it isn't worth coming up with an answer because who knows what other objects you refuse to use for no apparant reason.
|
|
|
|
|
Like other have said, unless you're really experienced with SQL, you should use parameters (and even if you are really experienced, it's still a good idea).
The first problem is you appear to be using the wrong data type to store bytes. VARBINARY is a character type to store binary strings (useful for forcing case sensitivity, IE, 'a'='A' in a char type, but not a binary type) - http://dev.mysql.com/doc/refman/5.1/en/binary-varbinary.html[^] You probably wanted a BLOB type of some kind.
As for storing byte[] with an SQL statement, converting the bytes into a hexadecimal string value should work -
INSERT INTO (FileID, Data) VALUES (1, 0x0F2EAA32);
|
|
|
|
|
|
How i can disable Intrupt in Critical Section?
please guid me
|
|
|
|
|
Even if you manage to do that (which you won't, you'd need to execute cli in ring 0, how to do plan to do that?) you would completely break windows. Not good.
Why do you think you need to do this?
|
|
|
|
|
harold aptroot wrote: Why do you think you need to do this?
To dream the impossible dream
To fight the unbeatable foe
To bear with unbearable sorrow
To run where the brave dare not go
To right the unrightable wrong
To love pure and chaste from afar
To try when your arms are too weary
To reach the unreachable star
This is my quest
To follow that star
No matter how hopeless
No matter how far
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
is that really you, Pete O'?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
'tis I. It seemed appropriate (and I just heard it on a Honda ad).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
you'd better explain why you want to do this, and what it is you want to achieve. There may be better ways.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
The correct answer is {EA2E30B3-5AC2-400e-91D7-72E353F0760D}. He asked you to guid him.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Now I have a guiding problem, your codes throw a BadArgumentException.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|