mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-10 17:49:32 +08:00
make style
This commit is contained in:
parent
4b41e36d49
commit
eafeb47126
6 changed files with 16 additions and 16 deletions
|
@ -94,4 +94,4 @@ void free_command_line(CMD *cmd) {
|
||||||
free(cmd->cmd);
|
free(cmd->cmd);
|
||||||
LOGD("释放结构体内存");
|
LOGD("释放结构体内存");
|
||||||
free(cmd);
|
free(cmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,4 +37,4 @@ CMD *parse_command_line(const char *commandStr);
|
||||||
//解析结果释放函数!
|
//解析结果释放函数!
|
||||||
void free_command_line(CMD *);
|
void free_command_line(CMD *);
|
||||||
|
|
||||||
#endif //DXL_TOOLS_H
|
#endif //DXL_TOOLS_H
|
||||||
|
|
|
@ -95,7 +95,7 @@ jint sendCMD(JNIEnv *env, jobject instance, jstring cmd_) {
|
||||||
}
|
}
|
||||||
//无论如何,新的命令的输入了,就要换个行!
|
//无论如何,新的命令的输入了,就要换个行!
|
||||||
PrintAndLogEx(NORMAL, "\n");
|
PrintAndLogEx(NORMAL, "\n");
|
||||||
char *cmd = (char *) ((*env)->GetStringUTFChars(env, cmd_, 0));
|
char *cmd = (char *)((*env)->GetStringUTFChars(env, cmd_, 0));
|
||||||
// Many parts of the PM3 client will assume that they can read any write from pwd. So we set
|
// Many parts of the PM3 client will assume that they can read any write from pwd. So we set
|
||||||
// pwd to whatever the PM3 "executable directory" is, to get consistent behaviour.
|
// pwd to whatever the PM3 "executable directory" is, to get consistent behaviour.
|
||||||
/*int ret = chdir(get_my_executable_directory());
|
/*int ret = chdir(get_my_executable_directory());
|
||||||
|
@ -120,7 +120,7 @@ jint sendCMD(JNIEnv *env, jobject instance, jstring cmd_) {
|
||||||
* 是否在执行命令
|
* 是否在执行命令
|
||||||
* */
|
* */
|
||||||
jboolean isExecuting(JNIEnv *env, jobject instance) {
|
jboolean isExecuting(JNIEnv *env, jobject instance) {
|
||||||
return (jboolean) ((jboolean) conn.run);
|
return (jboolean)((jboolean) conn.run);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -133,7 +133,7 @@ jboolean testPm3(JNIEnv *env, jobject instance) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool ret2 = TestProxmark() == PM3_SUCCESS;
|
bool ret2 = TestProxmark() == PM3_SUCCESS;
|
||||||
return (jboolean) (ret1 && ret2);
|
return (jboolean)(ret1 && ret2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopPm3(JNIEnv *env, jobject instance) {
|
void stopPm3(JNIEnv *env, jobject instance) {
|
||||||
|
@ -152,21 +152,21 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||||
}
|
}
|
||||||
jclass clz_test = (*jniEnv)->FindClass(jniEnv, "cn/rrg/devices/Proxmark3RRGRdv4");
|
jclass clz_test = (*jniEnv)->FindClass(jniEnv, "cn/rrg/devices/Proxmark3RRGRdv4");
|
||||||
JNINativeMethod methods[] = {
|
JNINativeMethod methods[] = {
|
||||||
{"startExecute", "(Ljava/lang/String;)I", (void *) sendCMD},
|
{"startExecute", "(Ljava/lang/String;)I", (void *) sendCMD},
|
||||||
{"stopExecute", "()V", (void *) stopPm3},
|
{"stopExecute", "()V", (void *) stopPm3},
|
||||||
{"isExecuting", "()Z", (void *) isExecuting}
|
{"isExecuting", "()Z", (void *) isExecuting}
|
||||||
};
|
};
|
||||||
JNINativeMethod methods1[] = {
|
JNINativeMethod methods1[] = {
|
||||||
{"testPm3", "()Z", (void *) testPm3},
|
{"testPm3", "()Z", (void *) testPm3},
|
||||||
{"closePm3", "()V", stopPm3}
|
{"closePm3", "()V", stopPm3}
|
||||||
};
|
};
|
||||||
if ((*jniEnv)->RegisterNatives(jniEnv, clazz, methods, sizeof(methods) / sizeof(methods[0])) !=
|
if ((*jniEnv)->RegisterNatives(jniEnv, clazz, methods, sizeof(methods) / sizeof(methods[0])) !=
|
||||||
JNI_OK) {
|
JNI_OK) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((*jniEnv)->RegisterNatives(jniEnv, clz_test, methods1,
|
if ((*jniEnv)->RegisterNatives(jniEnv, clz_test, methods1,
|
||||||
sizeof(methods1) / sizeof(methods1[0])) !=
|
sizeof(methods1) / sizeof(methods1[0])) !=
|
||||||
JNI_OK) {
|
JNI_OK) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
(*jniEnv)->DeleteLocalRef(jniEnv, clazz);
|
(*jniEnv)->DeleteLocalRef(jniEnv, clazz);
|
||||||
|
|
|
@ -950,8 +950,8 @@ static int CmdHFMFPWrbl(const char *Cmd) {
|
||||||
#define MAX_KEYS_LIST_LEN 1024
|
#define MAX_KEYS_LIST_LEN 1024
|
||||||
|
|
||||||
static int MFPKeyCheck(uint8_t startSector, uint8_t endSector, uint8_t startKeyAB, uint8_t endKeyAB,
|
static int MFPKeyCheck(uint8_t startSector, uint8_t endSector, uint8_t startKeyAB, uint8_t endKeyAB,
|
||||||
uint8_t keyList[MAX_KEYS_LIST_LEN][AES_KEY_LEN], size_t keyListLen, uint8_t foundKeys[2][64][AES_KEY_LEN + 1],
|
uint8_t keyList[MAX_KEYS_LIST_LEN][AES_KEY_LEN], size_t keyListLen, uint8_t foundKeys[2][64][AES_KEY_LEN + 1],
|
||||||
bool verbose) {
|
bool verbose) {
|
||||||
int res;
|
int res;
|
||||||
bool selectCard = true;
|
bool selectCard = true;
|
||||||
uint8_t keyn[2] = {0};
|
uint8_t keyn[2] = {0};
|
||||||
|
|
|
@ -184,7 +184,7 @@ serial_port uart_open(const char *pcPortName, uint32_t speed) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memcmp(prefix, "bt:", 3) == 0) {
|
if (memcmp(prefix, "bt:", 3) == 0) {
|
||||||
free(prefix);
|
free(prefix);
|
||||||
|
|
||||||
#ifdef HAVE_BLUEZ
|
#ifdef HAVE_BLUEZ
|
||||||
if (strlen(pcPortName) != 20) {
|
if (strlen(pcPortName) != 20) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ void crc32_ex(const uint8_t *data, const size_t len, uint8_t *crc) {
|
||||||
crc32_byte(&desfire_crc, data[i]);
|
crc32_byte(&desfire_crc, data[i]);
|
||||||
}
|
}
|
||||||
uint32_t crctmp = htole32(desfire_crc);
|
uint32_t crctmp = htole32(desfire_crc);
|
||||||
for (size_t i=0; i < sizeof(uint32_t); i++) {
|
for (size_t i = 0; i < sizeof(uint32_t); i++) {
|
||||||
crc[i] = ((uint8_t *) &crctmp)[i];
|
crc[i] = ((uint8_t *) &crctmp)[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue