mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-08 17:18:10 +08:00
6658905f18
It is identical to the popular 20081211, with the doob addition (20090301), a linux client, and two additional commands for LF analysis. Let me know if you find issues here!
53 lines
915 B
C
53 lines
915 B
C
//-----------------------------------------------------------------------------
|
|
// Utility functions used in many places, not specific to any piece of code.
|
|
// Jonathan Westhues, Sept 2005
|
|
//-----------------------------------------------------------------------------
|
|
#include <proxmark3.h>
|
|
#include "apps.h"
|
|
|
|
void *memcpy(void *dest, const void *src, int len)
|
|
{
|
|
BYTE *d = dest;
|
|
const BYTE *s = src;
|
|
while((len--) > 0) {
|
|
*d = *s;
|
|
d++;
|
|
s++;
|
|
}
|
|
return dest;
|
|
}
|
|
|
|
void *memset(void *dest, int c, int len)
|
|
{
|
|
BYTE *d = dest;
|
|
while((len--) > 0) {
|
|
*d = c;
|
|
d++;
|
|
}
|
|
return dest;
|
|
}
|
|
|
|
int memcmp(const void *av, const void *bv, int len)
|
|
{
|
|
const BYTE *a = av;
|
|
const BYTE *b = bv;
|
|
|
|
while((len--) > 0) {
|
|
if(*a != *b) {
|
|
return *a - *b;
|
|
}
|
|
a++;
|
|
b++;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
int strlen(char *str)
|
|
{
|
|
int l = 0;
|
|
while(*str) {
|
|
l++;
|
|
str++;
|
|
}
|
|
return l;
|
|
}
|