Jump to content

Script Guru Question


Halstrom

Recommended Posts

I found this Library Thingy in NewVegas GECKPower up that allows the GECK to direct edit esm files so we don't have to do the renaming hokey pokey anymore to edit ESMs

 

What are the chances anyone smart enough to understand it could port this to work for the CK?

;The G.E.C.K. PowerUp for New Vegas - Part of the library
;Activate ESM file possible
;File version 0.1.2 (ported from formlisteditor-dblclk.asm version 0.1.2)
;Written by Fedor Uvarov, 2010
;Patched to support G.E.C.K 1.4 and activating ESM by H. LE PORS ( 08 December 2011)

PATCH_ACTIVATEESM_OFFSET = 00430F07h
PATCH_ACTIVATEESM_END	 = 00430F10h
PATCH_ACTIVATEESM_LENGTH = PATCH_ACTIVATEESM_END - PATCH_ACTIVATEESM_OFFSET

PATCH_COUNTESM_OFFSET = 004CF429h
PATCH_COUNTESM_END    = 004CF432h
PATCH_COUNTESM_LENGTH = PATCH_COUNTESM_END - PATCH_COUNTESM_OFFSET

PATCH_CRASH_OFFSET = 0042CD31h
PATCH_CRASH_END    = 0042CD39h
PATCH_CRASH_RETURN = 0042CD6Dh
PATCH_CRASH_LENGTH = PATCH_CRASH_END - PATCH_CRASH_OFFSET

PATCH_FORMID_OFFSET = 004DF7D8h ;       004DF8E4h
PATCH_FORMID_LENGTH = 2

macro ACTIVATEESM_PATCHES {
	;  stdcall PatchWithNops, PATCH_ACTIVATEESM_OFFSET, PATCH_ACTIVATEESM_LENGTH
	;  call RestoreMemProtection
	stdcall PatchWithNops, PATCH_CRASH_OFFSET, PATCH_CRASH_LENGTH
	call RestoreMemProtection
}

macro CRASH_DATA {
	AddrOf_Callback_Crash dd ?
}

macro CRASH_PATCHES {
	stdcall PatchWithNops, PATCH_ACTIVATEESM_OFFSET, PATCH_ACTIVATEESM_LENGTH
	call RestoreMemProtection
	stdcall PatchWithNops, PATCH_COUNTESM_OFFSET, PATCH_COUNTESM_LENGTH
	call RestoreMemProtection
	stdcall PatchWithNops, PATCH_FORMID_OFFSET, PATCH_FORMID_LENGTH
	call RestoreMemProtection

	stdcall MakeMemWriteable, PATCH_CRASH_OFFSET, PATCH_CRASH_LENGTH
	mov [AddrOf_Callback_Crash], Callback_Crash
	;mov     esi, [ecx+110h] -> mov esi, dword ptr ds:[AddrOf_Callback_Crash]
	mov [PATCH_CRASH_OFFSET  ], WORD 0358Bh       ;   8B 35 C7 13 40 00
	mov [PATCH_CRASH_OFFSET+2], DWORD AddrOf_Callback_Crash
	;xor al, al -> call esi
	mov [PATCH_CRASH_OFFSET+6], WORD 0D6FFh
	call RestoreMemProtection
}

macro CRASH_CALLBACKS {
	Callback_Crash:
	test ecx, ecx
	jnz .run_normally
	
	;This is how we quit if nothing was selected
	xor al, al
	mov [esp], DWORD PATCH_CRASH_RETURN
	ret

	;       mov esi, DWORD [AddrOf_Callback_Crash]
	;       call esi

	.run_normally:
	mov	esi, [ecx+110h] ;Copied from original
	mov edx, DWORD [eax]	;Copied from original
	mov [esp], DWORD PATCH_CRASH_OFFSET + PATCH_CRASH_LENGTH
	ret
}

 

activateesm.asm

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use