ANTICHAT.XYZ    VIDEO.ANTICHAT.XYZ    НОВЫЕ СООБЩЕНИЯ    ФОРУМ  
Баннер 1   Баннер 2

ANTICHAT — форум по информационной безопасности, OSINT и технологиям

ANTICHAT — русскоязычное сообщество по безопасности, OSINT и программированию. Форум ранее работал на доменах antichat.ru, antichat.com и antichat.club, и теперь снова доступен на новом адресе — forum.antichat.xyz.
Форум восстановлен и продолжает развитие: доступны архивные темы, добавляются новые обсуждения и материалы.
⚠️ Старые аккаунты восстановить невозможно — необходимо зарегистрироваться заново.
Вернуться   Форум АНТИЧАТ > Программирование_OLD > С/С++, C#, Delphi, .NET, Asm
   
 
 
Опции темы Поиск в этой теме Опции просмотра

  #631  
Старый 20.01.2008, 20:34
criz
Постоянный
Регистрация: 04.11.2007
Сообщений: 303
Провел на форуме:
811764

Репутация: 119
По умолчанию

Цитата:
system("pause");
Можно еще getchar();

Как узнать ИП подключившегося, не используя:
Код:
struct hostent FAR * gethostbyname (const char FAR * name);
Пробовал вот так:
Код:
loc.sin_family 	=	AF_INET;
	loc.sin_port	=	htons(PORT);
	loc.sin_addr.s_addr = htonl(INADDR_ANY);
/*some code*/
printf("%s is connected\n", inet_ntoa(loc.sin_addr));
Возврщает строчку вида: 0.0.0.0
 

  #632  
Старый 20.01.2008, 20:39
Joker-jar
Постоянный
Регистрация: 11.03.2007
Сообщений: 581
Провел на форуме:
4172659

Репутация: 646


Отправить сообщение для Joker-jar с помощью ICQ
По умолчанию

В winsock вроде что-то типа getpeername
 

  #633  
Старый 21.01.2008, 17:23
KSoniX
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме:
314553

Репутация: 38
Отправить сообщение для KSoniX с помощью ICQ
По умолчанию

Как использовать EnumProcesses ?
 

  #634  
Старый 21.01.2008, 17:32
Delimiter
Banned
Регистрация: 08.04.2005
Сообщений: 446
Провел на форуме:
2187381

Репутация: 518
По умолчанию

http://www.rsdn.ru/Forum/?mid=891588
 

  #635  
Старый 21.01.2008, 18:40
KSoniX
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме:
314553

Репутация: 38
Отправить сообщение для KSoniX с помощью ICQ
По умолчанию

спасибо то што нужна !!!!!!!
 

  #636  
Старый 21.01.2008, 19:07
KSoniX
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме:
314553

Репутация: 38
Отправить сообщение для KSoniX с помощью ICQ
По умолчанию

а как получить Handle процессов по их Hwnd окон, если есть другие способы то пригодится тоже.
 

  #637  
Старый 21.01.2008, 19:11
z01b
Постоянный
Регистрация: 05.01.2007
Сообщений: 508
Провел на форуме:
2360904

Репутация: 1393


По умолчанию

Цитата:
Сообщение от KSoniX  
а как получить Handle процессов по их Hwnd окон, если есть другие способы то пригодится тоже.
OpenProcess()
 

  #638  
Старый 21.01.2008, 19:19
KSoniX
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме:
314553

Репутация: 38
Отправить сообщение для KSoniX с помощью ICQ
По умолчанию

а можно подробнее?
 

  #639  
Старый 21.01.2008, 19:27
z01b
Постоянный
Регистрация: 05.01.2007
Сообщений: 508
Провел на форуме:
2360904

Репутация: 1393


По умолчанию

Цитата:
Сообщение от KSoniX  
а можно подробнее?
HANDLE hProcess;
hProcess=OpenProcess(..,..,..,),;
Код:
The OpenProcess function returns a handle of an existing process object. 

HANDLE OpenProcess(

    DWORD dwDesiredAccess,	// access flag 
    BOOL bInheritHandle,	// handle inheritance flag 
    DWORD dwProcessId 	// process identifier 
   );	
 

Parameters

dwDesiredAccess

Specifies the access to the process object. For operating systems that support security checking, this access is checked against any security descriptor for the target process. Any combination of the following access flags can be specified in addition to the STANDARD_RIGHTS_REQUIRED access flags: 

Access	Description
PROCESS_ALL_ACCESS	Specifies all possible access flags for the process object.
PROCESS_CREATE_PROCESS	Used internally.
PROCESS_CREATE_THREAD	Enables using the process handle in the CreateRemoteThread function to create a thread in the process.
PROCESS_DUP_HANDLE	Enables using the process handle as either the source or target process in the DuplicateHandle function to duplicate a handle.
PROCESS_QUERY_INFORMATION	Enables using the process handle in the GetExitCodeProcess and GetPriorityClass functions to read information from the process object.
PROCESS_SET_INFORMATION	Enables using the process handle in the SetPriorityClass function to set the priority class of the process.
PROCESS_TERMINATE	Enables using the process handle in the TerminateProcess function to terminate the process.
PROCESS_VM_OPERATION	Enables using the process handle in the VirtualProtectEx and WriteProcessMemory functions to modify the virtual memory of the process.
PROCESS_VM_READ	Enables using the process handle in the ReadProcessMemory function to read from the virtual memory of the process.
PROCESS_VM_WRITE	Enables using the process handle in the WriteProcessMemory function to write to the virtual memory of the process.
SYNCHRONIZE	Windows NT only: Enables using the process handle in any of the wait functions to wait for the process to terminate.
 

bInheritHandle

Specifies whether the returned handle can be inherited by a new process created by the current process. If TRUE, the handle is inheritable. 

dwProcessId

Specifies the process identifier of the process to open. 

 

Return Values

If the function succeeds, the return value is an open handle of the specified process.
If the function fails, the return value is NULL. To get extended error information, call GetLastError. 

Remarks

The handle returned by the OpenProcess function can be used in any function that requires a handle to a process, such as the wait functions, provided the appropriate access rights were requested. 
When you are finished with the handle, be sure to close it using the CloseHandle function.
 

  #640  
Старый 21.01.2008, 19:34
KSoniX
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме:
314553

Репутация: 38
Отправить сообщение для KSoniX с помощью ICQ
По умолчанию

я в msdn это уже прочитал толка ни понял послед ного параметра DWORD dwProcessId
 
 





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT.XYZ