msgbartop
DoneVII CET & CPPLITE
msgbarbottom

30 Jun 09 团购 textmate

发现 zend studio for eclipse 和 netbeans 越来越不好用,越来越大(慢)。

快速开发还是转向 textmate ,正好 twitter.com/fire9 在组织团购,报名等待了,大概一人 200 多 RMB。

报名入口

Tags:

30 Jun 09 textmate 支持 gb2312 的方法

下载 Textmate Bundle

问题就是我们使用TextMate不支持GB2312等编码,用着及其不方便,下面是解决方案:

打开Bundle Editor
选则Show all

选则文件夹TextMate(或者随便你选则什么)
增加一个新的template‘openEncodedFile’(或者随便你自己命名)
在Template data中如下设定
Extension:中 留空

Command(s):

# open CocoaDialog’s file select menu

file=$(CocoaDialog fileselect \
        --title "Open an encoded file" \
        --with-directory $HOME/ \
)
# check for valid file
if [ -n "$file" ]; then
# open CocoaDialog's dropdown menu
# for more encodings add them to '--items'
# to list all possibile encodings use the Terminal with 'iconv -l'
        res=$(CocoaDialog dropdown \
                --title "Open an encoded file" \
                --text "Choose the encoding:" \
                ??exit?onchange \
                --button1 "Open" \
                --button2 "Cancel" \
                --items "BIG5" "EUC-TW" "GB2312" "SJIS" "EUC-JP" "KOI8-R" \
        )
# if user canceled exit
        [[ $( (tail -r <<<"$res") | tail -n1)  == "2" ]] && \
                exit_discard
        res=$(tail -n1 <<<"$res")
# add more 'elif' according to '--items' if needed
        if [ "$res" == 0 ]; then
                ENC="BIG5"
        elif [ "$res" == 1 ]; then
                ENC="EUC-TW"
        elif [ "$res" == 2 ]; then
                ENC="GB2312"
        elif [ "$res" == 3 ]; then
                ENC="SJIS"
        elif [ "$res" == 4 ]; then
                ENC="EUC-JP"
        elif [ "$res" == 5 ]; then
                ENC="KOI8-R"
        fi
# start conversion to UTF-8 and send the result as a new file back to TM
        iconv -f "$ENC" -t utf-8 "$file" > "$TM_NEW_FILE"
fi
Output: Insert as Text - Activation: Key Equivalent shift+option+o (我的建议) - Scope: 留空

Tags:

25 Jun 09 比 Google Chrome 更 NB 的广告

这是人们未发现的 Macbook 的新功能。

Tags: ,

24 Jun 09 日本女优大集合舞蹈

测试一下效果如何。


日本女优大集合舞蹈

4s — 吉泽明步(100%)
8s — 有希ちな(90%)
10s — 千堂ゆりあ(100%)
12s — 西野翔(100%)
14s — 苍井空(100%) ~~
17s — 麻美ゆま(100%)
20s — 佐山爱(100%)
24s — 黒木アリサ(95%)
29s — 高树玛利亚(90%)雨音レイラ(5%)
32s — 朝美惠香(100%)
40s — 美咲マリ(90%)
42s — 相内リカ(100%).
58s — 初音みのり(100%)
60s — 柚木提娜(100%)

Tags: , , ,

12 Jan 09 Cornerstone 1.1.6 cracked

Cornerstone 是我在 mac 下用得最好的 GUI SVN Client 了,终于在 msj 上找到了对应的 cracked 版本。

http://rapidshare.com/files/182050215/cs_116_22_.rar

Tags:

08 Jan 07 免费软件套装

在 CB 上看到的……

办公

OpenOffice - office suite
PC Suite 602 - office suite
AbiWord – text editor
Atlantis Nova – text editor
Microsoft PowerPoint Viewer - power point files viewer
Adobe Reader – pdf reader
Foxit PDF Reader – pdf reader
PDFCreator – create pdf documents
Doc Convertor - document convertor
Convert – unit convertor
Converber – unit convertor
Sunbird – calendar/organizer
EssentialPIM Free – calendar/organizer
PhraseExpress – speed up your writing
ATnotes – create notes on the desktop

