Don't like ads? PRO users don't see any ads ;-)
Guest

dmg notifier src 0.6b

By: thisizmonster on Apr 26th, 2012  |  syntax: ASM (NASM)  |  size: 9.87 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ; damage notifier v0.6b, coded by Guardian Angel
  2. ; online survey: https://docs.google.com/spreadsheet/viewform?formkey=dHI2c2kzZW95MmdrSkxWMjFoUEtLZ0E6MQ
  3. ; contact & cooperate thisizmonster@gmail.com
  4.  
  5.     InitGameMod     PROTO
  6.     jGetDamageEvent PROTO
  7.  
  8.     .data
  9.  
  10.     _STR_spFLOAT    db  "%.2f",0
  11.     _STR_CTT        db    "CreateTextTag",0
  12.    
  13. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  14.  
  15.     _WT_tt          db  ")Htexttag;",0
  16.     _WT_r           db  ")R",0
  17.     _WT_u           db  ")Hunit;",0
  18.     _WT_v           db  ")V",0
  19.     _WT_s           db  ")S",0
  20.  
  21. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  22.  
  23.     pGame_jGetEventDamage       dd  03C3C40h
  24.     pGame_jGetEventTargetUnit   dd  03C3D00h
  25.     pGame_jGetTriggerUnit       dd  03BB240h
  26.     pGame_jCreateTextTag        dd  03BC580h
  27.     pGame_jSetTextTagText       dd  03BC5D0h
  28.     pGame_jSetTextTagPosUnit    dd  03CB890h
  29.     pGame_jSetTextTagColor      dd  03BC6A0h
  30.     pGame_jSetTextTagPermanent  dd  03BC7C0h
  31.     pGame_jSetTextTagVelocity   dd  03BC700h
  32.     pGame_jSetTextTagLifespan   dd  03BC820h
  33.     pGame_jSetTextTagFadepoint  dd  03BC850h
  34.     pGame_jSetTextTagVisibility dd  03BC760h
  35.     pGame_jSetTextTagPos        dd  03BC610h
  36.     pGame_jSetTextTagSuspended  dd  03BC790h
  37.     pGame_jR2S                  dd  03BAAF0h
  38.     pGame_p459150                dd    0459150h
  39.  
  40. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  41.  
  42.     float_003       dd  0.03
  43.     float_0         dd  0.0
  44.     float_05        dd  0.05
  45.     float_1         dd  1.0
  46.     float_2         dd  2.0
  47.    
  48. ; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  49.  
  50.     .data?
  51.     oldprot            dd    ?
  52.  
  53. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  54.  
  55. InitGameMod     proc
  56.  
  57.       sub   esp, 6h
  58.  
  59.       mov   eax, dword ptr ds:[hGameP]
  60.       push  eax
  61.       mov   ebx, dword ptr ds:[pGame_jGetEventDamage]
  62.       add   ebx, 15h
  63.       add   eax, ebx
  64.       mov   dword ptr ds:[pGame_jGetEventDamage], eax
  65.      
  66.       pop   eax
  67.       push  eax
  68.       mov   ebx, dword ptr ds:[pGame_jGetEventTargetUnit]
  69.       add   eax, ebx
  70.       mov   dword ptr ds:[pGame_jGetEventTargetUnit], eax
  71.  
  72.       pop   eax
  73.       push  eax
  74.       mov   ebx, dword ptr ds:[pGame_jGetTriggerUnit]
  75.       add   eax, ebx
  76.       mov   dword ptr ds:[pGame_jGetTriggerUnit], eax
  77.  
  78.       pop   eax
  79.       push  eax
  80.       mov   ebx, dword ptr ds:[pGame_jCreateTextTag]
  81.       add   eax, ebx
  82.       mov   dword ptr ds:[pGame_jCreateTextTag], eax
  83.  
  84.       pop   eax
  85.       push  eax
  86.       mov   ebx, dword ptr ds:[pGame_jSetTextTagText]
  87.       add   eax, ebx
  88.       mov   dword ptr ds:[pGame_jSetTextTagText], eax
  89.  
  90.       pop   eax
  91.       push  eax
  92.       mov   ebx, dword ptr ds:[pGame_jSetTextTagPosUnit]
  93.       add   eax, ebx
  94.       mov   dword ptr ds:[pGame_jSetTextTagPosUnit], eax
  95.  
  96.       pop   eax
  97.       push  eax
  98.       mov   ebx, dword ptr ds:[pGame_jSetTextTagColor]
  99.       add   eax, ebx
  100.       mov   dword ptr ds:[pGame_jSetTextTagColor], eax
  101.  
  102.       pop   eax
  103.       push  eax
  104.       mov   ebx, dword ptr ds:[pGame_jSetTextTagPermanent]
  105.       add   eax, ebx
  106.       mov   dword ptr ds:[pGame_jSetTextTagPermanent], eax
  107.  
  108.       pop   eax
  109.       push  eax
  110.       mov   ebx, dword ptr ds:[pGame_jSetTextTagVelocity]
  111.       add   eax, ebx
  112.       mov   dword ptr ds:[pGame_jSetTextTagVelocity], eax
  113.  
  114.       pop   eax
  115.       push  eax
  116.       mov   ebx, dword ptr ds:[pGame_jSetTextTagLifespan]
  117.       add   eax, ebx
  118.       mov   dword ptr ds:[pGame_jSetTextTagLifespan], eax
  119.  
  120.       pop   eax
  121.       push  eax
  122.       mov   ebx, dword ptr ds:[pGame_jSetTextTagFadepoint]
  123.       add   eax, ebx
  124.       mov   dword ptr ds:[pGame_jSetTextTagFadepoint], eax
  125.  
  126.       pop   eax
  127.       push  eax
  128.       mov   ebx, dword ptr ds:[pGame_jSetTextTagVisibility]
  129.       add   eax, ebx
  130.       mov   dword ptr ds:[pGame_jSetTextTagVisibility], eax
  131.  
  132.       pop   eax
  133.       push  eax
  134.       mov   ebx, dword ptr ds:[pGame_jSetTextTagPos]
  135.       add   eax, ebx
  136.       mov   dword ptr ds:[pGame_jSetTextTagPos], eax
  137.  
  138.       pop   eax
  139.       push  eax
  140.       mov   ebx, dword ptr ds:[pGame_jSetTextTagSuspended]
  141.       add   eax, ebx
  142.       mov   dword ptr ds:[pGame_jSetTextTagSuspended], eax
  143.  
  144.       pop   eax
  145.       push  eax
  146.       mov   ebx, dword ptr ds:[pGame_jR2S]
  147.       add   eax, ebx
  148.       mov   dword ptr ds:[pGame_jR2S], eax
  149.  
  150.       pop   eax
  151.       push  eax
  152.       mov   ebx, dword ptr ds:[pGame_p459150]
  153.       add   eax, ebx
  154.       mov   dword ptr ds:[pGame_p459150], eax        
  155.      
  156.       pop   eax                                             ;free the stack
  157.  
  158.       push  esp
  159.       push  PAGE_EXECUTE_READWRITE
  160.       push  6
  161.       push  pGame_jGetEventDamage
  162.       call  VirtualProtect
  163.      
  164.       lea   eax, jGetDamageEvent
  165.       sub   eax, pGame_jGetEventDamage
  166.       sub   eax, 5
  167.       mov   oldprot, eax
  168.  
  169.       push  4
  170.       lea   eax, oldprot
  171.       push  eax
  172.       mov   eax, esp
  173.       add   eax, 9
  174.       push  eax
  175.       call  crt_memcpy
  176.       add   esp, 0Ch
  177.  
  178.       mov   byte ptr ss:[esp], 0E9h
  179.       mov   byte ptr ss:[esp+5],  90h
  180.  
  181.       push  6
  182.       mov   eax, esp
  183.       add   eax, 4
  184.       push  eax
  185.       push  pGame_jGetEventDamage
  186.       call  crt_memcpy
  187.       add   esp, 0Ch
  188.  
  189.       add   esp, 6h
  190.       ret            
  191.  
  192. InitGameMod     endp
  193.  
  194. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  195.  
  196. jGetDamageEvent proc
  197.  
  198. OPTION PROLOGUE:NONE
  199. OPTION EPILOGUE:NONE
  200.  
  201.       pushad
  202.  
  203.       lea   eax, dword ptr ds:[eax+30h]
  204.       push  eax                         ;dmg val
  205.       lea   esi, _WT_tt
  206.       call  pGame_jCreateTextTag
  207.       push  eax                         ;texttag
  208.      
  209.       mov    ecx, dword ptr ds:[hGameP]
  210.       add    ecx, 0ADA848h
  211.       mov    ecx, dword ptr ds:[ecx]
  212.       mov    ecx, dword ptr ds:[ecx+14h]
  213.       mov    ecx, dword ptr ds:[ecx+0Ch]
  214.       mov    ecx, dword ptr ds:[ecx]
  215.  
  216.       mov    esi, ecx
  217.       mov    ebx, eax
  218.       lea    edi, _STR_CTT
  219.       push    edi
  220.       call    pGame_p459150
  221.      
  222.      
  223.       lea   esi, _WT_u
  224.       call  pGame_jGetTriggerUnit       ;get the unit
  225.       push  eax
  226.  
  227.       sub   esp, 100h
  228.       mov   edi, esp
  229.       push  edi                         ;strbuf
  230.  
  231.       push  0
  232.       push    0
  233.       mov    eax, dword ptr ss:[esp+100h+14h]
  234.       fld   dword ptr ss:[eax]
  235.       fstp    qword ptr ss:[esp]
  236.       lea   eax, _STR_spFLOAT
  237.       push  eax
  238.       push  edi
  239.       call  crt_sprintf
  240.       add   esp, 10h
  241.  
  242.       pop   edi                         ;restore strbuf pointer
  243.  
  244.       sub   esp, 20h                    ;fuck that
  245.       mov   dword ptr ss:[esp+1Ch], edi ;fuck that
  246.       lea   edi, dword ptr ss:[esp+1Ch] ;fuck that
  247.       mov   dword ptr ss:[esp+8], esp   ;fuck that
  248.       mov   edi, esp                    ;fuck that
  249.  
  250.       lea   eax, float_003
  251.       push  eax                         ;size
  252.       push  edi                         ;strbuf
  253.       push  dword ptr ss:[esp+100h+0Ch+20h]  ;tagtext
  254.       lea   edi, _STR_w3WTF1
  255.       lea   esi, _WT_v
  256.       call  pGame_jSetTextTagText
  257.       add   esp, 0Ch
  258.  
  259.       add   esp, 20h                    ;restore the stack
  260.  
  261.       add   esp, 100h                   ;restore the st
  262.     ;
  263.       lea   eax, float_0
  264.       push  eax                         ;zOffset
  265.       push  dword ptr ss:[esp+4h]       ;hUnit
  266.       push  dword ptr ss:[esp+0Ch]      ;tagtext
  267.       lea   esi, _WT_v
  268.       call  pGame_jSetTextTagPosUnit
  269.       add   esp, 10h
  270.  
  271.       push  0FFh
  272.       push  0
  273.       push  0
  274.       push  0FFh
  275.       push  dword ptr ss:[esp+10h]
  276.       lea   esi, _WT_v
  277.       call  pGame_jSetTextTagColor
  278.       add   esp, 14h
  279.  
  280.       lea   eax, float_05
  281.       push  eax                         ;float1
  282.       push  eax                         ;float2
  283.       push  dword ptr ss:[esp+8h]       ;tagtext
  284.       lea   esi, _WT_v
  285.       call  pGame_jSetTextTagVelocity
  286.       add   esp, 0Ch
  287.  
  288.       lea   eax, float_1
  289.       push  eax                         ;float1
  290.       push  dword ptr ss:[esp+4h]       ;tagtext
  291.       lea   esi, _WT_v
  292.       call  pGame_jSetTextTagFadepoint
  293.       add   esp, 8h
  294.  
  295.       lea   eax, float_2
  296.       push  eax                         ;float1
  297.       push  dword ptr ss:[esp+4h]       ;tagtext
  298.       lea   esi, _WT_v
  299.       call  pGame_jSetTextTagLifespan
  300.       add   esp, 8h
  301.  
  302.       push  0                           ;false
  303.       push  dword ptr ss:[esp+4h]       ;tagtext
  304.       lea   esi, _WT_v
  305.       call  pGame_jSetTextTagPermanent
  306.       add   esp, 8h
  307.  
  308.       push  0                           ;false
  309.       push  dword ptr ss:[esp+4h]       ;texttag
  310.       lea   esi, _WT_v
  311.       call  pGame_jSetTextTagVisibility
  312.       add   esp, 8h
  313.  
  314.       push  1                           ;true
  315.       push  dword ptr ss:[esp+4h]       ;texttag
  316.       lea   esi, _WT_v
  317.       call  pGame_jSetTextTagVisibility
  318.       add   esp, 8h
  319.  
  320.       push  0                           ;false
  321.       push  dword ptr ss:[esp+4h]       ;texttag
  322.       lea   esi, _WT_v
  323.       call  pGame_jSetTextTagSuspended
  324.       add   esp, 8h
  325.            
  326.       add   esp, 8h
  327.      
  328.       popad                             ;restore registers
  329.  
  330.       mov   eax, dword ptr ds:[eax+30h]
  331.       ret      
  332.  
  333. jGetDamageEvent endp
  334.  
  335. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««