Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: WinAPI и системное программирование > Как посмотреть какие API функции использует прога


Автор: danilsl 19.9.2006, 19:54
Может быть не та ветка, заранее извиняюсь.
Какую можно использовать прогу для того, чтобы посмотреть какие API функции использует другая софтина?

Автор: Damarus 19.9.2006, 20:08
Цитата(danilsl @  19.9.2006,  20:54 Найти цитируемый пост)
Может быть не та ветка, заранее извиняюсь.Какую можно использовать прогу для того, чтобы посмотреть какие API функции использует другая софтина?

dumpbin /imports <PE-файл>

Добавлено @ 20:11 
Или любую другую программу, которая может показать таблицу импорта.

Автор: Alexeis 19.9.2006, 20:28
В поставку делфи входит программа 
TDUMP.EXE
Она показывает секцию импорта.

Автор: Snowy 19.9.2006, 20:30
Можно посмотреть секцию импорта.
А можно просто глянуть на содержимое файла - все функции перечислены подряд и видны невооружённым глазом.
Если конечно файл не пожат.

Автор: danilsl 20.9.2006, 03:18
честно говоря меня интересует файлик C:\WINDOWS\system32\svchost.exe из Win 2003 Std. В нём, как я понимаю напихана куча системных сервисов и TDUMP.EXE на нём солидненько так спотыкается...

Код

C:\Program Files\Borland\Delphi7\Bin>tdump.exe d:\svchost.exe
Turbo Dump  Version 5.0.16.12 Copyright (c) 1988, 2000 Inprise Corporation
                  Display of File D:\SVCHOST.EXE

Old Executable Header

DOS File Size                                       3800h  ( 14336. )
Load Image Size                                      450h  (  1104. )
Relocation Table entry count                          0000h  (     0. )
Relocation Table address                              0040h  (    64. )
Size of header record      (in paragraphs)            0004h  (     4. )
Minimum Memory Requirement (in paragraphs)            0000h  (     0. )
Maximum Memory Requirement (in paragraphs)            FFFFh  ( 65535. )
File load checksum                                    0000h  (     0. )
Overlay Number                                        0000h  (     0. )

Initial Stack Segment  (SS:SP)                    0000:00B8
Program Entry Point    (CS:IP)                    0000:0000


Portable Executable (PE) File

Header base: 000000E0

CPU type                 80386
Flags                    10F [ fixed executable backwards 32bit ]
DLL flags                8400 [ ]
Linker Version           7.A
Time stamp               42435E37 : Fri Mar 25 03:41:27 2005
O/S Version              5.2
User Version             5.2
Subsystem Version        4.0
Subsystem                0002 [ Windows GUI ]
Object count             00000003
Symbols offset           00000000
Symbols count            00000000
Optional header size     00E0
Magic #                  10B
Code size                00002C00
Init Data size           00000C00
Uninit Data size         00000000
Entry RVA                000020C9
Image base               01000000
Code base                00001000
Data base                00004000
Object/File align        00001000/00000200
Reserved                 00000000
Image size               00006000
Header size              00000400
Checksum                 0000E2B3
Stack reserve/commit     00040000/00004000
Heap reserve/commit      00100000/00001000
Number interesting RVAs  00000010
Name                   RVA       Size
------------------  --------  --------
Exports             00000000  00000000
Imports             000032FC  00000064
Resources           00005000  00000418
Exceptions          00000000  00000000
Security            00000000  00000000
Fixups              00000000  00000000
Debug               00003B08  00000038
Description         00000000  00000000
Global Ptr          00000000  00000000
TLS                 00000000  00000000
Callbacks           00000000  00000000
Bound Imports       00000250  00000060
Import Addr Table   00001000  00000140
Delayed Imports     000031FC  00000060
COM Runtime         00000000  00000000
reserved            00000000  00000000

Object table:
#   Name      VirtSize    RVA     PhysSize  Phys off  Flags
--  --------  --------  --------  --------  --------  --------
01  .text     00002B68  00001000  00002C00  00000400  60000020 [CER]
02  .data     00000550  00004000  00000200  00003000  C0000040 [IRW]
03  .rsrc     00000418  00005000  00000600  00003200  40000040 [IR]

Key to section flags:
  C - contains code
  E - executable
  I - contains initialized data
  R - readable
  W - writeable

Comments:
  ┤wCB0

******************************************************************************
Section:             Import
  ImportLookUpTblRVA:00003394
  Time Stamp:        FFFFFFFF : Thu Jan 01 02:59:59 1970
  Forwarder Chain:   FFFFFFFF (index of first forwarder reference)

Imports from ADVAPI32.dll
    (hint = 01F8) RegQueryValueExW
    (hint = 0244) SetServiceStatus
    (hint = 020F) RegisterServiceCtrlHandlerW
    (hint = 01CB) RegCloseKey
    (hint = 01ED) RegOpenKeyExW
    (hint = 024B) StartServiceCtrlDispatcherW
    (hint = 023A) SetSecurityDescriptorDacl
    (hint = 022B) SetEntriesInAclW
    (hint = 023B) SetSecurityDescriptorGroup
    (hint = 023C) SetSecurityDescriptorOwner
    (hint = 0134) InitializeSecurityDescriptor
    (hint = 011A) GetTokenInformation
    (hint = 01AC) OpenProcessToken
    (hint = 01B1) OpenThreadToken

