Code:
In short, it tells me that CreateNamedPipe, ConnectNamedPipe and DisconnectNamedPipe are not found even though they're in WinBase.h (which is included in Windows.h) - is there any reason for this?
Code
#include "pch.h" //windows.h
#include <stdio.h>
#include <iostream>
using namespace std;
DWORD WINAPI hook(LPVOID lpParam);
BOOL startsWith(const char *needle, const char *haystack);
void externalCall(const char *called);
BOOL WINAPI APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
threadHandle = CreateThread(NULL, 0, hook, 0, 0, NULL);
break;
case DLL_THREAD_ATTACH: break;
case DLL_THREAD_DETACH: break;
case DLL_PROCESS_DETACH:
//TerminateThread(threadHandle, 0);
//CloseHandle(threadHandle);
break;
}
return TRUE;
}
DWORD WINAPI hook(LPVOID lpParam) {
HANDLE pipeHandle;
char buffer[1024];
DWORD dwRead;
pipeHandle = CreateNamedPipe(TEXT("\\\\.\\pipe\\OmniBotPipe"), PIPE_ACCESS_DUPLEX | PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, PIPE_WAIT, 1, (1024 * 16), (1024 * 16), NMPWAIT_USE_DEFAULT_WAIT, NULL);
while (pipeHandle != NULL) {
if (ConnectNamedPipe(pipeHandle, NULL) != FALSE) {
while (ReadFile(pipeHandle, buffer, sizeof(buffer), &dwRead, NULL) != FALSE) {
externalCall(buffer);
}
}
}
DisconnectNamedPipe(pipeHandle);
}
void externalCall(const char *called) {
if (startsWith("char", called)) {
//todo
}
}
BOOL startsWith(const char *needle, const char *haystack) {
return (strncmp(haystack, needle, strlen(needle)) == 0);
}In short, it tells me that CreateNamedPipe, ConnectNamedPipe and DisconnectNamedPipe are not found even though they're in WinBase.h (which is included in Windows.h) - is there any reason for this?
New to trading cryptocurrencies but don't know where to start? Join Binance here! Binance is my favourite exchange for cryptocurrencies w/ low fees.
![[Image: 793854efd3c9ee7d90ddd413ae9deed6.png]](https://i.gyazo.com/793854efd3c9ee7d90ddd413ae9deed6.png)
![[Image: 793854efd3c9ee7d90ddd413ae9deed6.png]](https://i.gyazo.com/793854efd3c9ee7d90ddd413ae9deed6.png)


