讓偵測工具把殼識別為VC++7.0的原始碼
看了LiNSoN兄"讓偵測工具把殼識別為VC++",還不錯,可惜是手動的...
於是我順手寫了程式自動完成這一工作,經實驗現在可以把不帶CRC32的殼成功
偽裝,如果殼帶有CRC32就不行了
現帖出原始碼,與大家共享,有興趣的可以加以改進
程式不復雜,我就直接帖出來了
{
Author: xIkUg
Email: xikug@163.com
HOMEPAGE: http://www.xp-program.com
Description: 把PE程式偽裝為VC7.0編譯的
}
unit uMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
edFName: TEdit;
Button1: TButton;
Label2: TLabel;
edOEP: TEdit;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
OpenDialog1: TOpenDialog;
procedure Button5Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
FImageBase: DWORD;
public
{ Public declarations }
end;
THEAD = array [0..63] of byte;
var
Form1: TForm1;
const
MYSECTION = 'xIkUg';
JMPOFF = 43;
//這個是HEAD.asm中的程式碼的機器碼
OEPCODE: THEAD = ($55, $8B, $EC, $6A, $FF, $68, $2A, $2C, $0A, $00, $68, $38,
$90, $0D, $00, $64, $A1, $00, $00, $00, $00, $50, $64, $89,
$25, $00, $00, $00, $00, $58, $64, $A3, $00, $00, $00, $00,
$58, $58, $58, $58, $8B, $E8, $B8, $00, $10, $40, $00, $FF,
$E0, $90, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00);
procedure AddSection(FName: string); //新加一個Section,並把OEPCode寫進去
implementation
{$R *.dfm}
procedure TForm1.Button5Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
MessageBox(Handle, 'Author: xIkUg' + #10#13 +
'Email: xikug@163.com' + #10#13 +
'HOMEPAGE: http://www.xp-program.com',
'About', MB_OK);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
edFName.Text := OpenDialog1.FileName;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
DOSHEADER: IMAGE_DOS_HEADER;
PEHEADER: IMAGE_NT_HEADERS;
fs: TFileStream;
begin
fs := TFileStream.Create(edFName.Text, fmOpenReadWrite +
fmShareDenyWrite);
try
fs.Seek(0, soFromBeginning);
fs.Read(DOSHEADER, sizeof(DOSHEADER));
fs.Seek(DOSHEADER._lfanew, soFromBeginning);
fs.Read(PEHEADER, sizeOf(PEHEADER));
FImageBase := PEHEADER.OptionalHeader.ImageBase;
edOEP.Text := IntToHex(PEHEADER.OptionalHeader.AddressOfEntryPoint, 8);
finally
fs.Free;
end;
end;
procedure AddSection(FName: string);
var
DOSHEADER: IMAGE_DOS_HEADER;
PEHEADER: IMAGE_NT_HEADERS;
SectionHeader: IMAGE_SECTION_HEADER;
MySectionHeader: IMAGE_SECTION_HEADER;
fs: TFileStream;
AddressOfEntryPoint: DWORD;
begin
fs := TFileStream.Create(FName, fmOpenReadWrite +
fmShareDenyWrite);
try
fs.Seek(0, soFromBeginning);
fs.Read(DOSHEADER, sizeof(DOSHEADER));
fs.Seek(DOSHEADER._lfanew, soFromBeginning);
fs.Read(PEHEADER, sizeOf(PEHEADER));
fs.Seek(sizeOf(SectionHeader) *
(PEHEADER.FileHeader.NumberOfSections - 1), soFromCurrent);
fs.Read(SectionHeader, sizeof(IMAGE_SECTION_HEADER));
MySectionHeader.Name[0] := ord('x');
MySectionHeader.Name[1] := ord('I');
MySectionHeader.Name[2] := ord('k');
MySectionHeader.Name[3] := ord('U');
MySectionHeader.Name[4] := ord('g');
MySectionHeader.Name[5] := 0;
MySectionHeader.Name[6] := 0;
MySectionHeader.Name[7] := 0;
MySectionHeader.VirtualAddress := PEHEADER.OptionalHeader.SizeOfImage;
MySectionHeader.Misc.VirtualSize := $200;
MySectionHeader.SizeOfRawData := (MySectionHeader.VirtualAddress div
PEHEADER.OptionalHeader.FileAlignment + 1) * PEHEADER.OptionalHeader.FileAlignment -
PEHEADER.OptionalHeader.SizeOfImage;
MySectionHeader.PointerToRawData :=
SectionHeader.SizeOfRawData+SectionHeader.PointerToRawData;
MySectionHeader.Characteristics := $e0000020;
Inc(PEHEADER.FileHeader.NumberOfSections);
fs.Write(MySectionHeader, sizeOf(MySectionHeader));
fs.Seek(DOSHEADER._lfanew, soFromBeginning);
AddressOfEntryPoint := PEHEADER.OptionalHeader.AddressOfEntryPoint;
PEHEADER.OptionalHeader.AddressOfEntryPoint :=
MySectionHeader.VirtualAddress;
PEHEADER.OptionalHeader.MajorLinkerVersion := 7;
PEHEADER.OptionalHeader.MinorLinkerVersion := 0;
AddressOfEntryPoint := AddressOfEntryPoint +
PEHEADER.OptionalHeader.ImageBase;
asm
PUSHAD
LEA eax, OEPCODE
ADD eax, JMPOFF
MOV edx, AddressOfEntryPoint
MOV DWORD ptr [eax], edx
POPAD
end;
PEHEADER.OptionalHeader.SizeOfImage :=
PEHEADER.OptionalHeader.SizeOfImage + MySectionHeader.Misc.VirtualSize;
fs.Write(PEHEADER, sizeof(PEHEADER));
fs.Seek(fs.Size, soFromBeginning);
fs.Write(OEPCODE, MySectionHeader.Misc.VirtualSize)
finally
fs.Free;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
//偽裝
if trim(edFName.Text) = '' then
begin
MessageDlg('請先選擇一個可執行檔案', mtError, [mbOK], 0);
Exit;
end;
//這段其實是不需要的,我懶得刪了,看看也不錯
if trim(edOEP.Text) = '' then
begin
MessageDlg('請先獲取程式入口點', mtError, [mbOK], 0);
Exit;
end;
AddSection(edFName.Text); //偽裝
MessageDlg('偽裝成功!', mtInformation, [mbOK], 0);
end;
end.
相關文章
- 人臉檢測識別,人臉檢測,人臉識別,離線檢測,C#原始碼2019-02-16C#原始碼
- 把topthink的原始碼公佈讓大家學學吧(偷笑~)2020-04-04原始碼
- 識別殼的簡單程式,高手免進。2004-12-14
- Web應用主動偵測工具Skipfish2017-08-10Web
- Twitter開源流量異常偵測工具:AnomalyDetection2015-01-11
- 抽菸行為監測識別系統2024-09-26
- 人員操作行為識別監測2024-10-12
- 小心,別讓您的電腦成為他人的“挖礦”工具2016-06-21
- java指紋識別以及谷歌圖片識別技術原始碼2018-11-03Java谷歌原始碼
- 人臉識別技術,讓科幻成為現實2012-04-23
- bootstrap原始碼分析之scrollspy(滾動偵聽)2016-06-05boot原始碼
- Facebook讓社交更安全 新工具可識別“馬甲”號2016-03-24
- NEC將打造大型犯罪偵查生物識別系統2018-05-15
- 【專案原始碼】雲端計算人臉識別智慧班牌原始碼2023-05-12原始碼
- Vue的變化偵測原理2020-11-18Vue
- 入侵檢測工具Watcher(含原始碼) (轉)2007-12-12原始碼
- DLL劫持漏洞自動化識別工具Rattler檢測2020-12-01
- Vue原始碼學習: 關於對Array的資料偵聽2019-04-22Vue原始碼
- 使用gitee作為原始碼管理工具2024-05-28Gitee原始碼
- QQ驗證碼識別原始碼(C#/NET1.1)2010-02-07原始碼C#
- 一個新殼,附主程式和原始碼2004-11-11原始碼
- 智慧校園人臉識別系統原始碼2023-03-16原始碼
- 【原始碼系列#04】Vue3偵聽器原理(Watch)2023-12-26原始碼Vue
- 從《Her Story》到《Return of the Obra Dinn》:讓偵探遊戲真正成為遊戲2019-09-06遊戲
- 影片直播app原始碼,傳送驗證碼 驗證碼識別2023-10-11APP原始碼
- 釋放靜電行為監測識別系統2024-09-12
- 我的原始碼讓貓給吃了2022-01-04原始碼
- 脫殼基本知識2015-11-15
- 18個擴充套件讓你的Firefox成為滲透測試工具2017-11-22套件Firefox
- 如何識別網頁上的文字?線上工具免費識別2022-01-17網頁
- 簡單驗證碼識別及工具編寫思路2020-08-19
- ReactNative原始碼解析-初識原始碼2019-05-12React原始碼
- 別讓你的程式碼成為別人的炮灰——《Android軟體安全與逆向分析》2013-03-01Android
- 原始碼加密工具2019-06-29原始碼加密
- [Win32]一個偵錯程式的實現(六)顯示原始碼2016-09-29Win32原始碼
- ARP偵查工具Netdiscover2015-01-14
- 把一個任意型別的值轉換為布林型別2018-11-19型別
- 「肺炎 X 光病灶識別」挑戰賽:幾行程式碼,就能讓醫療檢測準確率 20% 的提高!2019-12-10行程