Function at 0x404d60
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7a0
mov eax, dword [0x42f00c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x43060c]
push dword [0x42f8d0]
mov dword [0x42f964], eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x404db0
push str.Input_file_does_not_exist_n
call fcn.004010d0
add esp, 4
mov eax, 0x80004005
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push 3
push dword [0x42f8d0]
lea eax, [ebp - 0x5ec]
lea ecx, [ebp - 0x5f0]
mov dword [ebp - 0x5f0], eax
call fcn.00406120
push dword [ebp - 0x5f0]
lea eax, [ebp - 0x108]
push 0x104
push eax
call fcn.00415a6d
mov eax, dword [ebp - 0x5f0]
lea ecx, [ebp - 0x5ec]
add esp, 0xc
cmp eax, ecx
je 0x404e02
push eax
call fcn.0041571d
add esp, 4
lea ecx, [ebp - 0x108]
lea edx, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404e10
sub ecx, edx
lea edx, [ebp - 0x108]
movzx ecx, cx
push esi
movsx eax, cx
add edx, eax
mov dword [ebp - 0x788], edx
mov esi, edx
mov dword [ebp - 0x790], edx
push edi
mov edi, edx
test cx, cx
jle 0x404e7e
lea eax, [ebp + eax - 0x107]
mov dl, byte [eax - 1]
cmp dl, 0x2e
jne 0x404e5b
cmp byte [edi], 0
jne 0x404e6b
cmp byte [esi], 0
jne 0x404e6b
mov esi, eax
jmp 0x404e67
cmp dl, 0x5c
jne 0x404e6b
cmp byte [edi], 0
jne 0x404e6b
mov edi, eax
mov byte [eax - 1], 0
dec ecx
dec eax
test cx, cx
jg 0x404e45
mov edx, dword [ebp - 0x788]
mov dword [ebp - 0x790], edi
cmp byte [edi], 0
jne 0x404e91
lea edi, [ebp - 0x108]
mov dword [ebp - 0x790], edi
jmp 0x404ea6
lea ecx, [ebp - 0x108]
cmp edi, ecx
mov eax, ecx
cmove eax, edx
mov edx, eax
mov dword [ebp - 0x788], eax
mov ecx, 0x42bbeb
mov eax, edx
nop dword [eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x404ed0
test dl, dl
je 0x404ecc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x404ed0
add eax, 2
add ecx, 2
test dl, dl
jne 0x404eb0
xor eax, eax
jmp 0x404ed5
sbb eax, eax
or eax, 1
push esi
test eax, eax
lea eax, [ebp - 0x20c]
push edi
je 0x404f0b
mov esi, dword [ebp - 0x788]
push esi
push str._s_s._s
push eax
call fcn.004062e0
push edi
push esi
lea eax, [ebp - 0x310]
push str._s_s.prt
push eax
call fcn.004062e0
add esp, 0x24
jmp 0x404f2b
push str._s._s
push eax
call fcn.004062e0
push edi
lea eax, [ebp - 0x310]
push str._s.prt
push eax
call fcn.004062e0
add esp, 0x1c
lea eax, [ebp - 0x79c]
mov dword [ebp - 0x79c], 0
push eax
lea eax, [ebp - 0x56c]
push eax
lea eax, [ebp - 0x20c]
push eax
call fcn.00405a40
mov esi, eax
test esi, esi
jns 0x404f76
push str.Failed_to_load_mesh__n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
lea eax, [ebp - 0x66c]
mov dword [ebp - 0x670], eax
lea ecx, [ebp - 0x670]
push 3
lea eax, [ebp - 0x310]
push eax
call fcn.00405f80
push 0
push 0
push 2
push 0
push 2
push 0x40000000
push dword [ebp - 0x670]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp - 0x670]
mov esi, eax
lea eax, [ebp - 0x66c]
mov dword [ebp - 0x7a0], esi
cmp ecx, eax
je 0x404fd2
push ecx
call fcn.0041571d
add esp, 4
cmp esi, 0xffffffff
jne 0x405002
push str.Failed_to_create_output_file_n
call fcn.004010d0
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, 0x80004005
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
cmp dword [ebp - 0x79c], 0
mov dword [ebp - 0x798], 0
jbe 0x4058ed
lea eax, [ebp - 0x56c]
mov dword [ebp - 0x784], eax
nop word [eax + eax]
mov eax, dword [ebp - 0x788]
mov ecx, 0x42bbeb
nop dword [eax + eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x405060
test dl, dl
je 0x40505c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x405060
add eax, 2
add ecx, 2
test dl, dl
jne 0x405040
xor eax, eax
jmp 0x405065
sbb eax, eax
or eax, 1
mov esi, 5
sub esi, dword [ebp - 0x798]
test eax, eax
push esi
push edi
lea eax, [ebp - 0x414]
je 0x4050ab
push dword [ebp - 0x788]
push str._s_s__d.x
push eax
call fcn.004062e0
push esi
push edi
push dword [ebp - 0x788]
lea eax, [ebp - 0x518]
push str._s_s__d.dat
push eax
call fcn.004062e0
add esp, 0x28
jmp 0x4050cc
push str._s__d.x
push eax
call fcn.004062e0
push esi
push edi
lea eax, [ebp - 0x518]
push str._s__d.dat
push eax
call fcn.004062e0
add esp, 0x20
mov esi, dword [ebp - 0x784]
push 0x42f960
push 0
push 0
push 0
push dword [esi]
call dword [sym.imp.d3dx9_43.dll_D3DXCreatePRTEngine]
test eax, eax
js 0x405899
mov ecx, dword [0x42f960]
push 0
push ecx
mov dword [ebp - 0x780], 0
mov dword [ebp - 0x778], 0
mov dword [ebp - 0x77c], 0
mov eax, dword [ecx]
mov dword [esp], 0x3a83126f
push 0x405ee0
push ecx
call dword [eax + 0x80]
mov ecx, dword [0x42f960]
push ecx
mov dword [esp], 0
push 0
mov eax, dword [ecx]
push 1
push 0
push dword [0x42f8d4]
push ecx
call dword [eax + 0x3c]
movzx eax, byte [0x42f8e4]
mov dword [ebp - 0x540], eax
mov dword [ebp - 0x544], 0
test eax, eax
je 0x4051ab
mov eax, dword [0x42f8ec]
lea ecx, [eax*8]
sub ecx, eax
movss xmm0, dword [ecx*8 + 0x42c654]
movss dword [ebp - 0x53c], xmm0
movups xmm0, xmmword [ecx*8 + 0x42c644]
movups xmmword [ebp - 0x554], xmm0
movups xmm0, xmmword [ecx*8 + 0x42c634]
movups xmmword [ebp - 0x538], xmm0
movups xmm0, xmmword [ecx*8 + 0x42c624]
jmp 0x4051de
movups xmm0, xmmword [0x42f8f0]
movups xmmword [ebp - 0x554], xmm0
movss xmm0, dword [0x42f920]
movss dword [ebp - 0x53c], xmm0
movups xmm0, xmmword [0x42f900]
movups xmmword [ebp - 0x538], xmm0
movups xmm0, xmmword [0x42f910]
mov ecx, dword [esi]
lea edx, [ebp - 0x78c]
push edx
movups xmmword [ebp - 0x528], xmm0
mov dword [ebp - 0x78c], 1
mov eax, dword [ecx]
push 0
push ecx
call dword [eax + 0x4c]
mov eax, dword [ebp - 0x78c]
xor ecx, ecx
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00406d0d
mov edx, dword [ebp - 0x78c]
add esp, 4
xor ecx, ecx
mov esi, eax
test edx, edx
je 0x405244
nop dword [eax]
lea eax, [ebp - 0x554]
mov dword [esi + ecx*4], eax
inc ecx
mov edx, dword [ebp - 0x78c]
cmp ecx, edx
jb 0x405230
mov eax, dword [0x42f960]
movss xmm0, dword [0x42f8e8]
mov ecx, dword [eax]
push ecx
movss dword [esp], xmm0
push 1
push dword [0x42f8dc]
push edx
push esi
push eax
call dword [ecx + 0xc]
cmp byte [0x42f8e4], 0
jne 0x4054f0
cmp byte [0x42f924], 0
je 0x4052b0
cmp byte [0x42f925], 0
je 0x4052b0
mov ecx, dword [0x42f960]
push dword [0x42f92c]
movss xmm0, dword [0x42f928]
push ecx
mov eax, dword [ecx]
movss dword [esp], xmm0
push ecx
call dword [eax + 0x38]
mov esi, eax
test esi, esi
js 0x40594a
mov eax, dword [0x42f960]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x2c]
mov ecx, dword [0x42f8d8]
mov edi, eax
lea eax, [ebp - 0x780]
imul ecx, ecx
push eax
push dword [0x42f8dc]
push ecx
push edi
call dword [sym.imp.d3dx9_43.dll_D3DXCreatePRTBuffer]
mov esi, eax
test esi, esi
js 0x405929
cmp byte [0x42f924], 0
je 0x40535a
cmp byte [0x42f930], 0
je 0x40535a
push dword [ebp - 0x780]
movss xmm0, dword [0x42f934]
push dword [0x42f93c]
mov ecx, dword [0x42f960]
sub esp, 8
mov eax, dword [ecx]
movss dword [esp + 4], xmm0
movss xmm0, dword [0x42f938]
movss dword [esp], xmm0
push dword [0x42f8d8]
push ecx
call dword [eax + 0x44]
mov esi, eax
test esi, esi
jns 0x40537c
push str.Failed_to_compute_direct_lighting_adaptive_n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [0x42f960]
push dword [ebp - 0x780]
push dword [0x42f8d8]
mov eax, dword [ecx]
push ecx
call dword [eax + 0x40]
mov esi, eax
test esi, esi
js 0x405a10
mov eax, dword [0x42f8e0]
cmp eax, 1
jbe 0x4053eb
lea eax, [ebp - 0x778]
push eax
mov eax, dword [0x42f8d8]
push dword [0x42f8dc]
imul eax, eax
push eax
push edi
call dword [sym.imp.d3dx9_43.dll_D3DXCreatePRTBuffer]
mov esi, eax
test esi, esi
js 0x405929
lea eax, [ebp - 0x77c]
push eax
mov eax, dword [0x42f8d8]
push dword [0x42f8dc]
imul eax, eax
push eax
push edi
call dword [sym.imp.d3dx9_43.dll_D3DXCreatePRTBuffer]
mov esi, eax
test esi, esi
js 0x405929
mov eax, dword [ebp - 0x778]
push dword [ebp - 0x780]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x34]
mov eax, dword [0x42f8e0]
mov esi, dword [ebp - 0x778]
mov edi, 1
mov edx, dword [ebp - 0x77c]
cmp eax, edi
jbe 0x405493
cmp byte [0x42f924], 0
je 0x405450
cmp byte [0x42f940], 0
je 0x405450
push dword [ebp - 0x780]
mov ecx, dword [0x42f960]
movss xmm0, dword [0x42f944]
push edx
push dword [0x42f94c]
mov eax, dword [ecx]
sub esp, 8
movss dword [esp + 4], xmm0
movss xmm0, dword [0x42f948]
movss dword [esp], xmm0
push esi
push ecx
call dword [eax + 0x58]
jmp 0x405464
mov ecx, dword [0x42f960]
push dword [ebp - 0x780]
push edx
mov eax, dword [ecx]
push esi
push ecx
call dword [eax + 0x54]
mov esi, eax
test esi, esi
js 0x405908
mov edx, dword [ebp - 0x778]
inc edi
mov esi, dword [ebp - 0x77c]
mov dword [ebp - 0x778], esi
mov dword [ebp - 0x77c], edx
cmp edi, dword [0x42f8e0]
jb 0x405404
cmp byte [0x42f924], 0
mov edi, dword [ebp - 0x784]
je 0x4054c6
mov eax, dword [0x42f960]
push edi
push 0
push 0
mov ecx, dword [eax]
push 0
push dword [0x42f964]
push eax
call dword [ecx + 0x28]
mov esi, dword [ebp - 0x778]
mov edx, dword [ebp - 0x77c]
test esi, esi
je 0x4054e0
mov eax, dword [esi]
push esi
call dword [eax + 8]
mov edx, dword [ebp - 0x77c]
mov dword [ebp - 0x778], 0
test edx, edx
je 0x405756
mov eax, dword [edx]
push edx
jmp 0x405749
cmp byte [0x42f924], 0
je 0x40552c
cmp byte [0x42f925], 0
je 0x40552c
mov ecx, dword [0x42f960]
push dword [0x42f92c]
movss xmm0, dword [0x42f928]
push ecx
mov eax, dword [ecx]
movss dword [esp], xmm0
push ecx
call dword [eax + 0x38]
mov esi, eax
test esi, esi
js 0x40594a
mov eax, dword [0x42f960]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x2c]
mov ecx, dword [0x42f8d8]
mov esi, eax
mov edi, dword [sym.imp.d3dx9_43.dll_D3DXCreatePRTBuffer]
lea eax, [ebp - 0x780]
push eax
push dword [0x42f8dc]
imul ecx, ecx
push ecx
push esi
call edi
test eax, eax
js 0x4058f6
lea eax, [ebp - 0x778]
push eax
mov eax, dword [0x42f8d8]
push dword [0x42f8dc]
imul eax, eax
push eax
push esi
call edi
test eax, eax
js 0x4058f6
lea eax, [ebp - 0x77c]
push eax
mov eax, dword [0x42f8d8]
push dword [0x42f8dc]
imul eax, eax
push eax
push esi
call edi
test eax, eax
js 0x4058f6
cmp byte [0x42f924], 0
je 0x4055f3
cmp byte [0x42f930], 0
je 0x4055f3
push dword [ebp - 0x778]
movss xmm0, dword [0x42f934]
push dword [0x42f93c]
mov ecx, dword [0x42f960]
sub esp, 8
mov eax, dword [ecx]
movss dword [esp + 4], xmm0
movss xmm0, dword [0x42f938]
movss dword [esp], xmm0
push dword [0x42f8d8]
push ecx
call dword [eax + 0x44]
jmp 0x40560b
mov ecx, dword [0x42f960]
push dword [ebp - 0x778]
push dword [0x42f8d8]
mov eax, dword [ecx]
push ecx
call dword [eax + 0x40]
mov esi, eax
test esi, esi
js 0x405a10
push dword [ebp - 0x780]
mov ecx, dword [0x42f960]
push dword [ebp - 0x77c]
push dword [ebp - 0x778]
mov eax, dword [ecx]
push ecx
call dword [eax + 0x4c]
mov esi, eax
test esi, esi
js 0x4059ef
mov esi, 1
cmp dword [0x42f8e0], esi
jbe 0x4056fb
nop
cmp byte [0x42f924], 0
je 0x4056a2
cmp byte [0x42f940], 0
je 0x4056a2
movss xmm0, dword [0x42f944]
mov ecx, dword [0x42f960]
push 0
push dword [ebp - 0x778]
push dword [0x42f94c]
mov eax, dword [ecx]
sub esp, 8
movss dword [esp + 4], xmm0
movss xmm0, dword [0x42f948]
movss dword [esp], xmm0
push dword [ebp - 0x77c]
push ecx
call dword [eax + 0x58]
jmp 0x4056bc
mov ecx, dword [0x42f960]
push 0
push dword [ebp - 0x778]
push dword [ebp - 0x77c]
mov eax, dword [ecx]
push ecx
call dword [eax + 0x54]
mov edi, eax
test edi, edi
js 0x40598c
push dword [ebp - 0x780]
mov ecx, dword [0x42f960]
push dword [ebp - 0x77c]
push dword [ebp - 0x778]
mov eax, dword [ecx]
push ecx
call dword [eax + 0x4c]
mov edi, eax
test edi, edi
js 0x40596b
inc esi
cmp esi, dword [0x42f8e0]
jb 0x405650
cmp byte [0x42f924], 0
mov edi, dword [ebp - 0x784]
je 0x405722
mov eax, dword [0x42f960]
push edi
push 0
push 0
mov ecx, dword [eax]
push 0
push dword [0x42f964]
push eax
call dword [ecx + 0x28]
mov ecx, dword [ebp - 0x778]
test ecx, ecx
je 0x40573c
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [ebp - 0x778], 0
mov ecx, dword [ebp - 0x77c]
test ecx, ecx
je 0x405756
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [ebp - 0x77c], 0
lea eax, [ebp - 0x794]
push eax
push dword [ebp - 0x780]
push 0
push 0
push dword [0x42f958]
push dword [0x42f954]
push dword [0x42f950]
call dword [sym.imp.d3dx9_43.dll_D3DXCreatePRTCompBuffer]
mov esi, eax
test esi, esi
js 0x4059ce
push dword [ebp - 0x794]
push dword [ebp - 0x7a0]
call fcn.00405d10
mov esi, eax
test esi, esi
js 0x4059ad
cmp byte [0x42f95c], 0
je 0x405859
mov esi, dword [edi]
lea eax, [ebp - 0x770]
mov dword [ebp - 0x774], eax
lea ecx, [ebp - 0x774]
push 3
lea eax, [ebp - 0x414]
push eax
call fcn.00405f80
push 0
push 0
push 0
push 0
push 0
push esi
push dword [ebp - 0x774]
call dword [sym.imp.d3dx9_43.dll_D3DXSaveMeshToXW]
mov eax, dword [ebp - 0x774]
lea ecx, [ebp - 0x770]
cmp eax, ecx
je 0x405803
push eax
call fcn.0041571d
add esp, 4
mov esi, dword [ebp - 0x780]
lea eax, [ebp - 0x770]
mov dword [ebp - 0x774], eax
lea ecx, [ebp - 0x774]
push 3
lea eax, [ebp - 0x518]
push eax
call fcn.00405f80
push esi
push dword [ebp - 0x774]
call dword [sym.imp.d3dx9_43.dll_D3DXSavePRTBufferToFileW]
mov ecx, dword [ebp - 0x774]
mov esi, eax
lea eax, [ebp - 0x770]
cmp ecx, eax
je 0x405851
push ecx
call fcn.0041571d
add esp, 4
test esi, esi
js 0x405a1d
mov ecx, dword [ebp - 0x780]
test ecx, ecx
je 0x405873
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [ebp - 0x780], 0
mov ecx, dword [ebp - 0x794]
test ecx, ecx
je 0x40588d
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [ebp - 0x794], 0
mov esi, dword [ebp - 0x784]
mov edi, dword [ebp - 0x790]
mov ecx, dword [0x42f960]
test ecx, ecx
je 0x4058b3
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [0x42f960], 0
mov ecx, dword [esi]
test ecx, ecx
je 0x4058c5
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [esi], 0
mov edx, dword [ebp - 0x798]
add esi, 4
inc edx
mov dword [ebp - 0x784], esi
mov dword [ebp - 0x798], edx
cmp edx, dword [ebp - 0x79c]
jb 0x405030
mov esi, dword [ebp - 0x7a0]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_compute_bounces_n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_create_PRT_buffer_n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Mesh_refine_failed_n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_compute_subsurface_scattering__post_bounce__n
call fcn.004010d0
add esp, 4
mov eax, edi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_compute_bounces_n
call fcn.004010d0
add esp, 4
mov eax, edi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_save_PRT_data_n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_create_compression_buffer_n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_compute_subsurface_scattering_n
call fcn.004010d0
add esp, 4
mov eax, esi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406933
mov esp, ebp
pop ebp
ret 4
push str.Failed_to_compute_direct_lighting_n
call fcn.004010d0
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
xor ecx, ebp
pop esi
call fcn.00406933
mov esp, ebp
pop ebp
ret 4