How to crack (chinese net ease new flyff) cflyff wdf file?
I have used WdfRes_V1.1.24.exe to unpack wdf files, many bin files, how to find certain types (dds, o3d, chr, ani) map resources, etc.
Printable View
How to crack (chinese net ease new flyff) cflyff wdf file?
I have used WdfRes_V1.1.24.exe to unpack wdf files, many bin files, how to find certain types (dds, o3d, chr, ani) map resources, etc.
Each file goes through StringID to output a uid. If i remember I took the code from the official windsoul site.Code:/** @brief Chinese version of the game */
inline unsigned long string_id(const char* str)
{
static unsigned int m[70]{};
strncpy(reinterpret_cast<char*>(m), str, 256);
unsigned int i = 0;
for (; i < 256 / 4 && m[i]; ++i)
{
}
m[i++] = 0x9BE74448;
m[i++] = 0x66F42C48;
unsigned int v = 0xF4FA8928;
unsigned int edi = 0x7758B42B;
unsigned int esi = 0x37A8470E;
for (unsigned int ecx = 0; ecx < i; ++ecx)
{
unsigned int ebx = 0x267B0B11;
v = (v << 1) | (v >> 0x1F);
ebx ^= v;
unsigned int eax = m[ecx];
esi ^= eax;
edi ^= eax;
unsigned int edx = ebx;
edx += edi;
edx |= 0x02040801;
edx &= 0xBFEF7FDF;
long long num = edx;
num *= esi;
eax = static_cast<unsigned>(num);
edx = static_cast<unsigned>(num >> 0x20);
if (edx != 0)
eax++;
num = eax;
num += edx;
eax = static_cast<unsigned>(num);
if (static_cast<unsigned>(num >> 0x20) != 0)
eax++;
edx = ebx;
edx += esi;
edx |= 0x00804021;
edx &= 0x7DFEFBFF;
esi = eax;
num = edi;
num *= edx;
eax = static_cast<unsigned>(num);
edx = static_cast<unsigned>(num >> 0x20);
num = edx;
num += edx;
edx = static_cast<unsigned>(num);
if (static_cast<unsigned>(num >> 0x20) != 0)
eax++;
num = eax;
num += edx;
eax = static_cast<unsigned>(num);
if (static_cast<unsigned>(num >> 0x20) != 0)
eax += 2;
edi = eax;
}
esi ^= edi;
v = esi;
return v;
}
inline char* string_adjust(char* p)
{
for (int i = 0; p[i]; i++)
{
if (p[i] >= 'A' && p[i] <= 'Z')
p[i] += 'a' - 'A';
else if (p[i] == '/')
p[i] = '\\';
}
return p;
}
constexpr unsigned long long hdrSize = 12;
struct Hdr
{
unsigned long id = 1464092240; //'WDFP';
int fileNumber; // file count
unsigned int offset; // res start
};
struct Res
{
unsigned long uid;
unsigned long offset;
int size;
unsigned long space;
};
}
The original:
https://www.codingnow.com/windsoul/Code:
unsigned long string_id(const char *str)
{
int i;
unsigned int v;
static unsigned m[70];
strncpy((char *)m,str,256);
for (i=0;i<256/4 && m[i];i++) ;
m[i++]=0x9BE74448,m[i++]=0x66F42C48;
v=0xF4FA8928;
__asm {
mov esi,0x37A8470E ;x0=0x37A8470E
mov edi,0x7758B42B ;y0=0x7758B42B
xor ecx,ecx
_loop:
mov ebx,0x267B0B11 ;w=0x267B0B11
rol v,1
lea eax,m
xor ebx,v
mov eax,[eax+ecx*4]
mov edx,ebx
xor esi,eax
xor edi,eax
add edx,edi
or edx,0x2040801 ;a=0x2040801
and edx,0xBFEF7FDF ;c=0xBFEF7FDF
mov eax,esi
mul edx
adc eax,edx
mov edx,ebx
adc eax,0
add edx,esi
or edx,0x804021 ;b=0x804021
and edx,0x7DFEFBFF ;d=0x7DFEFBFF
mov esi,eax
mov eax,edi
mul edx
add edx,edx
adc eax,edx
jnc _skip
add eax,2
_skip:
inc ecx;
mov edi,eax
cmp ecx,i
jnz _loop
xor esi,edi
mov v,esi
}
return v;
}
static char *string_adjust(char *p)
{
int i;
for (i=0;p[i];i++) {
if (p[i]>='A' && p[i]<='Z') p[i]+='a'-'A';
else if (p[i]=='/') p[i]='\\';
}
return p;
}
Thanks for your reply, I don't know how to use this code, can you give an application example?
I only tested one file, output uid, what's next?
unsigned long test = string_id("3F3C8682.bin"); // 3072123180
- - - Updated - - -
Thanks for your reply, I don't know how to use this code, can you give an application example?
I only tested one file, output uid, what's next?
unsigned long test = string_id("3F3C8682.bin"); // 3072123180