Created
June 11, 2019 06:29
-
-
Save knowlet/12d170c11c870c3b98ad9b37735ddfc4 to your computer and use it in GitHub Desktop.
Fake Realtek apmib library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mips-linux-gnu-gcc -Wall -fPIC -shared apmib.c -o apmib-ld.so | |
#include<stdio.h> | |
#include<stdlib.h> | |
#define MIB_IP_ADDR 170 | |
#define MIB_HW_VER 0x250 | |
#define MIB_CAPTCHA 0x2C1 | |
int apmib_init(void) { | |
// Fake it! | |
return 1; | |
} | |
void apmib_get(int code, int *value) { | |
switch(code) { | |
case MIB_HW_VER: | |
*value = 0xF1; | |
break; | |
case MIB_IP_ADDR: | |
*value = 0x7F000001; | |
break; | |
case MIB_CAPTCHA: | |
*value = 1; | |
break; | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment