Bitcoin Forum
December 11, 2024, 12:45:37 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Vb.Net \ C# - Method to read console windows  (Read 673 times)
Force098 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
July 16, 2017, 07:22:06 PM
 #1

Hey Everyone,

I'm trying to create an agent that reports back data from common miners to a web service. My first thought was to capture the text using the RedirectStandardOutput as part of .Net's StartInfo, but it doesn't seem to work with Claymore's Ethereum miner. Everything works like a charm if I use a simple batch script to ping a website like google.com. I've read that some applications use unorthodox methods of sending output text. I tried capturing the error output but didn't have any luck on that front.

Code for the form: https://pastebin.com/GkBgN0G6
Class I'm using to launch the processes: https://pastebin.com/xWgBM1Ya

My next thought was to pull up Spy++ and see if I could capture the messages that way. It turns out that command consoles are protected by Windows and prevents Spy++ from accessing the console messages.

My hope is that there's a simple tweak to get what I have working. Has anyone been successful doing this?

Thanks!
hexafraction
Sr. Member
****
Offline Offline

Activity: 392
Merit: 268

Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ


View Profile
July 17, 2017, 03:04:14 AM
 #2

Why don't you modify the miner program and recompile it, so that it reports data using a saner interface than trying to parse a user-oriented CLI?

I have recently become active again after a long period of inactivity. Cryptographic proof that my account has not been compromised is available.
Force098 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
July 18, 2017, 02:30:27 AM
 #3

I believe miners like Claymore are private code, nothing to recompile. If we had the source code, he'd be out a lot of money.
cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1057


SpacePirate.io


View Profile WWW
July 19, 2017, 08:17:16 PM
 #4

Try ProcessStartInfo.RedirectStandardOutput in c#

https://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput(v=vs.110).aspx

Force098 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
July 21, 2017, 04:59:34 AM
 #5

Yeah, that's what I originally tried but the output isn't captured from Claymore. Have you had different luck using it?
Force098 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
July 26, 2017, 04:17:59 PM
 #6

bump
btc4peace
Sr. Member
****
Offline Offline

Activity: 445
Merit: 251


pHp DeV


View Profile WWW
July 26, 2017, 11:11:52 PM
 #7

I use AutoIT with WinAPI for such things.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!