解压缩

7-Zip - compression program
IZArc - compression program
TugZIP - compression program
CabPack – compression program
Universal Extractor – extract files from any type of archive

互联网

Firefox browser
Internet Explorer- browser
Maxthon browser
Opera browser
Avant Browser browser
Thunderbird – email client
PopTray – check for emails
Free Download Manager – download manager
FlashGet - download manager
WellGet – download manager
Download Master – download manager
WGET – commandline download manager
HTTrack – offline browser
WebReaper – offline browser
Yeah Reader - RSS reader
GreatNews - RSS reader
RSSOwl – RSS reader

P2P

µTorrent – torrent client
Azureus – torrent client
BitComet – torrent client
ABC – torrent client
BitTornado – torrent client
eMule – p2p client
SoulSeek – p2p client
Shareaza – p2p client
DC++ – Direct Connect network client
PeerGuardian – IP blocker

聊天

Miranda – chat client
MSN Messenger – chat client
Yahoo Messenger – chat client
QIP – chat client
Gaim – chat client
JAJC – chat client
HydraIRC – IRC client
Talkative IRC – IRC client
IceChat – IRC client
Skype – VOIP client
Google Talk - VOIP client
VoipStunt – VOIP client
Gizmo – VOIP client
Wengo – VOIP client

安全

AVG Free – antivirus
Avast Home Free – antivirus
AntiVir PersonalEdition – antivirus
BitDefender Free – antivirus
ClamWin – antivirus
CyberDifender - Internet Security Suite
Ad-aware – anti-spyware
Spybot: Search & Destroy – anti-spyware
Windows Defender – anti-spyware
SpywareBlaster - anti-spyware
Spyware Terminator – anti-spyware
Tootkit Reveaker - rootkit detection utility
Winpooch - system protection
HiJack Free – system protection
HighJackThis – hijackers detector and remover
Kerio Personal Firewall – firewall
Sygate Personal Firewall - firewall
ZoneAlarm - firewall
AxCrypt – file encryption
Simple File Shredder – securely delete files
PuTTy - SSH client
KeePass – password manager
LockNote – password manager
nPassword – password manager
Microsoft Baseline Security Analyzer – identify security misconfigurations

网络

Hamachi – VPN client
RealVNC – remote control
UltraVNC – remote control
Ethereal – local area network administration
The Dude – network administration
Wireshark – network administration
Angry IP Scanner – IP scanner
IP-Tools - IP scanner
Free Port Scanner – IP scanner
NetMeter – network bandwidth monitoring

服务器

FileZilla – FTP client
FileZilla Server – FTP
EFTP – FTP client/
XAMPP – integrated package of Apache, mySQL, and Perl
WAMP – Apache, PHP5 and MySQL

音频

Foobar2000 – audio player
WinAmp – audio player
1by1 – audio player
JetAudio – audio player
XMPlay – audio player
Xion – audio player
Apollo – audio player
MediaMonkey – music organizer
The GodFather – music organizer
dBpowerAMP – audio converter
Audacity – audio converter
WavePad – audio converter
Kristal Audio Engine – audio editor
Exact Audio Copy – CD ripper
Audiograbber – CD ripper
CDex – CD ripper
Mp3 Tag Tools – tag editor
Mp3tag – tag editor
Taggin’ MP3 – tag editor
Monkey’s Audio – APE compressor/decompressor
mpTrim - mp3 editor
WavTrim - wave editor
EncSpot Basic – analyse mp3 files

视频

Windows Media Player – audio/video player
VLC – video player
Media Player Classic – video player
MV2Player – video player
CrystalPlayer 1.95 – video player
Zoom Player – video player
GOM Player – video player
viPlay – video player
DSPlayer – video player
VirtualDub – video editor
CamStudio – video screen recording
AviSplit – Avi splitter
Video mp3 Extractor – rip audio from video files
Free iPod Converter – convert all popular video formats to iPod video
MediaPortal – turning your PCinto a Media Center
The FilmMachine

图像

Gimp – image editor
PhotoFiltre – image editor
Paint.net – image editor
ArtRage - image editor
Artweaver – image editor
IrfanView - image viewer
Picasa - image viewer
XnView – image viewer
FastStone Image Viewer - image viewer
FuturixImager - image viewer
Easy Thumbnails – create thumbnails from images
JoJoThumb – create thumbnails from images
iWebAlbum - create photo albums
JAlbum – create photo albums
3D Box Shot Maker - design quality box shot
FastStone Capture - screen capture
WinSnap - screen capture

3D

Blender3D – 3D renderer
3Delight Free – 3D renderer
SketchUp – 3D modeling
Maya Learning Edition – 3D modeling

开发

AutoIt – task automation
SciTE4AutoIt3 - text editor for AutoIt
AutoHotkey - task automation
PHP Designer editor
Notepad++ – text editor
ConTEXT Editor – text editor
PSPad – text editor
FoxEditor - text editor
Crimson Editor - source code editor
Elfima Notepad - text editor
Notepad2 - text editor
Nvu editor
Alleycode - editor
BlockNote - page editor
Weaverslave page editor

CD/DVD

DeepBurner – CD/DVD burner
CDBurner XP Pro – CD/DVD burner
BurnAtOnce – CD/DVD burner
Express Burn – CD/DVD burner
Zilla CD-DVD Rip’n’Burn – CD/DVD
刻录
ImgBurn – ISO, BIN burner
Daemon tools – virtual CD/DVD
DVD Decrypter – DVD ripper
DVD Shrink – DVD ripper
Nero CD-DVD Speed - CD/DVD info and quality test
解码

GSpot - codec information
AC3Filter – audio codec
Xvid – video codec
QuickTime Alternative – video codec
Real Alternative – video codec
K-Lite Codec Pack – all codecs

系统工具

CCleaner – system cleaner
xp-AntiSpy – OS setup
jv16 Powertools – system utilities
XP SysPad – system monitoring utility
What’s Running – process guard
Registrar Lite – registry editor
WinIPConfig – replacement for “ipconfig.exe” and “route.exe”
Unlocker – file eraser
Eraser – secure file eraser
Undelete Plus – file recovery
freeCommander – file manager
ExplorerXP - file manager
Duplicate File Finder – find all duplicate files
Ant Renamer – file renaming
ReNamer – file renaming
Icons From File – icos extractor
Chaos MD5 – MD5 generator
HashTab - MD5, SHA1 and CRC-32 file hashes
Rainlendar Lite – desktop calendar
Weather Watcher – weather firecast
Subtitle Workshop – subtitles editor
Ant Movie Catalog – movie organizer
Disclib – CD organizer
Dexpot – virtual desktops
DriveImage XML – create partition images
MozBackup – backup and restore bookmarks, etc.
SyncBack – system backup
Atomic Cock Sync – syncronize your clock
Citrus Alarm Clock – alarm clock
TaskSwitchXP – Alt-Tab replacement
Launchy - application launcher
allSnap – make all snap
Sysinternals Tools – various system tools
StrokeIt - mouse gestures
Net Profiles – create profiles of your network settings
ResourceHacker – view, modify, rename, add, delete
Java Runtime Environment for

UI设计

RocketDock - application launcher
AveDesk – desktop enhancer
IconPhile - customize ’s system icons
CursorXP Free – change mouse cursors
MacSound – volume control
LClock - Longhorn clock
Y’z Dock – application launcher
Y’z Shadow – shadow effect to the 
Y’z Toolbar – change the toolbar icons in Explorer and Internet Explorer
Taskbar Shuffle – rearrange the programs on the taskbar by dragging
Visual Task Tips – thumbnail preview image for each task in the taskbar
Badges - put badges on any folder or file
Folderico - change icons of the folders
Folder Marker – mark your folders
Folder2MyPC – add favourite locations to My Computer
Microsoft TweakUI – system settings
BricoPacks packs
ShellPacks packs
Tango Shell Patcher patcher
XPize – GUI enhancer
Vista Transformation Pack - complete visual style
Vista Sound Scheme Vista sound scheme
Royale Theme - visual style

