.comment-link {margin-left:.6em;}
Gert .Net
[GertDotNet]
20060830
 
Fighing spyware II: pmnlk.dll
My neighbours computer still had very bad response times.

Only in "safe mode with command prompt" it was usable.

Using autoruns (from sysinternals), I found that the computer added startup code to pmnlk.dll to the registry.

I was unable to delete this file, since it was always locked by some process. I was able to find this process using listdlls (thank you Sysinternals). This dll was loaded by winlogon.exe.

So I killed this program (using procexp) and then I was able to delete the pmnlk.dll file.

After that, I was able to run a anti-virus program normally, install Windows Defender, connect to the Internet and run Microsoft Update.
20060824
 
Fighting Spyware

The company nextdoor has 2 PC's. Only one is connected to the Internet, and this is the Big Bad Internet.

For some reason, they put this computer full with spyware. This computer is so overloaded with spyware that it does not function at all anymore. It is impossible to start any program. So that's where I should kick in.

My computer's at work and at home don't have any spyware problem. Why, I don't know but I think I know why:

Now back to the fight.

First thing, was trying to install an anti-virus and anti-spyware application. But this computer was so terribly slow, this was impossible.

The I tried to install from safe-mode (using the magic F8 during boot). But then you cannot install anything.

Then the Big Bad Internet came to the rescue:

So after 2 weeks (!!!) this PC was back to a state where it was stable to install software.

First thing the user did was to install some virus that disable the anti-virus software.


 
Oracle 8.1.7 and .Net

So after a long and painfull process I found out that:

My conclusion:

Do not use Oracle 8 client to connection to 9i or later databases.


 
Rounded rectangles
Copied from somewhere, I think CodeProject and then adjusted somewhat:


using System;
using System.Collections.Generic;
using System.Text;

using System.Drawing;
using System.Drawing.Drawing2D;

namespace Study.XmlSettings.GDIUtil {
class RoundedRectangle {

private RectangleF _baseRect;
private float _radius;

public RoundedRectangle(RectangleF baseRect, float radius) {
this._baseRect = baseRect;
this._radius = radius;
}

public RoundedRectangle(Rectangle baseRect, int radius) {
this._baseRect = new RectangleF(baseRect.X, baseRect.Y, baseRect.Width, baseRect.Height);
this._radius = radius;
}

public GraphicsPath Path {
get { return this.GetRoundedRect(this._baseRect, this._radius); }
}

public void Fill(Brush b, Graphics g) {
using (GraphicsPath p = this.GetRoundedRect()) {
g.FillPath(b, p);
}
}

public void Draw(Pen p, Graphics g) {
using (GraphicsPath gp = this.GetRoundedRect()) {
g.DrawPath(p, gp);
}
}

public void DrawFilled(Pen p, Brush b, Graphics g) {
using (GraphicsPath gp = this.GetRoundedRect()) {
g.FillPath(b, gp);
g.DrawPath(p, gp);
}
}

public void DrawFilled(Color border, float borderWidth, Color fill, Graphics g) {
using (Pen p = new Pen(border, borderWidth))
using (Brush b = new SolidBrush(fill)) {
DrawFilled(p, b, g);
}
}

private GraphicsPath GetRoundedRect() {
return this.GetRoundedRect(this._baseRect, this._radius);
}

private GraphicsPath GetRoundedRect(RectangleF baseRect,
float radius)
{
// if corner radius is less than or equal to zero,
// return the original rectangle
if( radius<=0.0F )
{
GraphicsPath mPath = new GraphicsPath();
mPath.AddRectangle(baseRect);
mPath.CloseFigure();
return mPath;
}

// if the corner radius is greater than or equal to
// half the width, or height (whichever is shorter)
// then return a capsule instead of a lozenge
if( radius>=(Math.Min(baseRect.Width, baseRect.Height))/2.0)
return GetCapsule( baseRect );

// create the arc for the rectangle sides and declare
// a graphics path object for the drawing
float diameter = radius * 2.0F;
SizeF sizeF = new SizeF( diameter, diameter );
RectangleF arc = new RectangleF( baseRect.Location, sizeF );
GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();

// top left arc
path.AddArc( arc, 180, 90 );

// top right arc
arc.X = baseRect.Right-diameter;
path.AddArc( arc, 270, 90 );

// bottom right arc
arc.Y = baseRect.Bottom-diameter;
path.AddArc( arc, 0, 90 );

// bottom left arc
arc.X = baseRect.Left;
path.AddArc( arc, 90, 90 );

path.CloseFigure();
return path;
}

private GraphicsPath GetCapsule( RectangleF baseRect )
{
float diameter;
RectangleF arc;
GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
try
{
if( baseRect.Width>baseRect.Height )
{
// return horizontal capsule
diameter = baseRect.Height;
SizeF sizeF = new SizeF(diameter, diameter);
arc = new RectangleF( baseRect.Location, sizeF );
path.AddArc( arc, 90, 180);
arc.X = baseRect.Right-diameter;
path.AddArc( arc, 270, 180);
}
else if( baseRect.Width < baseRect.Height )
{
// return vertical capsule
diameter = baseRect.Width;
SizeF sizeF = new SizeF(diameter, diameter);
arc = new RectangleF( baseRect.Location, sizeF );
path.AddArc( arc, 180, 180 );
arc.Y = baseRect.Bottom-diameter;
path.AddArc( arc, 0, 180 );
}
else
{
// return circle
path.AddEllipse( baseRect );
}
}
catch
{
path.AddEllipse( baseRect );
}
finally
{
path.CloseFigure();
}
return path;
}
}

}



Powered by Blogger