I am Not Sure What Your Intent is if you mean you have to add a function and call it before main after the source is compiled then yes it is definitely possible all you have to do is run through some hoops like finding a code cave , assembling the new code in code cave , and detouring the first instruction of main to call the your function and return back to mains next instruction if you mean i want the function to be sequential then it might be possible if you can destroy and recreate the assembly inplace (kinda tough ) and no there is no label you need to calculate relative address / absolute address of the newly added function and use one form of e8 or ff25 call having source can help you in understanding the assembly but you have to play in assembly only if you have to patch a compiled executable a program prior to addition of encrypt proc will look like this (a simple msgbox in windows notice both caption and text are pointing to a string which is unintelligible) [![enter image description here][1]][1] you may need to implement the commented out src code inline for decrypting .386 .model flat, stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc includelib kernel32.lib include \masm32\include\user32.inc includelib user32.lib .data Encrypted db 217,243,234,245,252,249,255,254,183,227,176,228,229 db 228,255,226,249,241,252,176,254,255,190,162,144 .code start: ;call decrypt call hello invoke ExitProcess,NULL ; decrypt proc ; xor ecx,ecx ; complete: ; lea esi , Encrypted ; add esi,ecx ; movzx eax , byte ptr ds:[esi] ; xor eax ,090h ; mov byte ptr ds:[Encrypted + ecx], al ; add ecx,1 ; cmp byte ptr ds:[Encrypted + ecx - 1 ],0 ; jne complete ; ret ; decrypt endp hello proc invoke MessageBox, NULL,addr Encrypted, addr Encrypted, MB_OK ret hello endp end start [1]: https://i.sstatic.net/it6Kp.jpg