硬件检测

CPU-Z - cpu information
CrystalCPUID – cpu information
Central Brain Identifier – cpu information
Everest – system information
SiSoft Sandra - system information
SpeedFan - hardware monitor
Memtest86 – memory test
PowerMax – HDD test
3Dmark 06 - 3D game performance benchmark
Aquamark - performance benchmark
rthdribl – 3D benchmark
Fraps - 3D benchmark, fps viewer and screen recorder
Prime 95 - cpu benchmarking
SuperPI - cpu benchmarking
CPU Rightmark - cpu overclock
Core Temp - cpu temperature
ATiTool - video overclock
ATI Tray Tools – Radeon tweaker
aTuner - GeForce and Radeontweaker
RivaTuner – video overclock
Nokia Monitor Test - monitor adjustmets
UDPixel – fix dead pixels

游戏

123 Free Solitaire - solitaire games collection
Arcade Pack - classic arcade games
Live For Speed – online racing simulator
Enigma – puzzle game
Freeciv – multiplayer strategy game
Tux Racer – race down steep, snow-covered mountains

教育

SpeQ Mathematics - mathematics program
Dia – diagram creation program
Google Earth – explore the world
NASA World Wind – 3D virtual globe
Celestia – explore the space
Stellarium – planetarium

杂类

nLite – Build your own custom disk.
VirtualPC – create virtual machines
grabMotion - webcam capture
iDailyDiary – simple page-for-a-day diary
Pivot Stickfigure Animator – create stick-figure animations
Wink – create presentations
Scribus – professional page layout
FreeMind – midn mapping software
Windows Live Writer – WYSIWYG authoring

墙纸

Michael Swanson - 1920 x 1200; 1600 x 1200; amazing wallpapers
Mikhail Arkhipov - 1920 x 1200; 1600 x 1200; amazing wallpapers

Tags: , , , , , , , , , , , , ,

08 Jan 07 Intype alpha 0.2.x 提供下载

有些人可能没有听过这个名字,不过说起他的兄弟 TextMate 或许有 Apple 经验的人就不陌生了吧。这个 Intype 就是他的 版本的实现。

以下为邮件原文:
Hello,

 we are proud to announce our first Intype Alpha release.
 
 Download link is available at:
  http://intype.info/home/
 
 Support forums are available at:
  http://intype.info/forums/
 
 Your e-mail address has been deleted from our database and
 no further e-mails will be sent to you.
 
 Next releases will be announced via Intype and
 Intype Forums.
 
Thank you for your interest,
Intype Team

Tags: ,

07 Jan 07 活学活用Windows Server 2003分区增容功能

分区增容就是当一个分区的空间不能满足使用需求时,为其额外加大空间的方法。很多朋友遇到这种情况时,一般都使用PartitionMagic完成的。但实际上,使用 XP/ 2003的用户完全可以使用系统内置的磁盘管理功能来完成分区的空间“增容”。下面我们以实例的方式来探讨一下。

  一、划出自由空间

