Get the code for a windows environment variables

Is seen from the pastbin.com, but I do not know who the author yes. 

 

ContractedBlock.gif ExpandedBlockStart.gif Code
 1#include <stdio.h>
 2
 3ExpandedBlockStart.gifContractedBlock.gifint getenv(char* ptr[]){
 4    while(*ptr) printf("%s\n"*ptr++);
 5    return 0;
 6}

 7
 8ExpandedBlockStart.gifContractedBlock.gifint __declspec(naked) __cdecl main(){
 9ExpandedSubBlockStart.gifContractedSubBlock.gif    _asm{
10        add esp, 0xc
11        mov edi, [esp]
12        add esp, -0xc
13        push edi
14        call getenv
15        pop edi
16        retn
17    }

18}

 

Reproduced in: https: //www.cnblogs.com/Stephen/archive/2009/05/06/1450343.html

Guess you like

Origin blog.csdn.net/weixin_33860553/article/details/93754637