Cracking part 19 pdf

6 290 0
Cracking part 19 pdf

Đang tải... (xem toàn văn)

Thông tin tài liệu

int nMaxCount // maximum number of characters to copy ); Returns Nếu function hoàn thành , giá trị trả về là chiều dài của chuỗi (chỉ tính những kí tự) được copy (không tính những kí tự null). Nếu window không có title bar hoặc text, hoặc title bar được để trống, hoặc window hay control handle invalid, giá trị trả về là 0. Để có thêm thông tin về lỗi , chúng ta dùng hàm GetLastError, Hàm này không thể tìm text của edit control trong application nào khác. GetWindowWord Hàm GetWindowWord có nhiệm vụ tìm giá trị 16bit tại specified offset và đưa nó vào extra window memory cho specified window. Code: WORD GetWindowWord( HWND hWnd, // handle of window int nIndex // offset of value to retrieve ); Returns Nếu function hoàn thành , giá trị trả về là giá trị 16bit Nếu function không hoàn thành , giá trị trả về là 0. Để biết thêm thông tin về lỗi, chúng ta dùng hàm GetLastError. SendDlgItemMessage / SendDlgItemMessageA / SendDlgItemMessageW Hàm SendDlgItemMesage có nhiệm vụ gởi message đến specified control trong dialog box. Code: LONG SendDlgItemMessage( HWND hwndDlg, // handle of dialog box int idControl, // identifier of control UINT uMsg, // message to send WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ); Returns Giá trị trả về ghi kết quả của message processing và dựa vào message đã được gởi. 03.7 Time & Date Accesses ================= GetFileTime Hàm GetFileTime có nhiệm vụ tìm ngày và giờ mà file được tạo (giống như ngày sinh tháng đẻ của chúng ta dzậy đó) , lần sử dụng gần nhất, và lần sửa đổi gầ n nhất. Code: BOOL GetFileTime( HANDLE hFile, // identifies the file LPFILETIME lpCreationTime, // address of creation time LPFILETIME lpLastAccessTime, // address of last access time LPFILETIME lpLastWriteTime // address of last write time ); Returns Nếu function hoàn thành , giá trị trả về là TRUE. Nếu function không hoàn thành, giá trị trả về là FALSE. Đễ biết thông tin về lỗi, chúng ta dùng hàm GetLastError. GetLocalTime Hàm GetLocalTime có nhiệm vụ tìm ngày và giờ hiện tại. Code: VOID GetLocalTime( LPSYSTEMTIME lpSystemTime // address of system time structure ); Returns Hàm này không có giá trị trả về GetSystemTime Hàm GetSystemTime có nhiệm vụ tìm ngỳa và giờ hiện tại của hệ thống. Giờ hệ thống được ghi ở trong Coordinated Universal Time (UTC) Code: VOID GetSystemTime( LPSYSTEMTIME lpSystemTime // address of system time structure ); Returns Hàm này không có giá trị trả v ề . GetTickCount Hàm GetTickCount có nhiệm vụ tìm số millisecond (một phần nghìn giây) kể từ khi máy tính được mở Code: DWORD GetTickCount(VOID); Returns Nếu function hoàn thành , giá trị trả về là số millisecond đã trôi qua kể từ khi ta mở máy tính. SystemTimeToFileTime Hàm SystemTimeToFileTime có nhiệm vụ đổi giờ hệ thống sang file time. Code: BOOL SystemTimeToFileTime( CONST SYSTEMTIME * lpst, // address of system time to convert LPFILETIME lpft // address of buffer for converted file time ); Returns Nếu function hoàn thành, giá trị trả về là TRUE. Nếu function không hoàn thành, giá trị trả về là FALSE. Để biết thêm thông tin về lỗi, chúng ta dùng hàm GetLastError. 03.8 Window Generating =============== BitBlt Hàm BitBlt có nhiệm vụ perform bit-block transfer của màu dữ liệu tương ứng đến rectangle của pixel từ specified source device context vào destination device context. Code: BOOL BitBlt( HDC hdcDest, // handle of destination device context int nXDest, // x-coord of dest rectangle's upper-left corner int nYDest, // x-coord of dest rectangle's upper-left corner int nWidth, // width of destination rectangle int nHeight, // height of destination rectangle HDC hdcSrc, // handle of source device context int nXSrc, // x-coord of src rectangle's upper-left corner int nYSrc, // y-coord of src rectangle's upper-left corner DWORD dwRop // raster operation code ); Returns Nếu function hoàn thành, giá trị trả về là TRUE. Nếu function không hoàn thành, giá trị trả về là FALSE. Để biết thêm thông tin về lỗi, chúng ta dùng hàm GetLastError. CreateWindow Hàm CreateWindow có nhiệm vụ tạo ra overlapped, pop-up hoặc cửa sổ con. Nó chỉ rõ window class, window title, window style, vị trí và kích thước ban đầu của window. Hàm này còn chỉ ra “cha mẹ” hay “chủ nhân’ của window và menu của window. Code: HWND CreateWindow( LPCTSTR lpClassName, // address of registered class name LPCTSTR lpWindowName, // address of window name DWORD dwStyle, // window style int x, // horizontal position of window int y, // vertical position of window int nWidth, // window width int nHeight, //window height HWND hWndParent, // handle of parent or owner window HMENU hMenu, // handle of menu or child-window identifier HANDLE hInstance, // handle of application instance LPVOID lpParam // address of window-creation data ); Returns Nếu function hoàn thành, giá trị trả về là handle của window mới. Nếu function không hoàn thành, giá trị trả về là NULL. Để biết thêm thông tin về lỗi, chúng ta dùng hàm GetLastError. CreateWindowExA / CreateWindowExW Hàm CreateWindowEx có nhiệm vụ tạo ra overlapped, pop-up hoặc cửa sổ con với extended style; còn về những cái khác thì hàm này giống hệt hàm CreateWindow. Những thông tin về việc tạo 1 window và tất cả các thông số khác của hàm CreateWindowEx, các bác xem hàm CreateWindow. Code: HWND CreateWindowEx( DWORD dwExStyle, // extended window style LPCTSTR lpClassName, // address of registered class name LPCTSTR lpWindowName, // address of window name DWORD dwStyle, // window style int x, // horizontal position of window int y, // vertical position of window int nWidth, // window width int nHeight, // window height HWND hWndParent, // handle of parent or owner window HMENU hMenu, // handle of menu, or child-window identifier HINSTANCE hInstance, // handle of application instance LPVOID lpParam // address of window-creation data ); Returns Nếu function hoàn thành, giá trị trả về là handle của window mới. Nếu function không hoàn thành, giá trị trả về là NULL. SendMessageA / SendMessageW Hàm SendMessage có nhiệm vụ gởi specified message đến window hoặc windows. Hàm này gọi window procedure cho specified window và không quay về cho đến khi window procedure gởi xong message. Ngược lại, hàm PostMessage có nhiệm vụ post message đến message của thread và trở về ngay lập tức. Code: LRESULT SendMessage( HWND hwnd, // handle of destination window UINT uMsg, // message to send WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ); Returns Giá trị trả về ghi kết quả của message processing và dựa vào message đã được gởi. ShowWindow Hàm ShowWindow có nhiệm vụ set trạng thái hiện ra của specified window. Code: BOOL ShowWindow( HWND hwnd, // handle of window int nCmdShow // show state of window ); Returns Nếu window được thấy, giá trị trả về là TRUE. Nếu window bị che, giá trị trả về là FALSE. UpdateWindow Hàm UpdateWindow có nhiệm vụ cập nhật client area của specified window bằng cách gởi WM_PAINT message đến window nếu vùng update của window không trống. Hàm này gởi thẳng WM_PAINT message đến window procedure của specified window, bỏ qua application queue. N ếu vùng update trống thì message sẽ không được gửi đi. Code: BOOL UpdateWindow( HWND hwnd // handle of window ); Returns Nếu function hoàn thành, giá trị trả về là TRUE. Nếu function không hoàn thành, giá trị trả về là FALSE. PHẦN 4 : Kiến thức về lệnh nhảy (jump) JCC - Lệnh nhảy có điều kiện Code: 77 cb JA rel8 Jump short if above (CF=0 and ZF=0) 73 cb JAE rel8 Jump short if above or equal (CF=0) 72 cb JB rel8 Jump short if below (CF=1) 76 cb JBE rel8 Jump short if below or equal (CF=1 or ZF=1) 72 cb JC rel8 Jump short if carry (CF=1) E3 cb JCXZ rel8 Jump short if CX register is 0 E3 cb JECXZ rel8 Jump short if ECX register 0 74 cb JE rel8 Jump short if equal (ZF=1) 7F cb JG rel8 Jump short if greater (ZF=0 and SF=OF) 

Ngày đăng: 01/07/2014, 13:20

Tài liệu cùng người dùng

Tài liệu liên quan