假设现在需要对D盘增容50MB的空间,这个空间需要从E盘上提取。那么首先要就从E盘上划分出这50MB的空间才行。这个操作的过程如下:

  首先将E盘所有数据转移到其它分区,然后单击“开始→运行”,输入“Diskmgmt.msc”后回车,打开“磁盘管理”窗口。选中E盘并点击右键,在弹出的快捷菜单中选择“删除此逻辑驱动器”项。在弹出的提示框中点击“是”按钮继续。操作完毕后,将会在“磁盘0”列中出现与删除分区相同大小的可用空间。

  二、给分区增容

  此时请注意D盘当前空间为855MB,现在我们来进行为其增加50MB的操作。单击“开始→程序→附件→命令提示符”,在打开的窗口中依次输入“Diskpart”、“List volume”、“Select volume 2”、“Extend Size=50”四条命令。

  其中,“Diskpart”命令用来调用DOS磁盘管理程序,“Diskpart/?”命令可以看到该命令的DOS下中文帮助信息。“List Volume”用于显示系统上所有磁盘的详细信息,从而得知所需扩充分区的卷号。这里可以看出D盘的卷号为“2”;“Select Volume 2”命令用于选择卷,这里根据上一步得出的提示选择卷2;“Extend Size=50”用于将D盘空间增容,这个增容的来源空间当然是划分出的自由空间了。从命令执行的结果“DiskPart成功地扩展了卷”来看,我们对D盘的空间增容已经成功了。

  最后在“磁盘管理窗口”中选择剩余的可用空间,依次点击“操作→所有任务→新建逻辑驱动器”命令,根据提示为该空间分配驱动器号和进行格式化操作即可。

Tags: ,

03 Jan 07 深入Native应用程序

版权所有 1998 Mark Russinovich

 

翻译:MJ0011

最后更新:1998年2月8日

导言

如果你对WindowsNt结构有一定的了解,你可能会知道,Win32应用程序所使用的API,并非是"真正"的NT API

。POSIX,OS/2和Win32,这些WindowsNT操作系统环境,使用他们自己的API同他们的客户应用程序进行交流,

但却使用NT "native" API同 WindowsNT进行交流.这些native API大部分都是未公开的(undocumented)。大

约只有25个API(包含250种功能)在WindowsNT设备驱动开发工具包(Device Driver Kit)里有所描述。

尽管绝大多数人都不知道,但"native"应用程序的确存在与WindowsNT上,他们在操作环境上没有任何客户程

序. 这些程序交流着native nt API并且不能使用任何操作环境API比如 Win32. 为什么这样一种程序是必须

的呢?因为在Win32子系统启动之前(大约在登陆对话框出现时)只可以运行native应用程序.最常见的native

应用程序的例子是"autochk"程序,他在初始化兰色登陆屏幕前运行 chkdsk(程序在屏幕上打印一串".")。

当然,Win32应用程序环境服务程序:CSRSS.exe(客户-服务运行时间子系统),也是一个native应用程序

在这篇文章里,我将会讲述如何构造一个native应用程序以及它们是如何工作的,同时我也会提供一个

native应用程序的示例源代码。这个示例很容易安装,它会在启动时的兰色屏幕打印一段你指定的字符串

Autochk是如何被执行的

Autochk在当内存分页被打开,启动和系统开始驱动被载入之间的时间内运行。在这个时间点 启动顺

序会话管理器(smss.exe)进入windowsNT用户模式,并且没有任何程序被启动
注册表中:HKLM\System\CurrentControlSet\Control\Session Manager\BootExecute
一个MULTI_SZ类型的键值
这里存放着将被会话管理器所执行的程序名称和参数
通常Autochk后加*号作为其参数"

Autocheck Autochk *
;名称 程序名 参数

会话管理器在<winnt>\system32目录下查找该值列出的可执行程序.当Autochk运行时,没有任何文件被打开

,所以Autochk可以用raw模式打开任何一个驱动器卷(包括根驱动器),并操作其磁盘数据结构.之后的任何

时间点都无法进行类似这样的操作

编译Native应用程序
微软没有提供相应的文档,但是NT DDK构建器知道如何去生成一个native应用程序,而且它可以被用来编译

autochk程序.和编写设备驱动程序一样,你必须指定SOURCE文件中的信息来定义应用程序。然而和编写驱动

不同的时,你在SOURCE文件中要求生成一个native应用程序需要这样定义:

TARGETTYPE=PROGRAM

构建器使用一个标准的makefile来进行向导:\ddk\inc\makefile.def 在编译native应用程序时会查找名为

