-
-
[原创]shoooo第一轮第一题答案
-
发表于:
2007-8-23 14:25
19554
-
shoooo
838405472332423720261026354715956758738482324289317921799389786304955753823247004600360577050547786394427232991199118963196873841547633292371026202615473595575883845232728921793179738998639495675342328700360046055705254768630442423229118911996399689384054773324237
pediy
6050595875347004126102683845289996878633442991141792174775347062595054793371021460036531442997988687384028921219911844783371605159557537700312620266384728989688863944239113179317457536706159515476337402136004653944219797868838452898121891194476337360505956753470061261026738452890968786304429911717921746753470635950547733710216600365304429979986873846289212139118447733716052595575357003126402663846289896898639442091131796174575357061595254763372021360066539442097978689384528931218911
#include <windows.h>
#include <stdio.h>
BYTE status[] = {0, //第一个不用
0, 0, 1, 1, 0, 0, 0, 1, 1};
char name[] = "shoooo";
DWORD hash;
BYTE key[0x1000] = {0};
DWORD keyindex = 0;
void __declspec(naked) GetHash()
{
__asm
{
pushad
mov ebp, offset name
mov ebx, 0x13572468
start:
movzx eax, byte ptr [ebp]
test eax, eax
je end
inc ebp
add eax,ebx
imul eax,eax,0x3721273
add eax,0x24681357
mov esi,eax
shl esi,0x19
sar eax,7
or esi,eax
mov ebx,esi
jmp start
end:
mov hash, ebx
popad
retn
}
}
void SetStatus()
{
DWORD i;
for (i=1; i<9; i++)
{
status[i] = (hash>>i) & 1;
}
status[9] = 1;
}
void turn(DWORD index)
{
DWORD i;
if (index == 1)
{
status[1] ^= 1;
}
else if (index == 2)
{
if (status[1] == 0)
turn(1);
status[2] ^= 1;
}
else if (index>=3 && index <=9)
{
if (status[index-1] == 0)
turn(index-1);
for (i=index-2;i>=1;i--)
if (status[i] == 1)
turn(i);
status[index] ^= 1;
}
key[keyindex++] = index;
}
void main()
{
GetHash();
SetStatus();
DWORD i;
for (i=9; i>=1; i--)
{
if (status[i] == 1)
turn (i);
}
DWORD tmp;
for (i=0; i<keyindex; i++)
{
tmp = hash;
tmp = tmp>>(i%0x1F);
tmp = tmp %10;
if (key[i] < tmp)
key[i] += 10;
key[i] = key[i]-tmp+0x30;
}
printf("%s\n", key);
}
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)