You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could anyone look into this code an tell what might be wrong?
varnet=require('net');varffi=require('ffi');varref=require('ref');varBufferStream=require('node-bufferstream')varPIPE_PATH="\\\\.\\pipe\\DropboxPipe_1"varUserName="YourUserName"varL=console.log;varstruct=require('python-struct');varSessionId=ref.alloc("uint");varencoding=require("encoding");varkernel32=newffi.Library("kernel32",{GetLastError:['string',[]],GetCurrentProcessId: ['int',[]],GetCurrentThreadId: ['int',[]],ProcessIdToSessionId: ['bool',['int','uint *']],CallNamedPipeA:['bool',[]]});varRequestInfo=0x3048302;varProcessId=kernel32.GetCurrentProcessId();varThreadId=kernel32.GetCurrentThreadId();varRequestType=1;vardropbox=ref.types.void;if(!kernel32.ProcessIdToSessionId(ProcessId,SessionId)){console.log(kernel32.GetLastError());}else{//console.log(SessionId);SessionId.type=ref.types.int;SessionIdInt=SessionId.deref();console.log(SessionIdInt);}varmypath="C:/Users/"+UserName+"/Dropbox/"varL=console.log;varclient=net.createConnection({path: '\\\\.\\pipe\\DropboxPipe_1'},function(){console.log('connected');varwtf=0x3048302;varrequest=struct.pack("LLLL",wtf,ProcessId,ThreadId,RequestType)+encoding.convert(mypath,"utf-16le")varstr=newArray(540+1).join(String.fromCharCode(0));request=request+str;varrequest=request.substr(0,540);client.write(request,()=>{console.log("write callback");//this part is written to consoleconsole.log(client.bytesWritten)// 550console.log(client.bytesRead)//0});});client.on("error",function(e){console.log(e);});client.on('data',function(data){L('Client: on data:',data.toString());client.end('Thanks!');});client.on('end',function(){L('Client: on end');})
The text was updated successfully, but these errors were encountered:
I'm trying to make a pipe request to Dropbox application on window (not the Dropbox API)
But i'm getting
Could anyone look into this code an tell what might be wrong?
The text was updated successfully, but these errors were encountered: