This fragment is about to be reported (you'll remain on this page):

You can enter a comment to clarify the mistake if you would like to:

Posts tagged “in English”

D7X – Delphi 7 eXtension library

A collection of most used lightweight & standalone Delphi 7 classes, VCL components and functions.

During my long and fruity friendship with Delphi, particularly the 7th version, I have colelcted a large number of helpful standalone classes, VCL components and functions that I've been using in various projects. Not so long ago I decided to put them in a separate build which I called D7X (aka «Delphi 7 eXtension» library). 

One of the main points behind D7X is complete Unicode support in each and every component. You will see that pascalString's are extremely rare in the code. 

It is available from this SVN repository

«…»

No comments yet | Read rest of this entry »

Hooking functions using prologue rewriting

Explains how to hook any WinAPI or other function using prologue rewriting technique in Delphi 7.

This article is written based on a test project that I had made before creating ApiHook – Win32 API hooking tool not so long ago. It demonstrates how to hook library functions – the technique that lies in the very core of ApiHook

The basics 

Let's start with the basic idea. Why we might want to hook, say, a WinAPI function

Simply enough: if a target process calls that function it will essentially call ours. Then we can decide what we do: we can bypass the call normally but probably record some function arguments; we can also change the return valuefor example, if you've hooked explorer.exe and want to hide certain files from the desktop; we can modify parameters to let the original function do something else that the target program intended to. We can even decide not to call any API function or call a different one – because we actually contol the execution from the moment the target calls (our) function and until we return from it. 

«…»

No comments yet | Read rest of this entry »

Fixing Java screen rendering under VMware 8

Fixing Java screen rendering under VMware 8

Some month ago I've bought a new PC (HP DC7800 Ultra Slim Desktop) and while moving from my old desktop PC (1xAMD64 Athlon 3000+ 2.22 GHz) to this brand new silent nettop I've upgraded a lot of my old programs (starting with Firefox 3.6). Among those was VMware 6 Workstation

After upgrading to VMware 8 I noticed nothing problematic until I've installed latest Java JRE 6.30 on the fresh setup of Windows XP SP3 Russian. Previously Java had worked as fine as any other program but this time it did something very weird – when I would start any Java-powered application the virtual display would «scatter» into colorful pieces that would change occasionally when I moved the mouse or attempted to do anything. 

As short Google investigation has showed it was likely the problem of new VMware display driver or one of the recent Java version. This post explains how to fix it in two ways: 

  • Turn Hardware Acceleration to None under Display Properties → Settings → Advanced → Troubleshooting. Not recommended since presumably this is useful for other stuff.
  • Set the global environment variable J2D_D3D to false inside the guest OS. Using reskit tools this is setx J2D_D3D false -m. According to Sun, this setting is used to turn off the Java 2D system's use of Direct3D in Java 1.4.1_02 and later.

I haven't tried the first option but the second (setting J2D_D3D to false) has fixed my problem instantly – I even didn't have to restart the guest OS. 

This forum thread describing the problem might be of interest as well. 

No comments yet | Show this entry »

ApiHook – Win32 API hooking tool

A full-featured console WinAPI hooking tool written in Delphi 7. Freeware. Open source. Public domain.

ApiHook is a freeware (public domain) open-source program written in Delphi 7 for hooking library calls in Win32 systems. In fact, it can be used to hook any snippet of assembly code in a single EXE file as well but this needs a bit of source code tweaking. 

ApiHook lets you track and view information about what functions and how exactly the target program calls. It is implemented in two parts: loader and library. The first injects the ApiHook library into the target process (starting it or attaching to an already running one) while the second does the actual work

ApiHook lets you examine values of registers the called routine was passed and also capture its parameters (using stored asmESP value) and returned value through them. 

The mechanics is simple: you write a script file specifying what actions must be performed when a specific function is called; actions receive the snapshot of the call-time registers and can log them, dump memory blocks or do something else

«…»

No comments yet | Read rest of this entry »

FileDrop – cross-browser JavaScript Drag & Drop file upload

Self-contained cross-browser pure JavaScript class for Drag & Drop and AJAX (multi) file upload.

FileDrop is a lightweight JavaScript class for easy-to-use file uploading that works out of the box. 

Features: 

  • Cross-browser – supports Firefox 3.6, Internet Explorer 6, Google Chrome 7, SRWare Iron 4, Apple Safari 5 and Opera 11.61.
  • Self-contained & tiny – just 470 lines of code; 8 KiB when minified.
  • Various callbacks – on progress, on done, on error and on many other events.
  • Graceful degradation using IFrame fallback.
  • Multiple file selection.
  • Any number of independent FileDrops.

FileDrop uses some ideas and solutions from qq FileUploader (Github) which is similar to FileDrop but almost 3 times as large (although, perhaps, more elaborated). 

«…»

No comments yet | Read rest of this entry »

BEncoded – handling torrent files in PHP

Standalone PHP class for processing bencoding-encoded data, such as bit-torrent files.

BEncoded is a PHP OOP wrapper for two lightenc.php functions from Theory.org for manipulating bencoded data. It lets you transform bencoded files, retrieve data from them, add some, delete, calculate info hashes and do other things using a simple interface. 

Can't want to see? Download now or view its source

First version on 1 July 2011; last update on 23 January 2012

Preface 

«…»

No comments yet | Read rest of this entry »

Never return PChar in Delphi

This is a follow-up on my previous post «Trouble with UTF8Encode» where I've run into a trouble I didn't feel was solvable. Surprisingly enough I've run into the solution in turn much sooner than I expected. 

Intro 

Several days ago I was putting my SQLite wrapper for Delphi 7 in real-life use rather than a demo application and have during the process had stumbled upon a very weird behavior: it kept doing something that prevented SQLite from opening a database. It wasn't something serious, I thought, perhaps I've locked it in some place earlier. However, as I've moved through the code I was understanding that there was no such place.
In the end, after more than an hour of debugging and commenting things out all around the weirdness has hit the apex: everything worked fine if I'd add an extra character used in some completely different part of program and it would say «Cannot open the database» if I'd remove it. 

And then I made some change that made sqlite3.dll crash with an Access Violation. «Whoa,» I thought, «thi is no more my app; what's wrong with this thing?». And I've fired up IDA Pro

«…»

No comments yet | Read rest of this entry »

ColorConsole Delphi unit

An object-oriented approach to colorizing Win32 console output with intuitive formatting.

ColorConsole Delphi unit

This seems like my first post in the New Year (btw, my blog is almost a year old now!). Well, let's start the year with colors then. 

Nearly two years ago I've written two functions to write colorful messages to Windows console based on a string pattern – in other works, without manual calls to SetConsoleTextAttribute. Since then my experience has advanced particularly well so I decided to rewrite those two functions that were somewhat limited anyway. 

This is how the ColorConsole unit was made. It works in Delphi 7 (perhaps in more recent versions too) and uses my D7X – Delphi 7 eXtension library library

Features 

«…»

No comments yet | Read rest of this entry »