forked from Elijah/AudioBot
25 lines
589 B
C
25 lines
589 B
C
|
#include <stdio.h>
|
||
|
#include <rfb/rfbclient.h>
|
||
|
|
||
|
#define VNC_PASSWORD "D0gg0!!!"
|
||
|
|
||
|
char * getpassword(rfbClient *client) {
|
||
|
return strdup(VNC_PASSWORD);
|
||
|
};
|
||
|
|
||
|
int main(int argc, char **argv) {
|
||
|
rfbClient* client = rfbGetClient(8,3,4);
|
||
|
rfbEnableClientLogging = FALSE;
|
||
|
client->GetPassword = getpassword;
|
||
|
if (!rfbInitClient(client,&argc,argv) || WaitForMessage(client,50) < 0 || !HandleRFBServerMessage(client)) return 1;
|
||
|
|
||
|
if (*client->desktopName) {
|
||
|
fputs(client->desktopName, stdout);
|
||
|
} else {
|
||
|
printf("a virtual machine");
|
||
|
};
|
||
|
|
||
|
rfbClientCleanup(client);
|
||
|
return 0;
|
||
|
}
|