nt.lib的运行库。不幸的是,微软并没在DDK上装载这个文件(在  2003 DDK里包括了这个文

件,但是我怀疑你用这个版本来连接你的native应用程序是无法运行在WindowsXP或win2000上的)
不管怎样,你可以忽略这个错误,方法是加入一行不考虑nt.lib,而指定visual c++的运行库msvcrt.lib到

makefile.lib中

如果你在DDK的"Checked Build"环境下进行编译,将会在%BASEDIR%\lib\%CPU%\Checked(例如

c:\ddk\lib\i386\checked\native.exe)产生一个包含了全部调试信息的native应用程序。如果你在"Free 

Build"环境中编译,你会在%BASEDIR%\lib\%CPU%\Free得到一个释出版本的程序.这些和构造设备驱动程序

放置的位置是一样的。

Native应用程序有着".exe"的扩展名,但是你不能象 win32的.exe文件那样去运行它,如果你在WIN32环境

下运行下,将会得到如下提示:

"<应用程序名> 应用程序无法在Win32模式中运行。"

深入学习一个native应用程序

native应用程序的入口点是NtProcessStartup,类似winmain或main.不同于其他的 Win32入口点的是,

native应用程序提供一个数据结构来存放它的唯一的参数来定位命令行参数

大多数的native应用程序的运行环境是由WindowsNt的native API输出库—NTDLL.DLL提供的。native应用

程序必须使用RtlCreateHeap(一个ntdll函数)来创建他们自己的堆来分配存储,使用RtlAllocateHeap来分

配内存以及用RtlFreeHeap来释放内存。native应用程序需要使用NtDisplayString 函数才可以打印想要的

内容到屏幕上(将被输出到初始化时的兰色屏幕上)

Native应用程序不象win32程序那样简单地从他们的启动函数返回,你需要调用NtProcessTerminate函数来

结束它的进程

NTDLL运行包含了数百个函数允许native应用程序执行文件I/O,与设备驱动进行相连,并执行进程间通讯。

不幸的是,他们大部分都是未公开的。

一个native应用程序的例子
我创建一个“玩具”native 应用程序用来演示native应用程序是如何构建的以及他们是如何工作的。运行

install.bat来安装native程序。批处理程序复制native.exe到你的<winnt>\system32目录并在注册表中增

加一个BootExecute的入口点:

native Hello World!

当你重新启动时,会话管理器运行完autochk后就会执行native。native分配一些堆,定位它的命令行参数

并打印参数("Hello world!")到兰色屏幕上,它所使用的函数上面已说过了。如果你想要打印其他的简单内

容,可以编辑BootExecute值使用regedit或regedit32,修改"Hello world"为你想要的信息

运行uinstall.bat可以卸载这个native执行程序。它从<winnt>\system32目录删除native.exe,并修改

BootExecute值为通常的值

如果你想要构建native程序你必须要用设备驱动工具包(DDK),复制makefile.def到 \ddk\inc然后你

可以运行构建

 

=========================================================
Native.H

//======================================================================
//
// Native.h
//
// Mark Russinovich
// http://www.ntinternals.com
//
// This file includes the definitions required by the Native.exe sample
// NT native program to do what it does. 
//
//======================================================================

//
// Environment information, which includes command line and
// image file name
//
typedef struct {
       ULONG            Unknown[21];     
       UNICODE_STRING   CommandLine;
       UNICODE_STRING   ImageFile;
} ENVIRONMENT_INFORMATION, *PENVIRONMENT_INFORMATION;

//
// This structure is passed as NtProcessStartup’s parameter
//
typedef struct {
       ULONG                     Unknown[3];
       PENVIRONMENT_INFORMATION  Environment;
} STARTUP_ARGUMENT, *PSTARTUP_ARGUMENT;

//
// Data structure for heap definition. This includes various
// sizing parameters and callback routines, which, if left NULL,
// result in default behavior
//
typedef struct {
 ULONG     Length;
 ULONG     Unknown[11];
} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;

//
// Native NT api function to write something to the boot-time
// blue screen
//
NTSTATUS 
NTAPI 
NtDisplayString(
  PUNICODE_STRING String 
  );

