Skip to content

Commit

Permalink
Added MAC Spoofer to WLAN Driver. (seplugins/mac.txt - ex. 00:11:22:A…
Browse files Browse the repository at this point in the history
…A:BB:CC)
  • Loading branch information
MrColdbird committed Jun 11, 2012
1 parent 88980eb commit 8b8701b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Recovery/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ enum {
RUSSIA,
CHINA,
DEBUG_TYPE_I,
DEBUG_TYPE_II,
DEBUG_TYPE_II,
RETAIL_HIGH_MEMORY,
MAC_SPOOFER,
MSG_END,
};

Expand Down
17 changes: 15 additions & 2 deletions Recovery/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,13 @@ static int display_retail_high_memory(struct MenuEntry* entry, char *buf, int si
return 0;
}

static int display_mac_spoofer(struct MenuEntry* entry, char *buf, int size)
{
sprintf(buf, "%-48s %-11s", g_messages[MAC_SPOOFER], get_bool_name(g_config.macspoofer));

return 0;
}

static struct ValueOption g_xmb_plugin_option = {
&g_config.plugvsh,
0, 2,
Expand Down Expand Up @@ -614,11 +621,16 @@ static struct ValueOption g_hide_cfw_dirs = {
&g_config.hide_cfw_dirs,
0, 2,
};


static struct ValueOption g_retail_high_memory = {
&g_config.retail_high_memory,
0, 2,
};
};

static struct ValueOption g_mac_spoofer = {
&g_config.macspoofer,
0, 2,
};

static struct MenuEntry g_advanced_menu_entries[] = {
{ -1, 0, 0, &display_xmb_plugin, &change_option, &change_option_by_enter, &g_xmb_plugin_option },
Expand All @@ -635,6 +647,7 @@ static struct MenuEntry g_advanced_menu_entries[] = {
{ -1, 0, 0, &display_iso_cache_number, &change_iso_cache_number_option, &change_iso_cache_number_option_by_enter, &g_iso_cache_number},
{ -1, 0, 0, &display_iso_cache_policy, &change_option, &change_option_by_enter, &g_iso_cache_policy},
{ -1, 0, 0, &display_retail_high_memory, &change_option, &change_option_by_enter, &g_retail_high_memory},
{ -1, 0, 0, &display_mac_spoofer, &change_option, &change_option_by_enter, &g_mac_spoofer},
};

static struct Menu g_advanced_menu = {
Expand Down
1 change: 1 addition & 0 deletions Recovery/trans_en.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const char * g_messages_en[] = {
"Debug Type I",
"Debug Type II",
"Force High Memory Layout",
"Use mac.txt in /seplugins",
};

u8 message_test_en[NELEMS(g_messages_en) == MSG_END ? 0 : -1];
1 change: 1 addition & 0 deletions SystemControl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ OBJS = main.o \
cpuclock.o \
fake_region.o \
msstor_cache.o \
libertas.o \
systemctrl_patch_offset.o \
../Common/libs.o \
../Common/utils.o \
Expand Down
2 changes: 2 additions & 0 deletions SystemControl/exports.exp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ PSP_EXPORT_FUNC(sctrlSESetDiscType)
PSP_EXPORT_FUNC(sctrlSEGetDiscType)
PSP_EXPORT_FUNC(sctrlKernelSetNidResolver)
PSP_EXPORT_FUNC(sctrlKernelRand)
PSP_EXPORT_FUNC(sctrlGetRealEthernetAddress)
PSP_EXPORT_END

PSP_EXPORT_START(SystemCtrlForKernel, 0, 0x0001)
Expand Down Expand Up @@ -132,6 +133,7 @@ PSP_EXPORT_FUNC_NID(sctrlGetInitTextAddr, 0x72F29A6E)
PSP_EXPORT_FUNC(sctrlSetCustomStartModule)
PSP_EXPORT_FUNC(sctrlKernelSetNidResolver)
PSP_EXPORT_FUNC(sctrlKernelRand)
PSP_EXPORT_FUNC(sctrlGetRealEthernetAddress)
PSP_EXPORT_END

PSP_EXPORT_START(SystemCtrlPrivate, 0, 0x0001)
Expand Down
3 changes: 2 additions & 1 deletion SystemControl/plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "printk.h"
#include "strsafe.h"
#include "rebootex_conf.h"
#include "libertas.h"

#define WAIT_MEMORY_STICK_TIMEOUT ( 2 * 1000000 )

Expand Down Expand Up @@ -317,7 +318,7 @@ int load_plugins(void)
load_plugin("ms0:/seplugins/pops.txt", WAIT_MEMORY_STICK_TIMEOUT);
}
}

//return success
return 0;
}
2 changes: 2 additions & 0 deletions SystemControl/syspatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "printk.h"
#include "libs.h"
#include "nid_resolver.h"
#include "libertas.h"
#include "systemctrl_patch_offset.h"

static STMOD_HANDLER previous;
Expand Down Expand Up @@ -196,6 +197,7 @@ static int syspatch_module_chain(SceModule2 *mod)

if(0 == strcmp(mod->modname, "sceWlan_Driver")) {
patch_sceWlan_Driver(mod->text_addr);
patch_Libertas_MAC(mod);
sync_cache();
goto exit;
}
Expand Down
9 changes: 9 additions & 0 deletions include/systemctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,13 @@ int sctrlKernelSetNidResolver(char *libname, u32 enabled);
*/
u32 sctrlKernelRand(void);

/**
* Get the real unspoofed Ethernet (MAC) Address of the systems WLAN chip
*
* @param mac Out-Buffer (6B) for real MAC Address
*
* @return 0 on success, < 0 on error
*/
int sctrlGetRealEthernetAddress(uint8_t * mac);

#endif
1 change: 1 addition & 0 deletions include/systemctrl_se.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ typedef struct _SEConfig
s16 usbversion;
s16 language; /* -1 as autodetect */
s16 retail_high_memory;
s16 macspoofer;
} SEConfig;

/**
Expand Down

0 comments on commit 8b8701b

Please sign in to comment.