Imports from KERNEL32.dll
    (hint = 0216) HeapFree
    (hint = 0171) GetLastError
    (hint = 0394) WideCharToMultiByte
    (hint = 03CD) lstrlenW
    (hint = 0075) DeactivateActCtx
    (hint = 01A0) GetProcAddress
    (hint = 0254) LoadLibraryExW
                  ActivateActCtx
    (hint = 0251) LeaveCriticalSection
    (hint = 03C1) lstrcmpW
    (hint = 0098) EnterCriticalSection
    (hint = 0210) HeapAlloc
    (hint = 00F8) FreeLibrary
    (hint = 02C1) ReleaseActCtx
    (hint = 0049) CreateActCtxW
    (hint = 00BD) ExpandEnvironmentStringsW
    (hint = 03C4) lstrcmpiW
    (hint = 00B9) ExitProcess
    (hint = 0111) GetCommandLineW
    (hint = 0223) InitializeCriticalSection
    (hint = 01A3) GetProcessHeap
    (hint = 0315) SetErrorMode
    (hint = 034A) SetUnhandledExceptionFilter
    (hint = 02BD) RegisterWaitForSingleObject
    (hint = 025C) LocalFree
    (hint = 0142) GetCurrentProcess
    (hint = 0145) GetCurrentThread
    (hint = 0226) InterlockedCompareExchange
    (hint = 0252) LoadLibraryA
    (hint = 02A3) QueryPerformanceCounter
    (hint = 01DF) GetTickCount
    (hint = 0146) GetCurrentThreadId
    (hint = 0143) GetCurrentProcessId
    (hint = 01CA) GetSystemTimeAsFileTime
    (hint = 035E) TerminateProcess
    (hint = 036E) UnhandledExceptionFilter
    (hint = 0258) LocalAlloc
    (hint = 0245) LCMapStringW
    (hint = 007F) DelayLoadFailureHook

Imports from ntdll.dll
    (hint = 02BD) RtlInitializeSid
    (hint = 01C4) RtlAllocateHeap
    (hint = 02EE) RtlLengthRequiredSid
    (hint = 0372) RtlSubAuthoritySid
    (hint = 0277) RtlFreeHeap
    (hint = 01FA) RtlCopySid
    (hint = 0371) RtlSubAuthorityCountSid
    (hint = 056A) wcscpy
    (hint = 0567) wcscat
    (hint = 02B5) RtlInitializeCriticalSection
    (hint = 035E) RtlSetProcessIsCritical
    (hint = 02A4) RtlImageNtHeader
    (hint = 056C) wcslen
    (hint = 0386) RtlUnhandledExceptionFilter

Imports from RPCRT4.dll
    (hint = 01B2) RpcServerUnregisterIfEx
    (hint = 0194) RpcMgmtWaitServerListen
    (hint = 01B1) RpcServerUnregisterIf
    (hint = 0191) RpcMgmtSetServerStackSize
    (hint = 01AA) RpcServerListen
    (hint = 01BB) RpcServerUseProtseqEpW
    (hint = 01AD) RpcServerRegisterIf
    (hint = 0037) I_RpcMapWin32Status
    (hint = 0193) RpcMgmtStopServerListening

Delayed Load Import Table
ERROR: Internal error at 0x42213f with base 0x400000


C:\Program Files\Borland\Delphi7\Bin>

Автор: Coder 20.9.2006, 03:33
Пропробуй вот эту программу http://ps.russian.ru/API%20Monitor%201.5b.zip

!!! Перед запуском мониторинга грамотно настрой фильтры !! 

Автор: SergeCpp 20.9.2006, 08:22
http://www.dependencywalker.com

user posted image

Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules. For each module found, it lists all the functions that are exported by that module, and which of those functions are actually being called by other modules. Another view displays the minimum set of required files, along with detailed information about each file including a full path to the file, base address, version numbers, machine type, debug information, and more.

Dependency Walker is also very useful for troubleshooting system errors related to loading and executing modules. Dependency Walker detects many common application problems such as missing modules, invalid modules, import/export mismatches, circular dependency errors, mismatched machine types of modules, and module initialization failures.

Dependency Walker runs on Windows 95, 98, Me, NT, 2000, XP, 2003, and Vista. It can process any 32-bit or 64-bit Windows module, including ones designed for Windows CE. It can be run as graphical application or as a console application. Dependency Walker handles all types of module dependencies, including implicit, explicit (dynamic / runtime), forwarded, delay-loaded, and injected. A detailed help is included.

Dependency Walker is completely free to use.

P.S. Кстати, есть возможность поиска в MSDN описания функции, на которой курсор.

Автор: Yanis 20.9.2006, 09:14
А мне нравится http://www.secretashell.com/codomain/peid/files/PEiD-0.94-20060510.zip и http://rouse.front.ru/propsheet.zip, которую написал Rouse_. Это даже не программа, а демка с исходным кодом. Как раз для того и предназначена - смотреть таблицу импорта и экспорта PE файла.

Автор: Snowy 20.9.2006, 09:15
Цитата(danilsl @  20.9.2006,  03:18 Найти цитируемый пост)
интересует файлик C:\WINDOWS\system32\svchost.exe
Не он использует, а его используют dll, чтобы запускаться.
Это такой космодромчик для сервисов, написанных в виде dll.
В нём ты их не найдёшь.

Автор: RA 20.9.2006, 16:23
API Spy, век воли не видать.

Автор: USSR 20.9.2006, 17:26
IDA PRO

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)