I'm reversing some software and found the function which decrypts some stuff:
As you can see it has the password parameter for it which gets decrypted in this function.
Function disassembly:
sub_401350 proc near ; CODE XREF: sub_4013F0+28Ep
; sub_4013F0+2D2p
var_4 = dword ptr -4
arg_0 = dword ptr 8
arg_4 = dword ptr 0Ch
arg_8 = dword ptr 10h
arg_C = dword ptr 14h
arg_10 = byte ptr 18h
push ebp
mov ebp, esp
push ecx
mov [ebp+var_4], 0
jmp short loc_401366
loc_40135D: ; CODE XREF: sub_401350+46j
mov eax, [ebp+var_4]
add eax, 1
mov [ebp+var_4], eax
loc_401366: ; CODE XREF: sub_401350+Bj
mov ecx, [ebp+var_4]
cmp ecx, [ebp+arg_4]
jnb short loc_401398
mov edx, [ebp+arg_0]
add edx, [ebp+var_4]
movsx ecx, byte ptr [edx]
mov eax, [ebp+var_4]
xor edx, edx
div [ebp+arg_C]
mov eax, [ebp+arg_8]
movsx edx, byte ptr [eax+edx]
movzx eax, [ebp+arg_10]
add edx, eax
xor ecx, edx
mov edx, [ebp+arg_0]
add edx, [ebp+var_4]
mov [edx], cl
jmp short loc_40135D
.text:00401398
loc_401398: ; CODE XREF: sub_401350+1Cj
mov esp, ebp
pop ebp
retn 14h
sub_401350 endp
This function is called in some other places too. My goal is to call this function with some other parameters to decrypt other stuff and see the content.
How can I achieve this? how can I call this function with some other parameters using python or any other way? thanks.