File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 2828; POSSIBILITY OF SUCH DAMAGE.
2929;
3030
31- ; DLL loader in 309 bytes of x86 assembly (written for fun)
31+ ; DLL loader in 307 bytes of x86 assembly (written for fun)
3232; odzhan
3333
3434 %include "ds.inc"
@@ -64,12 +64,12 @@ init_api:
6464 pop esi ; esi = api hashes
6565 pushad ; allocate 32 bytes of memory for _ds
6666 mov edi , esp ; edi = _ds
67- push 3 ; resolve three api
67+ push TEB.ProcessEnvironmentBlock
6868 pop ecx
69+ cdq ; eax should be < 0x80000000
6970get_apis:
7071 lodsd ; eax = hash
7172 pushad
72- mov cl , TEB.ProcessEnvironmentBlock
7373 mov eax , [ fs : ecx ]
7474 mov eax , [ eax + PEB.Ldr ]
7575 mov edi , [ eax + PEB_LDR_DATA.InLoadOrderModuleList + LIST_ENTRY.Flink ]
@@ -125,8 +125,9 @@ hash_name:
125125 mov [ esp + _eax ], ebx
126126 popad ; restore all
127127 stosd
128- loop get_apis
129- mov cl , (MEM_RESERVE | MEM_COMMIT) >> 8
128+ inc edx
129+ jnp get_apis ; until PF = 1
130+
130131 ; dos = (PIMAGE_DOS_HEADER)ebx
131132 push ebx
132133 add ebx , [ ebx + IMAGE_DOS_HEADER.e_lfanew ]
You can’t perform that action at this time.
0 commit comments