[API]
GetCurrentProcessId
OpenProcess
WriteProcessMemory
CloseHandle

[PATCH]
UIntAddUInt

[CODE]
Private Sub UIntAddUInt_Prepare(hProcess, ByVal InjectedProcAddress As Long)
  Dim xLongA1(4) As Long
  xLongA1(0) = &H424448B
  xLongA1(1) = &H674C009
  xLongA1(2) = &H8244C8B
  xLongA1(3) = &H8C20801
  'xLongA1(4) = &H0 ' byte!
  Call WriteProcessMemory(hProcess, ByVal InjectedProcAddress, ByVal VarPtr(xLongA1(0)), 17&, 0&)
  End Sub

' Works with max &hfffffffff for Value/ToAdd (and output Value)
Public Sub UIntAddUInt(ByRef Value As Long, ByVal ToAdd As Long)
  Dim xLong1 As Long
  
  xLong1 = (((Value And &HFF000000) \ &H1000000) And &HFF&) + (((ToAdd And &HFF000000) \ &H1000000) And &HFF&) '<- seperate highest 8 bits (1byte)
  Value = (Value And &HFFFFFF) + (ToAdd And &HFFFFFF) '<- add
  xLong1 = xLong1 + Value \ &H1000000 '<- add overflows to seperated higher 8 bits (1byte)
  Value = ((xLong1 And &H7F&) * &H1000000 + (Value And &HFFFFFF)) Or (&H80000000 * (xLong1 \ &H80&))
  '        re-add all but highest bit     / Values (w/o bits just filtered)
  '                                                                   Re-Adding highest bit
  'UIntAddUInt = Value
  End Sub
