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
GoldNugget
ultra-n00b
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.

Thanks,

GoldNugget

User avatar
asmxtx
veteran
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_xor2=0a5h
wrs_mark3	textequ<"3SRW">
wrs_xor3=0b5h

;Dateiaufbau:
;wrs_mark
;for_each_file
; tbl_entry
; file_data	;LZSS-komprimiert
;endfor



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
	.else
		cmp dword ptr dat,wrs_mark3
		jnz nokng
	.endif
	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
			.repeat
				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
	.endw
	ret

bagsim endp

Post Reply