//
// Native applications must kill themselves when done - the job
// of this native API
//
NTSTATUS 
NTAPI 
NtTerminateProcess(
     HANDLE ProcessHandle, 
     LONG ExitStatus 
     );

//
// Definition to represent current process
//
#define NtCurrentProcess() ( (HANDLE) -1 )

//
// Heap creation routine
//
HANDLE 
NTAPI 
RtlCreateHeap(
       ULONG Flags, 
       PVOID BaseAddress, 
       ULONG SizeToReserve, 
       ULONG SizeToCommit, 
       PVOID Unknown,
       PRTL_HEAP_DEFINITION Definition
       );

//
// Heap allocation function (ala "malloc")
//
PVOID 
NTAPI 
RtlAllocateHeap(
  HANDLE Heap, 
  ULONG Flags, 
  ULONG Size 
  );

//
// Heap free function (ala "free")
//
BOOLEAN 
NTAPI 
RtlFreeHeap(
     HANDLE Heap, 
     ULONG Flags, 
     PVOID Address 
     );

=========================================================================
Native.C

//======================================================================
//
// Native.c
//
// Mark Russinovich
// http://www.ntinternals.com
//
// This is a demonstration of a Native NT program. These programs
// run outside of the Win32 environment and must rely on the raw
// services provided by NTDLL.DLL. AUTOCHK (the program that executes
// a chkdsk activity during the system boot) is an example of a
// native NT application.
//
// This example is a native ’hello world’ program. When installed with
// the regedit file associated with it, you will see it print 
// "hello world" on the initialization blue screen during the system
// boot. This program cannot be run from inside the Win32 environment.
//
//======================================================================
#include "ntddk.h" // include this for its native functions and defn’s
#include "stdio.h"
#include "native.h"

//
// Our heap
//
HANDLE Heap;

//———————————————————————-
//
// NtProcessStartup
//
// Instead of a ’main’ or ’winmain’, NT applications are entered via
// this entry point.  
//
//———————————————————————-
void NtProcessStartup( PSTARTUP_ARGUMENT Argument )
{
    PUNICODE_STRING commandLine;
    PWCHAR stringBuffer, argPtr;
    UNICODE_STRING helloWorld;
    RTL_HEAP_DEFINITION  heapParams;

    //
    // Initialize some heap
    //
    memset( &heapParams, 0, sizeof( RTL_HEAP_DEFINITION ));
    heapParams.Length = sizeof( RTL_HEAP_DEFINITION );
    Heap = RtlCreateHeap( 2, 0, 0×100000, 0×1000, 0, &heapParams );

    //
    // Point at command line
    //
    commandLine = &Argument->Environment->CommandLine;

    //
    // Locate the argument
    //
    argPtr = commandLine->Buffer;
    while( *argPtr != L’ ’ ) argPtr++;
    argPtr++;

    //
    // Print out the argument
    //
    stringBuffer = RtlAllocateHeap( Heap, 0, 256 );
    swprintf( stringBuffer, L"\n%s", argPtr );
    helloWorld.Buffer = stringBuffer;
    helloWorld.Length = wcslen( stringBuffer ) * sizeof(WCHAR);
    helloWorld.MaximumLength = helloWorld.Length + sizeof(WCHAR);
    NtDisplayString( &helloWorld );

    //
    // Free heap
    //
    RtlFreeHeap( Heap, 0, stringBuffer );

    //
    // Terminate
    //
    NtTerminateProcess( NtCurrentProcess(), 0 );
}

===========================================================================

Install.bat

@echo off
copy native.exe %systemroot%\system32\.
regedit /s add.reg
echo Native Example Installed

=============================================================================
uinstall.bat

@echo off
del %systemroot%\system32\native.exe
regedit /s remove.reg
echo Native Example Uninstalled

转自:http://hi.baidu.com/mj0011/blog/item/85c0b50f80b1baedab6457de.html

Tags: , , , , ,

01 Jan 07 办公小助手 DeskTask

很好用的小软件,可以和 outlook 配合起来用,相当不错噢~!