澳门新葡亰信誉平台游戏读淘宝商品描述页源码delphi版

by admin on 2020年2月2日

**************************************************
*– Form: form1 (计算器2.scx)
*– 父类:  form
*– 基类:  form
*– 作者:  Tiger5392
来自www.bc-cn.net中国编程论坛(C)Copyright2006-2006
DEFINE CLASS form1 AS form

今天无聊写了这个DLL函数的查看器代码,也许有人用得上,顺便也复习下PE结构!

澳门新葡亰信誉平台游戏 1

 Top = 0
 Left = 0
 Height = 278
 Width = 405
 DoCreate = .T.
 Caption = “Form1”
 Name = “Form1”

VFP CODE:

淘宝的宝贝描述页是ajax异步载入的,所以直接idhttp读一下是弄不到它的源码的。用下面的方法就可以。

 ADD OBJECT text1 AS textbox WITH ;
  Height = 20, ;
  Left = 0, ;
  Top = 5, ;
  Width = 342, ;
  Name = “Text1”

***本代码由行者SCX2PRG自动转换***
PUBLIC LaodForm
    LaodForm=CreateObject(“MyForm”)
    LaodForm.Show
RETURN
*————————————————————-*
*-VFP应用程式算法群:12787940 行者孙:310727570-*
*————————————————————-*
DEFINE CLASS MyForm AS form
Visible=.T.
Top = 63
Left = 274
Height = 324
Width = 385
DoCreate = .T.
Picture =” “
Caption = “DLL函数查看器-行者示例”
Name = “Form1”
PROCEDURE Init
    This.AddObject(“Dataenvironment”,”ClassName1″)
    This.AddObject(“Command5″,”ClassName2”)
    This.AddObject(“List”,”ClassName3″)
    This.AddObject(“Text1″,”ClassName4”)
    ThisForm.List.View=3
    ThisForm.List.fullRowSelect= .T.
    ThisForm.List.appearance=0
    ThisForm.List.ColumnHeaders.Add(1,”C1″,”序号”,40,0)
    ThisForm.List.ColumnHeaders.Add(2,”C2″,”函数名称”,200,0)
    ThisForm.List.ColumnHeaders.Add(3,”C3″,”函数地址”,120,0)
ENDPROC
ENDDEFINE
DEFINE CLASS ClassName1 AS dataenvironment
Visible=.T.
Top = 0
Left = 0
Width = 0
Height = 0
DataSource = .NULL.
Name = “Dataenvironment”
ENDDEFINE
DEFINE CLASS ClassName2 AS commandbutton
Visible=.T.
Top = 12
Left = 12
Height = 25
Width = 60
Caption = “开打文件”
Name = “Command5”
PROCEDURE Click
DECLARE Long ImageDirectoryEntryToData IN imagehlp Long, long, long,
Long@
DECLARE INTEGER CloseHandle IN kernel32 INTEGER hObject
DECLARE INTEGER LoadLibrary IN kernel32;
    STRING lpLibFileName
DECLARE INTEGER FreeLibrary IN kernel32;
        INTEGER hLibModule
DECLARE Long ImageDirectoryEntryToData IN imagehlp long
HANDLE,long,long,Long @
DECLARE integer GetProcAddress IN WIN32API integer hModule, string
procname
GENERIC_READ=0x80000000
FILE_SHARE_READ = 1
FILE_SHARE_WRITE=2
OPEN_EXISTING = 3
FILE_ATTRIBUTE_NORMAL = 0x80
IMAGE_DIRECTORY_ENTRY_EXPORT =0
DllFile=GETFILE(‘dll’)
IF FILE(DllFile)
    thisform.text1.Value=DllFile
    hLibModule=LoadLibrary(DllFile)
    IF hLibModule>0
        ulSize=0
       
AdrEXPORT=ImageDirectoryEntryToData(hLibModule,1,IMAGE_DIRECTORY_ENTRY_EXPORT,@ulSize)
        IF AdrEXPORT>0
            EXPORT_DIRECTORY=SYS(2600,AdrEXPORT,ulSize)
           
NumberOfFunctions=CTOBIN(SYS(2600,AdrEXPORT+24,4),’4rs’)&&函数数量
            FunctionsAdress=AdrEXPORT+44&&函数虚拟偏移地址开始地址
           
