1
0
Fork 0

Merge pull request #10 from mewpull/memset32

Implement memset32 and fix compilation errors for storm.h
pull/15/head
galaxyhaxz 2018-06-11 03:26:51 -05:00 committed by GitHub
commit 539e544563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 23 deletions

View File

@ -163,10 +163,10 @@ SNetGetPlayerName(
*
* Returns TRUE if the function was called successfully and FALSE otherwise.
*/
BOOL
STORMAPI
SNetGetProviderCaps(
PCAPS providerCaps);
//BOOL
//STORMAPI
//SNetGetProviderCaps(
// PCAPS providerCaps);
/* SNetGetTurnsInTransit @ 115
*
@ -306,14 +306,14 @@ typedef struct _storm_head
*
* Returns TRUE if the function was called successfully and FALSE otherwise.
*/
BOOL
STORMAPI
SNetInitializeProvider(
DWORD providerName,
client_info *gameClientInfo,
user_info *userData,
battle_info *bnCallbacks,
module_info *moduleData);
//BOOL
//STORMAPI
//SNetInitializeProvider(
// DWORD providerName,
// client_info *gameClientInfo,
// user_info *userData,
// battle_info *bnCallbacks,
// module_info *moduleData);
BOOL STORMAPI SNetJoinGame(int id, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid);
@ -354,7 +354,7 @@ typedef struct _s_evt
// @TODO: "type" is unknown.
HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(PS_EVT));
//HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(PS_EVT));
int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid);

14
defs.h
View File

@ -29,18 +29,12 @@
#ifndef IDA_GARBAGE
#define IDA_GARBAGE
// note to self: only works for x86, originally used this way by the devs
inline void memset32(void *s, unsigned int i, size_t n)
inline void memset32(void *s, unsigned int c, size_t n)
{
__asm {
mov ecx, n
mov eax, i
mov edi, s
rep stosd
unsigned int *p = (unsigned int *)s;
for (int i = 0; i < n; i++) {
p[i] = c;
}
//for(x = 0; x < n; x++)
// (DWORD)s[x] = i;
}
typedef __int64 ll;