Join also our Discord channel! Click here.

repacking .wrs file

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
Posts: 1
Joined: Mon Nov 02, 2009 10:57 pm

repacking .wrs file

Post by GoldNugget » Tue Nov 03, 2009 7:25 am

Hello, Ive been messing with a game andfound a tool (Gobread) that unpacks the files in a .wrs file. what i was wondering i s if there was a way to repack it with edited files to see if it worked.



User avatar
Posts: 127
Joined: Sun Jun 08, 2008 10:32 pm
Location: Developers Country
Has thanked: 1 time
Been thanked: 30 times

Re: repacking .wrs file

Post by asmxtx » Mon Dec 14, 2009 9:00 pm

This is my 16-Bit-ASM-code of my "BaggerSimulator"-WRS-file-module.
You are on your own to analyze it.

Code: Select all

;Baggersimulator u.a., WRS-Dateien
;21.07.2008	Begonnen
;06.12.2008	LZSS-Dekompression hinzu

wrs_mark2	textequ<"2SRW">
wrs_mark3	textequ<"3SRW">

; tbl_entry
; file_data	;LZSS-komprimiert

wrs_struc	struct
	wrs_fname		db 20h dup(?)	;XOR 0B5h - gespeichert
	wrs_compsize	dd ?				;Big Endian
	wrs_uncompsize	dd ?				;Big Endian
wrs_struc ends

bagsim	proc
	mov cx,dword
	call read2
	.if dword ptr dat==wrs_mark2
		mov @@wrs_xor,wrs_xor2
		cmp dword ptr dat,wrs_mark3
		jnz nokng
	call do_info
	call lzss_init
	call datcopy_dozlib
	mov ebp,dword
	.while 1
		call point
		mov cx,size wrs_struc
		call read2			;Keine Ende-Kennung!
		.break .if ax!=cx
			mov si,dx
				xor byte ptr[si],wrs_xor3
	@@wrs_xor equ byte ptr $-1
				inc si
			.until byte ptr[si]==0
			mov cx,length wrs_fname
			call dircreate
			mov esi,dat.wrs_compsize
			lea edi,[ebp+size wrs_struc]
			bswap esi
			lea ebp,[edi+esi]
			.continue .if carry?
				push ds di
				lds di,databufptr2
				mov ds:[di].z_stream.z_reserved,esi	;Dateigröße setzen für LZSS
				pop di ds
				call datcopy

bagsim endp

Post Reply