dPtr=4*NumberOfFunctions*2+NumberOfFunctions*2-4&&计算从函数虚拟地址到函数名列表地址的字节数
            NamePtr=FunctionsAdress+dPtr&&得到函数名称列表编译地址
            NameStr=SYS(2600,NamePtr,ulSize-dPtr-44)
            NameStr=0h00+namestr
            ThisForm.List.ListItems.Clear
            FOR i=2 TO NumberOfFunctions+1&&往LISTVIEW中添加记录
                DllName=STREXTRACT(namestr,0h00,0h00,i)
               
DllEnty=transform(GetProcAddress(hLibModule,DllName)-hLibModule,’@0′)
               
sd=ThisForm.List.ListItems.Add(i-1,”Co”+ALLTRIM(STR(i)),ALLTRIM(STR(i-1)))
               
sd.SubItems(1)=STRCONV(DllName,11)&&注意:这里DllName是UTF8编码,所以要转换,不然出现乱码,SQL有时出现乱码也是因此。
                sd.SubItems(2)=ALLTRIM(DllEnty)
            ENDF
        ENDI
    FreeLibrary(hLibModule)
    ENDIF
ENDI
ENDPROC
ENDDEFINE
DEFINE CLASS ClassName3 AS olecontrol
    OleClass=”MSComctlLib.ListViewCtrl.2″
    Visible=.T.
    Top = 48
    Left = 12
    Height = 264
    Width = 360
    Name = “List”
ENDDEFINE
DEFINE CLASS ClassName4 AS textbox
    Visible=.T.
    FontSize = 10
    Height = 24
    Left = 72
    Top = 12
    Width = 300
    Name = “Text1”
ENDDEFINE

代码如下:

 ADD OBJECT command1 AS commandbutton WITH ;
  Top = 33, ;
  Left = 0, ;
  Height = 40, ;
  Width = 100, ;
  FontSize = 12, ;
  Caption = “BackSpace”, ;
  ForeColor = RGB(255,0,128), ;
  Name = “Command1”

Image:
澳门新葡亰信誉平台游戏 2

unit Unit1;

 ADD OBJECT command2 AS commandbutton WITH ;
  Top = 33, ;
  Left = 120, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “CE”, ;
  ForeColor = RGB(255,0,128), ;
  Name = “Command2”

