ANTICHAT — форум по информационной безопасности, OSINT и технологиям
ANTICHAT — русскоязычное сообщество по безопасности, OSINT и программированию.
Форум ранее работал на доменах antichat.ru, antichat.com и antichat.club,
и теперь снова доступен на новом адресе —
forum.antichat.xyz.
Форум восстановлен и продолжает развитие: доступны архивные темы, добавляются новые обсуждения и материалы.
⚠️ Старые аккаунты восстановить невозможно — необходимо зарегистрироваться заново.

20.01.2008, 20:34
|
|
Постоянный
Регистрация: 04.11.2007
Сообщений: 303
Провел на форуме: 811764
Репутация:
119
|
|
Можно еще 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
|
|
|

20.01.2008, 20:39
|
|
Постоянный
Регистрация: 11.03.2007
Сообщений: 581
Провел на форуме: 4172659
Репутация:
646
|
|
В winsock вроде что-то типа getpeername
|
|
|

21.01.2008, 17:23
|
|
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме: 314553
Репутация:
38
|
|
Как использовать EnumProcesses ?
|
|
|

21.01.2008, 17:32
|
|
Banned
Регистрация: 08.04.2005
Сообщений: 446
Провел на форуме: 2187381
Репутация:
518
|
|
http://www.rsdn.ru/Forum/?mid=891588
|
|
|

21.01.2008, 18:40
|
|
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме: 314553
Репутация:
38
|
|
спасибо то што нужна !!!!!!!
|
|
|

21.01.2008, 19:07
|
|
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме: 314553
Репутация:
38
|
|
а как получить Handle процессов по их Hwnd окон, если есть другие способы то пригодится тоже.
|
|
|

21.01.2008, 19:11
|
|
Постоянный
Регистрация: 05.01.2007
Сообщений: 508
Провел на форуме: 2360904
Репутация:
1393
|
|
Сообщение от KSoniX
а как получить Handle процессов по их Hwnd окон, если есть другие способы то пригодится тоже.
OpenProcess()
|
|
|

21.01.2008, 19:19
|
|
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме: 314553
Репутация:
38
|
|
а можно подробнее?
|
|
|

21.01.2008, 19:27
|
|
Постоянный
Регистрация: 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.
|
|
|

21.01.2008, 19:34
|
|
Познающий
Регистрация: 17.01.2008
Сообщений: 94
Провел на форуме: 314553
Репутация:
38
|
|
я в msdn это уже прочитал толка ни понял послед ного параметра DWORD dwProcessId
|
|
|
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|