section .data
LC0 db "Result: %ld", 0
section .bss
section .text
global func1
global main
func1:
sub rsp, 32
mov [rsp+12], edi
mov dword [rsp+24], 0
mov dword [rsp+28], 0
jmp .L2
.L3:
mov eax, [rsp+24]
add eax, 3
mov [rsp+24], eax
mov eax, [rsp+28]
add eax, 1
mov [rsp+28], eax
.L2:
mov ecx, [rsp+28]
mov eax, [rsp+12]
cmp ecx, eax
jb .L3
mov eax, [rsp+24]
add rsp, 32
ret
main:
sub rsp, 48
mov rax, [rsp+72] ; [rsp+16] + 8 = [rsp+72]
add rax, 8
mov rdi, [rax]
call atoi
call func1
mov [rsp+44], eax
lea rdi, [rel LC0]
mov esi, [rsp+44]
xor eax, eax
call printf
add rsp, 48
ret
The loop counters are initialized:
[rsp+24] = 0
[rsp+28] = 0
Iterations:
The loop continues to increment the counters until [rsp+28] reaches 4189673334.
In each iteration:
[rsp+24] is incremented by 3.
[rsp+28] is incremented by 1.
Number of Iterations:
The number of iterations is equal to 4189673334.
Values at the End of Iterations:
After 4189673334 iterations:
[rsp+24] = 3 * 4189673334
[rsp+28] = 4189673334
[rsp+24]=3×4189673334=12569020002
Conversion to 32-bit Hexadecimal
Since the final value is 12569020002, we need to convert this to a 32-bit hexadecimal number, considering overflow.
Limit the Value to 32 Bits:
12569020002mod4294967296=12569020002−2×4294967296=12569020002−8589934592=3989070710
Convert to Hexadecimal:
Convert 3989070710 to hexadecimal.
#python code nyam nyam
# Perform modulo operation
value = 12569020002
mod_value = value % (2**32)
hex_value = format(mod_value, '08x')
print(hex_value)
Result:
The result of 3989070710 in hexadecimal is:
3989070710 in hex=ed2c0662
So, the program prints the integer 12569020002 with the argument 4189673334, and converting this result to a 32-bit hexadecimal number (lowercase, no 0x prefix) is:
ed2c0662
ed2c0662
'호그와트' 카테고리의 다른 글
armadillo (0) | 2024.05.20 |
---|---|
finding the root (0) | 2024.05.19 |
crazy monster made by tryhackme GOD :: hero (0) | 2024.05.14 |
the dancing rabbit (0) | 2024.05.13 |
this is beauty (0) | 2024.05.13 |