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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x324
mov eax, dword [case.0x100be6e1.80]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
xor ecx, ecx
mov dword [ebp - 0x320], eax
mov edx, 2
mov eax, dword [0x103c915c]
imul eax, dword [0x103c9158]
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, 1
push edi
mov dword [ebp - 0x308], eax
mov edi, ebx
mul edx
mov dword [ebp - 0x310], ebx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.100c00fe
mov ecx, eax
mov eax, dword [ebp - 0x308]
add eax, eax
mov dword [ebp - 0x324], ecx
push eax
push dword [esi + 0x120]
mov dword [ebp - 0x314], eax
push ecx
call fcn.102961d0
mov eax, dword [0x103c915c]
xor ecx, ecx
imul eax, dword [0x103c9158]
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.100c00fe
add esp, 0x14
mov dword [0x103caa1c], eax
cmp dword [ebp + 0xc], 0
jne 0x1004a1a2
push str.OfsCal__HW_dark__start
push 0x14
push ebx
push esi
call fcn.1004ca80
add esp, 0x10
xor ebx, ebx
jmp 0x1004a5fe
lea eax, [ebp - 0x204]
push eax
call fcn.1004ca90
lea ecx, [ebp - 0x204]
add esp, 4
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x1004a1b8
mov eax, dword [str.dark.raw]
mov dword [ecx], eax
mov eax, dword [0x1031bd14]
mov dword [ecx + 4], eax
mov al, byte [0x1031bd18]
mov byte [ecx + 8], al
lea eax, [ebp - 0x204]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x1004a204
push str.WRN:_dark.raw_does_not_exist
push 0x14
push 0
push esi
call fcn.1004ca80
add esp, 0x10
xor ebx, ebx
jmp 0x1004a5fe
push 1
push str.DEBUG:_OfsCal_point_1
call fcn.100bbda0
mov eax, dword [ebp - 0x308]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.100c00fe
push 0
push eax
push dword [ebp - 0x314]
mov dword [ebp - 0x30c], eax
lea eax, [ebp - 0x204]
push eax
push 0
call fcn.100baf20
add esp, 0x20
test eax, eax
jne 0x1004a276
push 0xc9
call fcn.100be810
push eax
push 0x14
push 2
push esi
call fcn.1004ca80
add esp, 0x14
or ebx, 0xffffffff
mov dword [ebp - 0x310], ebx
jmp 0x1004a3c6
cmp dword [0x103c9a98], 0
je 0x1004a3a1
cmp dword [0x103c9b04], 0
je 0x1004a3a1
cmp dword [0x103c9a9c], ebx
jle 0x1004a3a1
lea eax, [ebp - 0x104]
push eax
call fcn.1004ca90
lea ecx, [ebp - 0x104]
add esp, 4
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x1004a2b2
mov eax, dword [str.dark2.raw]
mov dword [ecx], eax
mov eax, dword [0x103233d4]
mov dword [ecx + 4], eax
mov ax, word [0x103233d8]
mov word [ecx + 8], ax
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x1004a3a1
push 0x103233dc
push 0x14
push 1
push esi
call fcn.1004ca80
mov eax, dword [ebp - 0x308]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.100c00fe
push 0
push eax
push dword [ebp - 0x314]
mov dword [ebp - 0x31c], eax
lea eax, [ebp - 0x104]
push eax
push 0
call fcn.100baf20
add esp, 0x28
test eax, eax
je 0x1004a391
mov eax, dword [0x103c9a9c]
cmp eax, dword [0x103c915c]
jge 0x1004a391
cmp eax, 1
jle 0x1004a391
imul eax, dword [0x103c9158]
cmp eax, dword [ebp - 0x308]
jge 0x1004a391
mov ebx, dword [ebp - 0x30c]
mov edx, dword [ebp - 0x31c]
sub edx, ebx
mov dword [ebp - 0x318], edx
mov edx, dword [ebp - 0x308]
lea ecx, [ebx + eax*2]
mov ebx, dword [ebp - 0x318]
sub edx, eax
mov ax, word [ebx + ecx]
lea ecx, [ecx + 2]
mov word [ecx - 2], ax
sub edx, edi
jne 0x1004a380
mov ebx, edi
push 2
push dword [ebp - 0x31c]
call fcn.10291e3f
add esp, 8
push str.OfsCal_start
push 0x14
push 1
push esi
call fcn.1004ca80
add esp, 0x10
push 1
push dword [esi + 0x120]
push dword [ebp - 0x30c]
call fcn.1004c690
push 2
push dword [ebp - 0x30c]
call fcn.10291e3f
add esp, 8
test ebx, ebx
jle 0x1004a5fe
cmp dword [0x103c9a14], 0
je 0x1004a4bf
cmp dword [0x103c9a60], 0
lea eax, [ebp - 0x30c]
push 1
push dword [ebp - 0x320]
push 0
push eax
je 0x1004a418
push dword [0x103caa1c]
push dword [ebp - 0x308]
call fcn.100bcf50
jmp 0x1004a429
push dword [esi + 0x120]
push dword [ebp - 0x308]
call fcn.100bca50
add esp, 0x18
mov ebx, eax
cmp dword [ebp - 0x30c], 0
jge 0x1004a4ae
mov eax, 0x66666667
xor ecx, ecx
imul dword [0x103c9158]
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
nop dword [eax]
sub eax, dword [ebx + ecx*4]
inc ecx
test eax, eax
jg 0x1004a450
sub edi, ecx
sub edi, dword [ebp - 0x30c]
cmp dword [0x103c9a60], 0
je 0x1004a476
cmp dword [0x103c9a14], 0
jne 0x1004a476
xor edi, edi
jmp 0x1004a4ae
test edi, edi
jg 0x1004a47e
xor edi, edi
jmp 0x1004a4ae
push edi
lea eax, [ebp - 0x304]
push str.Shift__d_compensates_neg_pixels
push eax
call fcn.100029e0
lea eax, [ebp - 0x304]
push eax
push 0x14
push 1
push esi
call fcn.1004ca80
add esp, 0x1c
mov dword [ebp - 0x310], 1
push 4
push ebx
call fcn.10291e3f
mov ebx, dword [ebp - 0x310]
add esp, 8
push str.OfsCal_processing
push 0x14
push 1
push esi
call fcn.1004ca80
add esp, 0x10
cmp dword [0x103c9a60], 0
je 0x1004a5f0
lea eax, [ebp - 0x104]
push eax
call fcn.1004ca90
lea ecx, [ebp - 0x104]
add esp, 4
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x1004a4f4
mov eax, dword [str.dark.raw]
mov dword [ecx], eax
mov eax, dword [0x1031bd14]
mov dword [ecx + 4], eax
mov al, byte [0x1031bd18]
mov byte [ecx + 8], al
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x1004a53b
push str.WRN:_dark.raw_does_not_exist
push 0x14
push 0
push esi
call fcn.1004ca80
add esp, 0x10
xor ebx, ebx
push dword [ebp - 0x314]
push dword [ebp - 0x324]
push dword [esi + 0x120]
call fcn.102961d0
mov eax, dword [ebp - 0x308]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.100c00fe
push 0
push eax
push dword [ebp - 0x314]
mov dword [ebp - 0x318], eax
lea eax, [ebp - 0x104]
push eax
push 0
call fcn.100baf20
add esp, 0x24
test eax, eax
jne 0x1004a5af
push 0xc9
call fcn.100be810
push eax
push 0x14
push 2
push esi
call fcn.1004ca80
add esp, 0x14
or ebx, 0xffffffff
jmp 0x1004a5cf
push str.OfsCal_start
push 0x14
push 1
push esi
call fcn.1004ca80
add esp, 0x10
push edi
push dword [esi + 0x120]
push 0
call fcn.1004c690
mov edi, dword [ebp - 0x318]
push 0
push dword [esi + 0x120]
push edi
call fcn.1004c690
push 2
push edi
call fcn.10291e3f
add esp, 8
jmp 0x1004a5fe
push edi
push dword [esi + 0x120]
push 0
call fcn.1004c690
cmp dword [esi + 0x130], 0
jne 0x1004a61b
push str.OfsCal_done
push 0x14
push 1
push esi
call fcn.1004ca80
add esp, 0x10
jmp 0x1004a61e
or ebx, 0xffffffff
push 2
push dword [ebp - 0x324]
call fcn.10291e3f
push 4
push dword [0x103caa1c]
call fcn.10291e3f
mov ecx, dword [ebp - 4]
add esp, 0x10
mov eax, ebx
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.10291e04
mov esp, ebp
pop ebp
ret