Last active
February 6, 2025 21:54
-
-
Save bartilyska/d7f525c067e284e71fac75b66f256d86 to your computer and use it in GitHub Desktop.
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
.686 | |
.XMM | |
.model flat | |
extern _GetComputerNameA@8 :PROC | |
.data | |
align 8 | |
a dq 01111222233334444h | |
.code | |
_salt PROC | |
push ebp | |
mov ebp,esp | |
sub esp,260 | |
push ebx | |
push esi | |
push edi | |
;mov 256 do [ebp-260] | |
;wskaznik był na | |
lea edi,[ebp-260] | |
mov [edi],dword ptr 256 | |
push edi | |
add edi,4 | |
push edi | |
call _GetComputerNameA@8 | |
; zwraca nazwe kompa do tego miejsca i wpisuje ilosc znakow | |
mov edi,[ebp-260];ilosc | |
mov al, byte ptr [ebp-258+edi] | |
movzx eax,al ;wyzeruj reszte gowna | |
;mamy znak w al | |
push eax | |
fild dword ptr [esp] | |
add esp,4 | |
fptan | |
fdiv | |
fabs | |
fld dword ptr [ebp+12] | |
fmul | |
push 256 | |
fild dword ptr [esp] | |
add esp,4 | |
fmul | |
push 100 | |
fild dword ptr [esp] | |
add esp,4 | |
fdiv | |
; dlugosc slowa | |
mov ecx,0 ;licznik | |
mov edx,[ebp+8];wskaznik na slowo | |
petla: | |
mov bx,[edx+2*ecx];wrzuca znak nastepny | |
inc ecx | |
cmp bx,0 | |
jne petla | |
dec ecx ; w ecx liczba znakow len | |
fstp qword ptr [esp] ; wrzuc te dziwne wyrazenie | |
mov eax,dword ptr[esp] | |
mov edx, dword ptr [esp+4]; tu jest 64-liczba do obracania | |
bt edx,31;pobierz do cf | |
petla2: | |
rcl eax,1 | |
rcl edx,1 ; chyba jest ok ;p | |
loop petla2 | |
pop edi | |
pop esi | |
pop ebx | |
mov esp,ebp | |
pop ebp | |
ret | |
_salt ENDP | |
_mul64 PROC | |
push ebp | |
mov ebp,esp | |
push ebx | |
push esi | |
push edi | |
mov eax,[ebp+8] | |
mov ebx,[ebp+16] | |
mul ebx;eax - edx | |
mov edi, eax;najmlodszaaaaa | |
mov ecx,edx | |
mov eax,[ebp+12] | |
mov ebx,[ebp+20] | |
mul ebx | |
mov esi,edx;najstarszaaaaa | |
mov ebx,eax | |
mov eax,[ebp+8] | |
mov edx,[ebp+20] | |
mul edx;eax - edx | |
add ecx,eax | |
adc ebx,edx | |
adc esi,0 | |
mov eax,[ebp+12] | |
mov edx,[ebp+16] | |
mul edx | |
add ecx,eax | |
adc ebx,edx | |
adc esi,0 | |
;esi-ebx-ecx-edi | |
push esi;[esp+12] | |
push ebx;[esp+8] | |
push ecx ;[esp+4] | |
push edi;[esp] | |
movups xmm0,[esp] | |
add esp,16 | |
pop edi | |
pop esi | |
pop ebx | |
mov esp,ebp | |
pop ebp | |
ret | |
_mul64 ENDP | |
_gen_xi PROC | |
push ebp | |
mov ebp,esp | |
push ebx | |
push esi | |
push edi | |
;c razy pomnozyc ta liczbe * a (stała) i wyciagnac mod 48 | |
mov edi,[ebp+12];ilosc wywolan rekurencyjnych | |
cmp edi,0 | |
je koniec | |
dec edi | |
mov ebx,[ebp+8];adres na structa | |
mov eax,[ebx];mlodsza | |
mov edx,[ebx+4];starsza | |
push dword ptr [a+4] | |
push dword ptr a | |
push edx | |
push eax | |
call _mul64 | |
;wynik poleci w miejsce parametrow ktore juz nie instnieja | |
movups [esp],xmm0 | |
mov eax,[esp] | |
mov edx,[esp+4] | |
and edx,0FFFFh | |
add esp,16;xmm juz useless | |
mov ebx,[ebp+8];adres structa wrzuc liczbe | |
mov [ebx],eax | |
mov [ebx+4],edx | |
push edi | |
push ebx;parametry | |
call _gen_xi | |
add esp,8 | |
koniec: | |
pop edi | |
pop esi | |
pop ebx | |
mov esp,ebp | |
pop ebp | |
ret | |
_gen_xi ENDP | |
END |
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
#include <stdio.h> | |
#include <xmmintrin.h> | |
long long salt(wchar_t* nazwa, float x); | |
__m128 mul64(long long a, long long b); | |
//__m128 mulinny(long long a, long long b); | |
typedef struct int48 | |
{ | |
long long x0; | |
}uint48; | |
void gen_xi(struct int48* x, int C); | |
int main() | |
{ | |
uint48 xi; | |
//long long int l = salt(L"Winiary", 21.37f); | |
xi.x0 = salt(L"Winiary", 21.37f); | |
xi.x0 = 0x666554443332; | |
__m128 m = mul64(66546757567565, 86575675675675677); | |
//__m128 d = mulinny(66546757567565, 86575675675675677); | |
printf("%lld", m); | |
gen_xi(&xi, 3); | |
return 0; | |
} |
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
print(hex(int("666554443332",16) * int("1111222233334444",16))) | |
print(hex(int("edb9a8ace148",16) * int("1111222233334444",16))) | |
print(hex(int("fd00f31af720",16) * int("1111222233334444",16))) |
Author
bartilyska
commented
Feb 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment