Advertisement
Guest User

Untitled

a guest
Feb 7th, 2018
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. Hi there,
  2.  
  3. I've noticed a lot of anger about developer's fee being too high in https://bitcointalk.org/index.php?topic=2021765.0. And I agree with all of you. Earning 20ZEC/day is definitely a lot.
  4.  
  5. So, you're about to rant on it as well?
  6.  
  7. Not really. I don't rant, but instead I do things. For the reason stated above, I investigated
  8. the binary of the 0.5.7 version (I couldn't see the difference in performance between 0.5.7
  9. and 0.5.8, so I stopped there) and found a rather trivial way of sending the fee directly
  10. to one's address.
  11.  
  12. Can I also do it?
  13.  
  14. Yes, and that's why I'm posting. As you are going to see, it is totally safe and free.
  15.  
  16. OK, give me the details!
  17.  
  18. So, first of all, you have to use Linux. Similarly to the developer I also like Linux environment
  19. better. The "fix" I am about to give you implements standard LD_PRELOAD trick on a function
  20. (SSL_write) used by the dev to send encrypted message (containing his wallet address) to the
  21. pool. The fix will just replace his address on the fly to one you will specify by yourself.
  22.  
  23. Right, right... but how?!
  24.  
  25. Alright, here is the code (read it please, and change accordingly before blaming me that it doesn't work):
  26. Code:
  27.  
  28.  
  29.  
  30.  
  31. #define _GNU_SOURCE
  32. #include <assert.h>
  33. #include <dlfcn.h>
  34. #include <stdint.h>
  35. #include <stdio.h>
  36. #include <stdlib.h>
  37. #include <string.h>
  38.  
  39. typedef void SSL;
  40. typedef int SSL_write_t(SSL *ssl, const void *buf, int num);
  41. static SSL_write_t *g_ssl_write;
  42.  
  43. int SSL_write(SSL *ssl, const void *buf, int num) {
  44. // Address of the developer.
  45. static const char *FORBIDDEN_ADDR = "t1NEpmfunewy9z5TogCvAhCuS3J8VWXoJNv";
  46.  
  47. // Your wallet address - just change it to yours unless you want to give me the
  48. // 2% dev fee ;-)
  49. static const char *REPLACEMENT_ADDR = "t1ahG2SbR8mkrVtVUWNMBMEy9Br6Jgvhm7b";
  50.  
  51. if (!g_ssl_write) {
  52. g_ssl_write = (SSL_write_t *) (intptr_t) dlsym(RTLD_NEXT, "SSL_write");
  53. assert(g_ssl_write && "Could not get SSL_write");
  54. }
  55.  
  56. void *address = memmem(buf, num, FORBIDDEN_ADDR, strlen(FORBIDDEN_ADDR));
  57. if (address) {
  58. puts("
  59. Successfully replaced the address!");
  60. void *bufcopy = malloc(num);
  61. assert(bufcopy && "Could not allocate memory");
  62. memcpy(bufcopy, buf, num);
  63. const size_t offset = (char *) address - (char *) buf;
  64. memcpy((char *) bufcopy + offset,
  65. REPLACEMENT_ADDR,
  66. strlen(REPLACEMENT_ADDR));
  67. int retval = g_ssl_write(ssl, bufcopy, num);
  68. free(bufcopy);
  69. return retval;
  70. }
  71. return g_ssl_write(ssl, buf, num);
  72. }
  73.  
  74.  
  75.  
  76. Save the code above as fix.c.
  77. Make sure you have gcc installed on your machine.
  78. Compile it to the shared library fix.so either by:
  79.  
  80.  
  81.  
  82.  
  83. Code:
  84. gcc fix.c -std=gnu99 -shared -o fix.so
  85. or if that didn't work:
  86.  
  87. Code:
  88. gcc fix.c -std=gnu99 -shared -fPIC -o fix.so
  89.  
  90. Use
  91. Code:
  92. LD_PRELOAD=/absolute/path/to/the/fix.so ./zm <standard-arguments-you-typically-give-to-it>
  93. to make it work.
  94.  
  95. Have more profit. All shares will be send to your wallet address on flypool (you'll notice the miner name "n" giving you additional sols/s).
  96.  
  97. If you found this useful, and would like to say "thanks" by sending some ZECs to me, here's the address:
  98.  
  99. ZCASH: t1J2wqiimksyV4GGDH6LieiRKfXjn7vb9Ue
  100.  
  101. Happy mining.
  102.  
  103. Edit history:
  104. 2018-01-18:
  105. updated the code, so that it compiles without libssl-dev
  106. fixed missing include
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement