|
Oh, If the drive is that bad I will be suggesting a third party tool.
My questions were mainly based around making this a research project for myself, no timescales. I'm interested in understanding. Whenever I see pieces of software where people charge such a varying amount for, I'm always curious as to the true effort involved. I don't expect this to be a 3 hour coding project, but I would like to find more reading material on it
|
|
|
|
|
Hi,
does anyone know a free .NET crypter/protector? My problem is, that there are many free obfuscators I could use, but with obfuscation all the code (also in Log and Tracefiles) is blurred and our developement team is no longer able to assigne the error codes to a function.
So, does anyone know of a possibility to obfuscate code without blurring special function names? A tool, which just obfuscates the "in-function" code like algorithms?
Or is there maybe a completely different solution for my problem?
Thanks for any advice!
Cheers, cheery
|
|
|
|
|
What you want is near to impossible, or at least very difficult. I believe professional obfuscation tools might be able to do what you need, at least partially, but you can't get those for free.
Anyway, no obfuscation algorithm can protect your code. If you keep your method names unchanged - probably because you need descriptive names - then your code cannot really be obfuscated. A good descriptive method name pretty much says what the method does (that's its purpose, in the end), which helps a lot to any potential reverse-engineer.
As for the method body, automatic obfuscation usually only consists of renaming all identifiers and a few more well-defined steps. The algorithm has no knowledge of your code and it can only do very little because it must not break your code.
|
|
|
|
|
There is control-flow obfuscation though
|
|
|
|
|
spaghettization?
|
|
|
|
|
cherrymotion wrote: all the code (also in Log and Tracefiles) is blurred and our developement team is no longer able to assigne the error codes to a function.
They're using reflection to determine the name of the current function? How about replacing those with encrypted constants? Should be easy to decrypt. Wouldn't recommend on doing that change manually though; best to create a small app that modifies the current source-files.
cherrymotion wrote: Or is there maybe a completely different solution for my problem?
There's no solution, merely patches.
I are Troll
|
|
|
|
|
Currently, my IT department has rolled out to my user community the following CasPol.exe setting:
"c:\Windows\Microsoft.NET\Framework\v1.1.4322\CasPol.exe" -m -ag All_Code -url http://ProdServer/App1/* FullTrust -n App1
The new version of the application says that the following CasPol.exe command needs to be executed because the application is now a .NET 2.0 application.
"c:\Windows\Microsoft.NET\Framework\v2.0.50727\CasPol.exe" -m -ag All_Code -url http://ProdServer/App1/* FullTrust -n App1
Is this really necessary ?
I have to roll out the new version of the application to 70 desktops and this would require that the CasPol.exe command be issued to all of those users. (The users are not local Admins, so it may be a bit tricky to run in a logon script.) Right ?
Cheers.
David
|
|
|
|
|
Well, I finaaly had to upgrade the system and YES, I did have to go to each desktop and run the CasPol.exe command under .NET 2.0 in order for it to work.
Just wanted to let everyone know what the answer was.
|
|
|
|
|
Hi All,
I have Typed Datasets, I am creating Table Adapters for them. What I want is, I want to create the table adapters with parameters. Is there any way to create table adapters
with parameters and with relations. So that, if we select a specific department in "dept" table then the Employee table adapter also picks only those employees from "Employee"
table who belongs to that particular dept.
Is there any way please help me in this regards, I am new to Typed Datasets. Any links or suggestions will be of great help.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
indian143 wrote: Any links
There's a Howto[^] article and the general overview[^] on MSDN that might be helpfull. You can change the version of the targeted framework with the link on top of the page.
I are Troll
|
|
|
|
|
Bit of a strange one here guys (And if anyone can suggest a more appropriate forum, please do!).
We have a fairly complex (111 projects spread across asp.net, silverlight, WFC, Ria Services etc) solution, which builds correctly on my dev box (2010). If I fire up VS on our build machine, I can also build the solution correctly. However, when I queue a build, it almost makes it through, until it attempts to run SGen - at which point I get the old "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information." chestnut.
I've googled to try to find a solution, but nothing appears to do the job - the error is occurring at complile time rather than runtime, and I've added the v2 activation key to Team build host's config file to no effect. There are no tests in the solution which might cause things to be loaded.
Any ideas? Anyone? Particularly confused that VS can build ok on the server, but team build fails.
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi
I'm working on a Spectrum analyzer application and need some help to get the graphics updated in an optimal manner.
Whenever my program receives a new block of audio data I do an FFT and I then update the oldest FFT data (a column) in my 2D-matrix which is then copied to a bitmap for display. So this spectrogram is shifted horizontally as data arrives in blocks. I see two options for achieving the shifting of the NxM bitmap whenever a new FFT output block arrives:
1. Copy columns [0:M-2] to [1:M-1] and then copy in the new FFT data...hope the notation makes sense. This requires a lot of memory copying and I hope to avoid that using GDI.
2. Replace the "oldest" column (the matrix works as a circular buffer in the time-direction) and let GDI ensure that when wrap-around happens GDI the remaining columns (the columns up to the column where the new FFT data resides) are copied to the bitmap. I once did a spectrum Analyzer in C++ project using OpenGL that supports this functionality. Can find the project anymore..I tried to look for it to find the name of the instruction used. Does GDI/GDI+ support this?
Do any of you guys know how I get to do this efficiently?
Thx
Tom
modified on Sunday, September 19, 2010 8:00 PM
|
|
|
|
|
Hi,
when you use a circular buffer (holding all N columns of your graph) as you indicated, then you can always paint them in two parts, as the first physical columns [0,P-1] will map onto logical columns [N-P, N-1]; whereas the remaining physical columns [P, N-1] will map onto the logical columns [0, N-P-1] for some value of P. Therefore the logic you have to paint should be applied twice, once to each said part.
FWIW: you could keep using a single full-size Bitmap to convert your matrix into a draawing, there is no need to allocate one or two new bitmaps all the time.
|
|
|
|
|
Hi
Thanks for your support!
OK I understand your way of doing circular buffering. Do you know which copying method is fastest? I've been searching for options and "bitblt" seems the fastest method - are you familiar with it and is it recommendable?
Also, as you might have guessed I'm a newbie with C# (actually I'm only good at Matlab) and I'm trying to understand GDI better ...but it's challenging. Can I do the spectrogram using the bitmap itself and manipulate data in it for every update - I gues I can but is it efficient MIPS wise?
Can you please provide me a few keywords on how you would go about this? From the examples I've found searching googling bitmapdata seems a component I might have to use but I can't understand for what reason. MSDN doc seems sparse
http://msdn.microsoft.com/en-us/library/system.drawing.imaging.bitmapdata.aspx
Sorry for all the questioning
Thx
Tom
|
|
|
|
|
Hi Tom,
1.
bimbambumbum wrote: Do you know which copying method is fastest?
It depends. What type are your matrix elements? how are they calculated/obtained? can you choose their type, format, and storage characteristics at the producer (without adding a significant number of cycles)? Is there only one trace in the image? Is it black/white, grayscale, colored?
2.
bimbambumbum wrote: MSDN doc seems sparse
It may be obscure, hard to understand, lacking examples, but scarce it is not.
AFAIK GDI/GDI+ only paint images represented by the Image/Bitmap classes in .NET; so yes BitmapData is relevant. They do support all kinds of PixelFormats though.
3.
I would avoid having a matrix and a bitmap, requiring converting one in the other. I'd rather have the producer manipulate the bitmap, i.e. move existing data (or not) and stuff new data. It may take "unsafe code", "pointers", and maybe native code and "P/Invoke" for max performance.
4.
if you already have something up and running (slowly), I'd be interested in image size, column update frequency required, and current performance (with summary hardware description). And maybe relevant code.
5.
I might consider writing an article, as it seems like an interesting topic for one.
|
|
|
|
|
Hi Luc
Thanks for your reply - once more....you are a fast responder
1. My matrix is not really a matrix but just an array of bytes of size [3*bitmap.height*bitmap.width] so by the 3 term this should correspond to 24bit but less resolution will be ok for the final application. I want to insert the 20*log10(abs(FFT-bins/2) into each column of the bitmap (FFT-bins/2 could be 256, 512 or 1024). Yes I can define the producer type/format myself. Grayscale is probably fine. "..Trace in the image" - can you elaborate?
2. OK, I'm starting to understand now.
3. Yes I get the point. I just read that scrollWindow might be what I'm looking as it offers horizontal shifting by a pixel which is basically what I'm looking for. You know of this method?
4. Image size could be up to 1024x1024. Update frequency is likely to be around 25Hz. I can share the code if you are interested but I'm thinking you can do a much better job than me.
5. There is another spectrum analyzis tool I'm thinking of adding to my application. Maybe that can beef up your article if you are interested.
Thx
Tom
|
|
|
|
|
If I understand correctly, you have at most a 1024*1024 color image, that is scrolling horizontally and gets up to 25 columns added per second, with a producer you control. That should not be any problem.
Yes, I think I have used ScrollWindows in the dark ages of Win32, I wouldn't need it in .NET
I would consider a Control (say a Panel) that would show a Bitmap and accept a columnar data update. Give me 24 hours, I'll experiment a bit in C#, and get back to you.
What would you want for initial content? axes? grid lines? legend?
BTW: I found a plotting graph here: High Speed, Feature Rich, and Easy-To-Use Graphs and Charts[^]. Haven't looked inside yet.
|
|
|
|
|
Hi Luc,
Sounds cool! looking forward to see what you come up with.
For the spectrogram I wouldn't worry about axis for my app but if you want to write an article you might want to put a frequency and time axis and possible a colorbar which maps the spectrogram colors to an intensity for the frequency components.
Let me know if I can contribute in any way...going to bed know
Thx
Tom
|
|
|
|
|
Hi Tom,
1.
I studied the article High Speed, Feature Rich, and Easy-To-Use Graphs and Charts[^] a bit; it has a Plotter class which is a UserControl displaying a number of traces, each trace defined as a sequence of points. So there is no bitmap, no image, involved at all. It basically is vector graphics, which makes it high-performance.
2.
I did some experiments with a bitmap-based plotter-like Panel, where one column of pixels would be updated at a time, using the circular buffer approach we discussed earlier. It is double-buffered to avoid flickering, and it works remarkably smooth, in fact it looks much better than the other article's demo, however I suspect that is due to the demo having fewer data points than the plotter is wide, causing the graph to jump all the time.
At 512*512 my plotter happily handles 30 updates (frames) per second, using between 10 and 15% of a middle-of-the-road dual-core (I use both cores, as one executes the main thread, i.e. the painting, whereas the other calculates the new column in a BackgroundWorker).
Yet I am convinced it takes too much CPU load for the net result. So I think I should look into other technologies, being OpenGL and DirectX. And I will, in time.
3.
For the moment, I'm convinced if all that gets shown basically is a line graph, one should not resort to images at all. It will be much more lightweight when the graphs are drawn straight from a sequence of points, no matter what technology is used for painting images.
ADDED
Of course, when doing so, there is no problem whatsoever to make it scroll.
/ADDED
|
|
|
|
|
Hi Luc
Glad to hear you are in good progress. I will take a look at the article you are refering to.
I've advanced a bit tonight myself because the spectrogram is now up running. I'm currently using drawImage() which seems to do well. My laptop (Lenovo T61p) uses about 20% of it's resources but the app also does FFTs 50 times a second and computes the log-spectrum of these FFT outputs which costs a little too so I'm pretty impressed with the GDI performance.
Even though I running double-buffering I still think my 768x1024 pixel spectrogram does some flickering..do you have a way to get rid of this?
Also, I need an efficient way of mapping from FFT log-outputs to a colorrange...you know of an easy way of doing this?
Sorry for all the question...I have a lot to learn with .NET (and programming in general besides Matlab)
Addition: I guess the flickering comes because I'm manipulating the bitmap directly and not bitmapdata. If that is the case maybe drawimage is not such a good option????
Thx
Thomas
modified on Tuesday, September 21, 2010 12:09 AM
|
|
|
|
|
bimbambumbum wrote: .do you have a way to get rid of this?
yes. do it correctly.
and no. there is no perfect solution, switching from one image to the next always takes a finite amount of time, it is a matter of getting it minimal. you will not see flickering when the repaint time is small compared to the steady time.
I suggest you show the relevant code.
bimbambumbum wrote: mapping from FFT log-outputs to a colorrange
technically, have an array of colors, one for each integer in a limited range of possible values (if need be, divide by some constant so only say 256 colors remain).
esthetically, whatever you like. You could create a hue-wig, i.e. all colors with same (probably max) saturation and brightness but different hue values.
|
|
|
|
|
Hi Luc
Here is the core of my bitmap shifting. If you run it you can see that the shifting flickers a little and I would like to avoid that.
Hope you have a simple way of getting rid of the flickering. Sorry for the messy code....Mind you I'm a newbie
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using fftwlib;
namespace GDI_evaluation
{
public partial class Form1 : Form
{
Timer timer = new Timer();
Graphics g;
int XREF = 50;
int YREF = 50;
Bitmap myBitmap;
Random rnd;
int tIndx = 0;
public Form1()
{
InitializeComponent();
rnd = new Random();
this.SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer, true);
myBitmap = new Bitmap(768, 512, PixelFormat.Format24bppRgb);
timer.Tick += new EventHandler(timer_tick);
timer.Interval = 1000 / 25;
timer.Enabled = true;
timer.Start();
}
void timer_tick(object sender, EventArgs e)
{
this.Refresh();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
}
protected override void OnPaint(PaintEventArgs pe)
{
g = pe.Graphics;
Rectangle block1 = new Rectangle(XREF + tIndx, YREF, myBitmap.Width - tIndx, myBitmap.Height);
g.DrawImage(myBitmap, block1, 0, 0, myBitmap.Width - tIndx, myBitmap.Height, GraphicsUnit.Pixel);
Rectangle block2 = new Rectangle(XREF, YREF, tIndx, myBitmap.Height);
g.DrawImage(myBitmap, block2, myBitmap.Width - tIndx, 0, tIndx, myBitmap.Height, GraphicsUnit.Pixel);
int tIndx2 = tIndx - 1;
if (tIndx2 < 0)
tIndx2 = myBitmap.Width - 1;
for (int ii = 0; ii < myBitmap.Height; ii++)
myBitmap.SetPixel(myBitmap.Width - 1 - tIndx2, ii, Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)));
if (++tIndx == myBitmap.Width)
tIndx = 0;
}
}
}
|
|
|
|
|
Hi,
I did not run your code, I have some comments just by looking at it:
1.
you paint onto your Form, I always avoid that. I prefer adding a Panel to the Form, then painting to the Panel. Make the Panel the exact size of the plot, and make the Panel double-buffered, not the entire Form.
ADDED
and only repaint (i.e. Invalidate or Refresh) the panel.
/ADDED
2.
I see you modify your data inside OnPaint; one should not do that, as OnPaint may be called by the system whenever it feels a need (e.g. when an unrelated window gets shown, then disappears, uncovering your window).
3.
you should use a local variable to store the value of myBitmap.Height, and not call any unnecessary property inside a loop; it will typically not be optimized away!
4.
bimbambumbum wrote: opdater grafik 50 /sekund!!!
?
|
|
|
|
|
Hi Luc
Thanks for your comments.
I get your points - I think
Will try to follow your recipe when I have time tomorrow.
If you have an example I can steal from that would be great...
Thanks
Thomas
|
|
|
|
|
bimbambumbum wrote: I'm manipulating the bitmap directly
so do I. The alternative with LockBits prevents multi-threading, i.e. you can no longer have concurrent image updates and image repaints by different threads.
However, SetPixel() is a very slow method. My test does two DrawLine() to update one column (one full-height background, one foreground).
|
|
|
|
|