Function at 0x401780
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x93c
mov eax, dword [0x41f008]
xor eax, esp
mov dword [esp + 0x938], eax
cmp dword [ebp + 8], 2
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
jge 0x4017b8
push str.Usage:_drag__drop_n
call fcn.00401050
add esp, 4
call fcn.004011f0
mov esi, dword [esi + 4]
test esi, esi
jne 0x4017d1
push str.File_arg_is_NULL__n
call fcn.00401050
add esp, 4
call fcn.004011f0
push 0x41ca24
lea eax, [esp + 0x428]
mov dword [esp + 0x428], 0
push esi
push eax
call fcn.004043d5
add esp, 0xc
test eax, eax
jne 0x401ec5
mov ebx, dword [esp + 0x424]
test ebx, ebx
je 0x401ec5
lea eax, [esp + 0x10]
mov ecx, ebx
push eax
call fcn.004012e0
mov esi, eax
lea edi, [esp + 0x53c]
mov ecx, 0x103
add esp, 4
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x778]
test eax, eax
je 0x401846
push eax
push str.Wrong_lump_version__i__n
call fcn.00401050
add esp, 8
call fcn.004011f0
push 0
push dword [esp + 0x774]
push ebx
call fcn.004047d3
add esp, 0xc
test eax, eax
je 0x401873
push str.header.lumps.fileofs
push str.Failed_file_seek__s_n
call fcn.00401050
add esp, 8
call fcn.004011f0
push ebx
push 1
lea eax, [esp + 0x438]
push 4
push eax
call fcn.00406179
add esp, 0x10
cmp eax, 1
jae 0x4018a4
push str.dgamelumpheader
push str.Failed_read__s__n
call fcn.00401050
add esp, 8
call fcn.004011f0
mov eax, dword [esp + 0x430]
cmp eax, 1
jge 0x4018c2
push str.Error_lump_header.lumpCount___1_n
call fcn.00401050
add esp, 4
call fcn.004011f0
xor esi, esi
test eax, eax
jle 0x4017b3
nop dword [eax]
lea eax, [esp + 0x438]
push eax
push ebx
call fcn.00405f38
add esp, 8
test eax, eax
jne 0x401eb3
push ebx
push 1
lea eax, [esp + 0x448]
push 0x10
push eax
call fcn.00406179
add esp, 0x10
cmp eax, 1
jb 0x401e9c
test byte [esp + 0x444], 1
jne 0x401e8a
cmp dword [esp + 0x440], 0x73707270
je 0x401931
inc esi
cmp esi, dword [esp + 0x430]
jl 0x4018d0
jmp 0x4017b3
cmp dword [esp + 0x43c], 0
jl 0x4017b3
jg 0x40194f
cmp dword [esp + 0x438], 0
jbe 0x4017b3
movzx edi, word [esp + 0x446]
lea eax, [edi - 4]
cmp eax, 6
ja case.0x40196a.8
movzx eax, byte [eax + 0x401ee4]
jmp dword [eax*4 + 0x401ed8]
push str._x__game_lump.version_already_valid_for_css_v34_n
call fcn.00401050
add esp, 4
call fcn.004011f0
mov eax, dword [esp + 0x448]
cdq
push 0
push eax
push ebx
mov dword [esp + 0x468], edx
call fcn.004047d3
add esp, 0xc
test eax, eax
je 0x4019b9
push str.game_lump.fileofs
push str.Failed_file_seek__s_n
call fcn.00401050
add esp, 8
call fcn.004011f0
push ebx
push 1
lea eax, [esp + 0x430]
mov dword [esp + 0x430], 0
push 4
push eax
call fcn.00406179
add esp, 0x10
cmp eax, 1
jae 0x4019f5
push str.UnserializeModelDict_count
push str.Failed_read__s__n
call fcn.00401050
add esp, 8
call fcn.004011f0
xor esi, esi
cmp dword [esp + 0x428], esi
jle 0x401a27
push ebx
push 1
lea eax, [esp + 0x4c0]
push 0x80
push eax
call fcn.00406179
add esp, 0x10
cmp eax, 1
jb 0x401a63
inc esi
cmp esi, dword [esp + 0x428]
jl 0x401a00
push ebx
push 1
lea eax, [esp + 0x438]
mov dword [esp + 0x438], 0
push 4
push eax
call fcn.00406179
add esp, 0x10
cmp eax, 1
jae 0x401a7a
push str.UnserializeLeafList_count
push str.Failed_read__s__n
call fcn.00401050
add esp, 8
call fcn.004011f0
push str.UnserializeModelDict_StaticPropDictLump
push str.Failed_read__s__n
call fcn.00401050
add esp, 8
call fcn.004011f0
xor esi, esi
cmp dword [esp + 0x430], esi
jle 0x401aa9
push ebx
push 1
lea eax, [esp + 0x430]
push 2
push eax
call fcn.00406179
add esp, 0x10
cmp eax, 1
jb 0x401ad0
inc esi
cmp esi, dword [esp + 0x430]
jl 0x401a85
lea eax, [esp + 0x450]
push eax
push ebx
call fcn.00405f38
add esp, 8
test eax, eax
je 0x401ae7
push str.Failed_get_UnserializeModels_pos__n
call fcn.00401050
add esp, 4
call fcn.004011f0
push str.UnserializeLeafList_StaticPropLeafLump
push str.Failed_read__s__n
call fcn.00401050
add esp, 8
call fcn.004011f0
mov edx, edi
mov ecx, ebx
call fcn.00401420
lea eax, [esp + 0x458]
push eax
push ebx
call fcn.00405f38
add esp, 8
test eax, eax
je 0x401b17
push str.Failed_get_UnserializeEnd_pos__n
call fcn.00401050
add esp, 4
call fcn.004011f0
push str.Map_ready_for_patch__n
call fcn.00401050
add esp, 4
push str.pause
call fcn.00405cab
add esp, 4
cmp byte [0x42048c], 0
jne 0x401e6c
movzx esi, word [esp + 0x446]
push 0
push dword [esp + 0x43c]
push ebx
call fcn.004047d3
add esp, 0xc
test eax, eax
je 0x401b73
push str.game_lump_version
push str.Failed_file_seek__s_n
call fcn.00401050
add esp, 8
call fcn.004011f0
cmp byte [0x42048c], 0
mov eax, 5
mov word [esp + 0x446], ax
jne 0x401bdb
push ebx
push 1
lea eax, [esp + 0x448]
push 0x10
push eax
call fcn.00405ed5
add esp, 0x10
cmp eax, 1
jae 0x401bd3
lea ecx, [esp + 0x4a0]
call fcn.00401210
lea ecx, [esp + 0x4a0]
call fcn.00401ef0
push eax
push str.dgamelump_version
push str.Failed_file_write__s___s__n
call fcn.00401050
add esp, 0xc
call fcn.004011f0
mov ax, word [esp + 0x446]
movzx eax, ax
push eax
push esi
push str._v__game_lump.version_patched_from__i_to__i_n
call fcn.00401050
mov ecx, dword [esp + 0x45c]
add esp, 0xc
add ecx, 4
push 0
push ecx
push ebx
call fcn.004047d3
add esp, 0xc
test eax, eax
je 0x401c1e
push str.UnserializeModels_pos
push str.Failed_file_seek__s_n
call fcn.00401050
add esp, 8
call fcn.004011f0
mov edi, dword [0x4204b8]
xor ecx, ecx
mov esi, dword [0x4204b4]
mov eax, 0x38e38e39
mov dword [esp + 0x428], ecx
mov ecx, edi
sub ecx, esi
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
test eax, eax
jle 0x401dbf
xor edi, edi
xorps xmm1, xmm1
nop word [eax + eax]
movq xmm0, qword [edi + esi]
movq qword [esp + 0x464], xmm0
mov eax, dword [edi + esi + 8]
mov dword [esp + 0x46c], eax
movq xmm0, qword [edi + esi + 0xc]
movq qword [esp + 0x470], xmm0
mov eax, dword [edi + esi + 0x14]
mov dword [esp + 0x478], eax
movzx eax, word [edi + esi + 0x18]
mov word [esp + 0x47c], ax
movzx eax, word [edi + esi + 0x1a]
mov word [esp + 0x47e], ax
movzx eax, word [edi + esi + 0x1c]
mov word [esp + 0x480], ax
mov al, byte [edi + esi + 0x1e]
mov byte [esp + 0x482], al
mov cl, byte [edi + esi + 0x40]
mov byte [esp + 0x483], cl
mov eax, dword [edi + esi + 0x20]
mov dword [esp + 0x484], eax
movss xmm2, dword [edi + esi + 0x24]
movss dword [esp + 0x488], xmm2
movss xmm3, dword [edi + esi + 0x28]
movss dword [esp + 0x48c], xmm3
movq xmm0, qword [edi + esi + 0x2c]
movq qword [esp + 0x490], xmm0
mov eax, dword [edi + esi + 0x34]
mov dword [esp + 0x498], eax
movss xmm0, dword [edi + esi + 0x38]
movss dword [esp + 0x49c], xmm0
test cl, 1
je 0x401d5a
ucomiss xmm2, xmm1
lahf
test ah, 0x44
jp 0x401d5a
mov esi, dword [esp + 0x428]
ucomiss xmm3, xmm1
lahf
test ah, 0x44
jp 0x401d61
and cl, 0xfe
push esi
push str.Found_corrupted_lump__i__fixed_n
mov byte [esp + 0x48b], cl
call fcn.00401050
add esp, 8
jmp 0x401d61
mov esi, dword [esp + 0x428]
push ebx
push 1
lea eax, [esp + 0x46c]
push 0x3c
push eax
call fcn.00405ed5
add esp, 0x10
cmp eax, 1
jb 0x401e0e
mov ecx, dword [0x4204b8]
inc esi
mov dword [esp + 0x428], esi
mov eax, 0x38e38e39
mov esi, dword [0x4204b4]
add edi, 0x48
sub ecx, esi
xorps xmm1, xmm1
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [esp + 0x428], eax
jl 0x401c60
mov edi, dword [0x4204b8]
sub edi, esi
mov eax, 0x38e38e39
imul edi
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
push eax
push str._v___i_StaticPropLump_patched_n
call fcn.00401050
mov eax, dword [0x4204b4]
mov dword [0x4204b8], eax
lea eax, [esp + 0x438]
push eax
push ebx
call fcn.00405f38
add esp, 0x10
test eax, eax
je 0x401e3e
push str.Failed_get_UnserializeEndNew_pos__n
call fcn.00401050
add esp, 4
call fcn.004011f0
lea ecx, [esp + 0x4a0]
call fcn.00401210
lea ecx, [esp + 0x4a0]
call fcn.00401ef0
push eax
push str.StaticPropLump
push str.Failed_file_write__s___s__n
call fcn.00401050
add esp, 0xc
call fcn.004011f0
push dword [esp + 0x43c]
mov eax, dword [esp + 0x45c]
lea edx, [esp + 0x444]
push dword [esp + 0x43c]
sub eax, dword [esp + 0x438]
mov ecx, ebx
push eax
call fcn.00401360
add esp, 0xc
push ebx
call fcn.00404493
jmp 0x4017b0
push edi
push str.Unsupport_map_format__i__Static_props_cant_be_loaded..._n
call fcn.00401050
add esp, 8
call fcn.004011f0
push str.Compression_unsupport__n
call fcn.00401050
add esp, 4
call fcn.004011f0
push str.dgamelump
push str.Failed_read__s__n
call fcn.00401050
add esp, 8
call fcn.004011f0
push str.Failed_get_lump_header_pos__n
call fcn.00401050
add esp, 4
call fcn.004011f0
push esi
push str.Could_not_open_file___ws__for_reading__n
call fcn.00401050
add esp, 8
call fcn.004011f0
jno 0x401ef3
inc eax
add byte [ebx + 0x77004019], al
push ds
inc eax
add byte [eax], al
add byte [ecx], al
add dword [edx], eax
add al, byte [ecx]
int3
adc byte [edx + 3], dh
mov eax, dword [ecx]
ret