#include <ntddk.h>
#include <wdm.h>
VOID DriverUnload(PDRIVER_OBJECT Driver)
{
UNREFERENCED_PARAMETER(Driver);
return;
}
NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING RegistryPath)
{
UNREFERENCED_PARAMETER(pDriverObject);
UNREFERENCED_PARAMETER(RegistryPath);
DbgPrint("Hello, world!");
pDriverObject->DriverUnload =
return STATUS_SUCCESS;
}
rep movsb
, cld
не знал, соответственно не смог выполнить это задание.cld
mov ecx,processname_len-1
lea esi,[processname+1]
lea edi,[processname]
mov byte al,[edi]
rep movsb
mov byte [edi],al
...
struct PROCESSENTRY32
dwSize dd ?
cntUsage dd ?
th32ProcessID dd ?
th32DefaultHeapID dd ?
th32ModuleID dd ?
cntThreads dd ?
th32ParentProcessID dd ?
pcPriClassBase dd ?
dwFlags dd ?
szExeFile rb 1024
ends
...
; IN section '.data'
pe32 PROCESSENTRY32 ?
::bind
а не bind
WSACleanup();
WSADATA wsaData;
SOCKET sListen, newConnection;
struct sockaddr_in server, client;
int c;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
dlg->AddLog("Error WSAStartup");
return -1;
}
if ((sListen = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
dlg->AddLog("Error create socket sListen");
return -1;
}
server.sin_family = AF_INET;
server.sin_addr.s_addr = inet_addr(IP.c_str());
server.sin_port = htons(atoi(PORT.c_str()));
int result = ::bind(sListen, (struct sockaddr*)&server, sizeof(server));
if (result != 0) {
string code = to_string(WSAGetLastError());
dlg->AddLog(string("Bind error: " + code).c_str());
}
listen(sListen, 256);
dlg->AddLog("Waiting for connections...");
c = sizeof(struct sockaddr_in);
newConnection = accept(sListen, (struct sockaddr*)&client, &c);
if (newConnection == INVALID_SOCKET) {
dlg->AddLog("Error accept");
}
dlg->AddLog("Connected new user!");
closesocket(sListen);
strContent[1024];
strContent[1024] = {0};