Skip to content

Commit 1a272c2

Browse files
committed
upd
1 parent 41cdb40 commit 1a272c2

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

os/win/x86/inmem/ax.asm

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2828
; POSSIBILITY OF SUCH DAMAGE.
2929
;
30-
; In-Memory execution of VBScript/JScript using 395 bytes of x86 assembly
30+
; In-Memory execution of VBScript/JScript using 392 bytes of x86 assembly
3131
; Odzhan
3232

3333
%include "ax.inc"
@@ -268,31 +268,29 @@ init_api:
268268
stosd ; vft.OnEnterScript = (LPVOID)OnEnterScript;
269269
stosd ; vft.OnLeaveScript = (LPVOID)OnLeaveScript;
270270
pop eax ; eax = &vft
271-
mov ebp, edi ; ebp = &IMyActiveScriptSite
272-
stosd ; IActiveScriptSite.lpVtbl = &vft
273-
xor eax, eax
274-
stosd ; IActiveScriptSiteWindow.lpVtbl = NULL
275271
276272
; 6. Set script site
277273
; engine->lpVtbl->SetScriptSite(
278274
; engine, (IActiveScriptSite *)&mas);
279-
push ebp ; &IMyActiveScriptSite
275+
push edi ; &IMyActiveScriptSite
276+
stosd ; IActiveScriptSite.lpVtbl = &vft
277+
xor eax, eax
278+
stosd ; IActiveScriptSiteWindow.lpVtbl = NULL
280279
push esi ; engine
281280
mov eax, [esi]
282281
call dword[eax + IActiveScriptVtbl.SetScriptSite]
283282

284283
; 7. Parse our script
285284
; parser->lpVtbl->ParseScriptText(
286285
; parser, cs, 0, 0, 0, 0, 0, 0, 0, 0);
287-
mov ebp, esp
288-
cdq
286+
mov edx, esp
289287
push 8
290288
pop ecx
291289
init_parse:
292-
push edx
290+
push eax ; 0
293291
loop init_parse
294-
push ebp
295-
push ebx
292+
push edx ; script
293+
push ebx ; parser
296294
mov eax, [ebx]
297295
call dword[eax + IActiveScriptParse32Vtbl.ParseScriptText]
298296

os/win/x86/inmem/ax_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ int main(int argc, char *argv[]) {
244244
printf("Unable to read file.\n");
245245
return 0;
246246
}
247-
run_script(lang, script);
247+
run_scriptx(script);
248248
return 0;
249249
}
250250

0 commit comments

Comments
 (0)