interface

 ADD OBJECT command5 AS commandbutton WITH ;
  Top = 33, ;
  Left = 300, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “C”, ;
  ForeColor = RGB(255,0,128), ;
  Name = “Command5”

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
  Dialogs, ComCtrls, StdCtrls,SHDocVw, ExtCtrls, OleCtrls;

 ADD OBJECT command6 AS commandbutton WITH ;
  Top = 83, ;
  Left = 0, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “MC”, ;
  ForeColor = RGB(255,0,128), ;
  Name = “Command6”

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    TabControl1: TTabControl;
    GO: TButton;
    Button1: TButton;
    Button2: TButton;
    Panel1: TPanel;
    RichEdit1: TRichEdit;
    Panel2: TPanel;
    WebBrowser1: TWebBrowser;
    Label2: TLabel;
    procedure GOClick(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure TabControl1Change(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  *******
    { Private declarations }
  public
    { Public declarations }
  end;

 ADD OBJECT command7 AS commandbutton WITH ;
  Top = 83, ;
  Left = 60, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “7”, ;
  ForeColor = RGB(0,0,255), ;
  Name = “Command7”

var
  Form1: TForm1;

 ADD OBJECT command8 AS commandbutton WITH ;
  Top = 83, ;
  Left = 120, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “8”, ;
  ForeColor = RGB(0,0,255), ;
  Name = “Command8”

implementation

 ADD OBJECT command9 AS commandbutton WITH ;
  Top = 83, ;
  Left = 180, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “9”, ;
  ForeColor = RGB(0,0,255), ;
  Name = “Command9”

{$R *.dfm}
{$APPTYPE CONSOLE}
uses mshtml;

 ADD OBJECT command10 AS commandbutton WITH ;
  Top = 83, ;
  Left = 240, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “/”, ;
  ForeColor = RGB(255,0,128), ;
  Name = “Command10”

function GetHtml(const WebBrowser:TWebBrowser): string;
var
  Doc: IHTMLDocument2;
begin
  Doc := WebBrowser.Document as IHTMLDocument2;
  if Assigned(Doc) and Assigned(Doc.body) then
    Result := Doc.body.OuterHtml; //也可以用innerHTML取得其HTML文本
end;

 ADD OBJECT command11 AS commandbutton WITH ;
  Top = 83, ;
  Left = 300, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “SQRT”, ;
  ForeColor = RGB(0,0,255), ;
  Name = “Command11”

 

 ADD OBJECT command12 AS commandbutton WITH ;
  Top = 133, ;
  Left = 0, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “MR”, ;
  ForeColor = RGB(255,0,128), ;
  Name = “Command12”

procedure TForm1.Button1Click(Sender: TObject);
begin
  //读商品描述页html
  form1.RichEdit1.Text:=GetHtml(form1.WebBrowser1);
  form1.TabControl1.TabIndex:=0;
  form1.Panel1.BringToFront;
end;

 ADD OBJECT command13 AS commandbutton WITH ;
  Top = 133, ;
  Left = 60, ;
  Height = 40, ;
  Width = 40, ;
  FontSize = 12, ;
  Caption = “4”, ;
  Fore

procedure TForm1.Button2Click(Sender: TObject);
begin
  Application.Terminate;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  //显示控制
  form1.TabControl1.TabIndex:=0;
  form1.Panel1.BringToFront;
  form1.Button1.Enabled:=false;
  WebBrowser1.Silent := True; //禁脚本错误

end;

procedure TForm1.GOClick(Sender: TObject);
begin

  form1.TabControl1.TabIndex:=1;
  form1.Panel2.BringToFront;
  form1.WebBrowser1.Navigate(trim(form1.Edit1.Text));
  form1.Button1.Enabled:=true;
end;

procedure TForm1.TabControl1Change(Sender: TObject);
begin
  case TabControl1.TabIndex of
    0:begin
      form1.Panel1.BringToFront;
    end;
    1:begin
      form1.Panel2.BringToFront;
    end;
  end;
end;

end.

界面代码:

object Form1: TForm1
  Left = 229
  Top = 150
  BorderIcons = [biSystemMenu, biMinimize]
  Caption = #35835#28120#23453#21830#21697#25551#36848′ 
‘#29482#24735#33021
  ClientHeight = 269
  ClientWidth = 330
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = ‘Tahoma’
  Font.Style = []
  OldCreateOrder = False
  Position = poDesigned
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 8
    Top = 19
    Width = 23
    Height = 13
    Caption = ‘URL:’
  end
  object Label2: TLabel
    Left = 15
    Top = 242
    Width = 156
    Height = 13
    Caption =
#20808’go’#65292#31561#32593#39029#36733#20837#21518#20877#21462#28304#30721
    Color = clGradientActiveCaption
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clRed
    Font.Height = -11
    Font.Name = ‘Tahoma’
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Edit1: TEdit
    Left = 32
    Top = 16
    Width = 241
    Height = 21
    TabOrder = 0
    Text =
     
” +
      ‘999a205b3ed15545.jhtml’
  end
  object TabControl1: TTabControl
    Left = 8
    Top = 48
    Width = 313
    Height = 177
    TabOrder = 1
    Tabs.Strings = (
      ‘Html’
      ‘View’)
    TabIndex = 0
    OnChange = TabControl1Change
    object Panel1: TPanel
      Left = 8
      Top = 24
      Width = 297
      Height = 145
      Caption = ‘Panel1’
      TabOrder = 0
      object RichEdit1: TRichEdit
        Left = 0
        Top = 0
        Width = 297
        Height = 145
        Font.Charset = GB2312_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = ‘Tahoma’
        Font.Style = []
        Lines.Strings = (
          ‘RichEdit1’)
        ParentFont = False
        ScrollBars = ssVertical
        TabOrder = 0
      end
    end
    object Panel2: TPanel
      Left = 8
      Top = 24
      Width = 302
      Height = 150
      Caption = ‘Panel2’
      TabOrder = 1
      object WebBrowser1: TWebBrowser
        Left = 0
        Top = 0
        Width = 297
        Height = 145
        TabOrder = 0
        ControlData = {
         
4C000000B21E0000FC0E00000000000000000000000000000000000000000000
         
000000004C000000000000000000000001000000E0D057007335CF11AE690800
         
2B2E126208000000000000004C0000000114020000000000C000000000000046
         
8000000000000000000000000000000000000000000000000000000000000000
          00000000000000000100000000000000000000000000000000000000}
      end
    end
  end
  object GO: TButton
    Left = 281
    Top = 21
    Width = 41
    Height = 21
    Caption = ‘GO’
    TabOrder = 2
    OnClick = GOClick
  end
  object Button1: TButton
    Left = 192
    Top = 232
    Width = 57
    Height = 29
    Caption = #21462#28304#30721
    TabOrder = 3
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 265
    Top = 232
    Width = 57
    Height = 29
    Caption = #36864#20986
    TabOrder = 4
    OnClick = Button2Click
  end
end

源代码下载:

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图