what is happening with this assembly language Function Code (00401000) Comment arg_0 = byte ptr 8 Parameter p

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

what is happening with this assembly language Function Code (00401000) Comment arg_0 = byte ptr 8 Parameter p

Post by answerhappygod »

what is happening with this assembly language
Function Code (00401000)
Comment
arg_0 =byte ptr 8
Parameter passed to function, one byte
push ebp
Function prolog
mov ebp, esp
Function prolog
movzx eax, [ebp+arg_0]
cmp eax, 61h
jl short loc_401034
movzx ecx, [ebp+arg_0]
cmp ecx, 7Ah
jg short loc_401034
movzx edx, [ebp+arg_0]
add edx, 0Dh
mov [ebp+arg_0], dl
movzx eax, [ebp+arg_0]
cmp eax, 7Ah
jle short loc_401032
movzx ecx, [ebp+arg_0]
sub ecx, 1Ah
mov [ebp+arg_0], cl
loc_401032:
jmp short loc_401063
loc_401034:
movzx edx, [ebp+arg_0]
cmp edx, 41h
jl short loc_401063
movzx eax, [ebp+arg_0]
cmp eax, 5Ah
jg short loc_401063
movzx ecx, [ebp+arg_0]
add ecx, 0Dh
mov [ebp+arg_0], cl
movzx eax, [ebp+arg_0]
cmp eax, 5Ah
jle short loc_401063
movzx eax, [ebp+arg_0]
sub eax, 1Ah
mov [ebp+arg_0], al
loc_401063:
mov al, [ebp+arg_0]
pop ebp
Function Epilog etc
main function 401070
Comments
var_28 = dword ptr -28h
var_24 = dword ptr -24h
var_20 = dword ptr -20h
var_4 = dword ptr -4
var_4 stores random number used for stack canary
push ebp
mov ebp, esp
Prolog
sub esp, 28h
Room on stack for local variables
mov eax, dword_413020
xor eax, ebp
Stores random value to be used for stack canary
push esi
push edi
mov ecx, 6
mov esi, offset aUggcJjj_onqthl
lea edi, [ebp+var_20]
repmovsd
movsw
movsb
mov [ebp+var_28], 0
mov [ebp+var_24], 0
mov [ebp+var_28], 1Bh
mov [ebp+var_24],0
jmp short loc_4010BB
loc_4010B2:
mov eax, [ebp+var_24
add eax,1
mov [ebp+var_24], eax
loc_4010BB
mov ecx, [ebp+var_24]
cmp ecx, [ebp+var_28]
jnb short loc_4010DD
mov edx, [ebp+var_24]
movzx eax, byte ptr [ebp+edx+var_20
push eax
call sub_401000
add esp,4
mov ecx, [ebp+var_24]
mov byte ptr [ebp+ecx+var_20], al
jmp short loc_4010B2
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply