System SimCache (Game Cache without cache's)

Romek

Super Moderator
Reaction score
963
JASS:
//
        local $HANDLE$ def = $DEF$
        set $HANDLE$_val[S2ID(missionKey + "$|#%&" + key)] = def

Could become:
JASS:
        set $HANDLE$_val[S2ID(missionKey + "$|#%&" + key)] = $DEF$


> though I may have someone that will do it for me.
Ok.
 
Reaction score
341
JASS:
//
        local $HANDLE$ def = $DEF$
        set $HANDLE$_val[S2ID(missionKey + "$|#%&" + key)] = def

Could become:
JASS:
        set $HANDLE$_val[S2ID(missionKey + "$|#%&" + key)] = $DEF$

For some reason it doesn't parse the text macro, so I was forced to add the local.

You can try for yourself if you want, maybe theres something wrong with my JassHelper.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> I fail to see how handle count would affect this system.

Arrays aren't unlimited in size.
While that may not be a problem for your map, it might just be one on a general purpose system that's supposed to run everywhere, under all conditions.

> this system doesn't even contain H2I

What do you think S2ID is doing?


I see no use for this.
If you feel the need to hash strings, use a gamecache. It's already there and known to work.
It also has no size limits.

And before this goes anywhere other than the usual graveyard, I'd like to see some solid proof that string handles are stable. Preferably very stable.
 

Romek

Super Moderator
Reaction score
963
> While that may not be a problem for your map, it might just be one on a general purpose system that's supposed to run everywhere, under all conditions.
Handle count doesn't affect strings in any way.
Nor do strings affect the handle count.

Then again: "What do you think S2ID is doing?"
Is pretty similar to H2I, except that it's affected by the string count.

And it didn't cross my mind that there wasn't a way to destroy strings. :p
So this system is indeed much less safe than I had thought it was.
 

Vestras

Retired
Reaction score
248
Why would anyone use this? H2I + substraction will always be faster than this, and when speed is not needed, gamecache is, and will always be, surpreme.

So TimerUtils > this @ speed and gamecache > this @ everything else.
 
Reaction score
341
Tested by Artificial using the Benchmark Natives.
Code:
 time taken (microseconds)
Control:
    0.51165 

GC Set:
    3.40705 
SC Set:
    5.22236

GC Get:
    3.43738 
SC Get:
    4.83100

GC Get (not stored):
    2.65753 
SC Get (not stored):
    4.86905

GC Flush:
    3.03719 
SC Flush:
    4.80044
 

Strilanc

Veteran Scripter
Reaction score
42
> Gamecache isn't actually slow, it seems.
Well, I doubt Blizzard would just make it slower for the sake of making it slow.
It's fast enough to be usable, and it's still the safest one out there.

A modified map can inject any values it wants into game cache. Game cache is the *least* safe.

*edit* Yes, the values are injected to all players' cache. Not just the player with the modified map.
 

Romek

Super Moderator
Reaction score
963
> A modified map can inject any values it wants into game cache. Game cache is the *least* safe.
That was never exploited much anyway. And I believe that exploit has been fixed now anyway.
 
Reaction score
341
> A modified map can inject any values it wants into game cache. Game cache is the *least* safe.
That was never exploited much anyway. And I believe that exploit has been fixed now anyway.

I think griffen still did it even after the patch.
 

Jesus4Lyf

Good Idea™
Reaction score
397
So this SimCache is slow anyway, huh? Thought so. It doesn't inline, and has string concatenation overhead.
I think Table-X was actually the same speed as gamecache in the end, and included the full functionality, I believe (except of course storing values between maps).

I don't expect the gamecache exploit to ever be fully fixed, because in theory you can still memory hack the commands in. But since all you store in gamecache is structs anyway, you can't "modify" the values. However, on a spell that perhaps contains how much of an attribute it must remove after a time (maybe after adding it), you could make this point to an invalid struct so it doesn't remove it. So even when gamecache is used with structs, it's insecure. (Why do I hear it said that gamecache is safe?)

(Of course, I don't believe in H2I or gamecache so I never have any stability or security problems. On that note, I also no longer believe in S2ID. :))
 
Reaction score
341
So this SimCache is slow anyway, huh? Thought so. It doesn't inline, and has string concatenation overhead.
I think Table-X was actually the same speed as gamecache in the end, and included the full functionality, I believe.

I don't expect the gamecache exploit to ever be fully fixed, because in theory you can still memory hack the commands in. But since all you store in gamecache is structs anyway, you can't "modify" the values. However, on a spell that perhaps contains how much of an attribute it must remove after a time (maybe after adding it), you could make this point to an invalid struct so it doesn't remove it. So even when gamecache is used with structs, it's insecure. (Why are people saying gamecache is safe, again?)

(Of course, I don't believe in H2I or gamecache so I never have any stability or security problems. On that note, I also no longer believe in S2ID. :))

I'm guessing my older version is as fast.

But theres no real need to work on this anymore.
 

Strilanc

Veteran Scripter
Reaction score
42
> A modified map can inject any values it wants into game cache. Game cache is the *least* safe.
That was never exploited much anyway. And I believe that exploit has been fixed now anyway.

No, the easiest way to use a modified map was fixed. It is still trivial to do if you have any knowledge about how wc3 works under the hood. I could probably write something to do it in an hour, using a man-in-the-middle or something.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top