mirror of
https://github.com/siemens-mobile-hacks/patches-src.git
synced 2026-11-25 22:27:17 +00:00
41 lines
960 B
C
41 lines
960 B
C
#ifdef S65_58
|
|
#include "S65_58.h"
|
|
#endif
|
|
#ifdef CX70_56
|
|
#include "CX70_56.h"
|
|
#endif
|
|
#ifdef CF75_23
|
|
#include "CF75_23.h"
|
|
#endif
|
|
#ifdef C72_22
|
|
#include "C72_22.h"
|
|
#endif
|
|
#ifdef C75_24
|
|
#include "C75_24.h"
|
|
#endif
|
|
|
|
#define _GBS_SendMessage ((void (*)(int cepid_to, int msg, ...))(ADDR_GBS_SendMessage))
|
|
|
|
#define _DisableNetwork ((void (*)())(ADDR_DisableNetwork))
|
|
|
|
__attribute__((section(".text.DisableNetwork")))
|
|
void DisableNetwork(void) {
|
|
_GBS_SendMessage(0x4058, 7, 0, 0, 0);
|
|
}
|
|
|
|
__attribute__((section(".text.EnableNetwork")))
|
|
void EnableNetwork(void) {
|
|
_GBS_SendMessage(0x4058, 8, 0, 0, 0);
|
|
}
|
|
|
|
#define GetUnk ((int (*)(void *, void *))(ADDR_GetUnk))
|
|
#define IsSIMAvailable ((int (*)())(ADDR_IsSIMAvailable))
|
|
|
|
__attribute__((target("thumb")))
|
|
__attribute__((section(".text.AutoDisableNetwork")))
|
|
int AutoDisableNetwork(void *r0, void *r1) {
|
|
if (!IsSIMAvailable()) {
|
|
_DisableNetwork();
|
|
}
|
|
return GetUnk(r0, r1);;
|
|
}
|