Function at 0x475160
Capabilities:
Get file size
Read file on windows

Disassembly:
mov eax, dword [0x5289ec]
sub esp, 0x104
push ebp
xor ebp, ebp
cmp eax, ebp
je 0x475181
push eax
call fcn.0048ace4
add esp, 4
mov dword [0x5289ec], ebp
mov eax, dword [0x5289f0]
cmp eax, ebp
je 0x475199
push eax
call fcn.0048ace4
add esp, 4
mov dword [0x5289f0], ebp
mov eax, dword [0x524440]
mov dword [0x5289c4], ebp
cmp eax, ebp
mov dword [0x5289c8], ebp
mov dword [0x5289cc], ebp
mov dword [0x5289d0], ebp
jne 0x4751cc
push 0x5289c4
push 0x528614
call fcn.004743f0
add esp, 8
cmp dword [0x524444], ebp
jne 0x4751f6
mov eax, dword [0x5289cc]
push 0x5289c4
cmp eax, ebp
push 0x528718
jne 0x4751ee
call fcn.004743f0
jmp 0x4751f3
call fcn.00474770
add esp, 8
mov eax, dword [0x524454]
push ebx
mov ebx, dword [sym.imp.SHLWAPI.dll_PathCombineA]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push edi
mov edi, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
cmp eax, ebp
jne 0x47524b
lea eax, [esp + 0x10]
push 0x104
push eax
push ebp
call esi
lea ecx, [esp + 0x10]
push ecx
call edi
lea edx, [esp + 0x10]
push str.nesdbadd.dat
lea eax, [esp + 0x14]
push edx
push eax
call ebx
lea ecx, [esp + 0x10]
push 0x5289c4
push ecx
call fcn.004743f0
add esp, 8
cmp dword [0x52444c], ebp
jne 0x475265
push 0x5289c4
push str.nesdbfix.dat
call fcn.00474b30
add esp, 8
cmp dword [0x524448], ebp
jne 0x47527f
push 0x5289c4
push 0x52881c
call fcn.00475340
add esp, 8
cmp dword [0x524458], ebp
jne 0x4752be
lea edx, [esp + 0x10]
push 0x104
push edx
push ebp
call esi
lea eax, [esp + 0x10]
push eax
call edi
lea ecx, [esp + 0x10]
push str.fdsdbadd.dat
lea edx, [esp + 0x14]
push ecx
push edx
call ebx
lea eax, [esp + 0x10]
push 0x5289c4
push eax
call fcn.00475340
add esp, 8
mov eax, dword [0x524450]
pop edi
cmp eax, ebp
pop esi
pop ebx
jne 0x4752dc
push 0x5289c4
push str.fdsdbfix.dat
call fcn.00474ed0
add esp, 8
mov ecx, dword [0x5289c4]
lea edx, [ecx*4]
push edx
call fcn.0048ac32
mov ecx, dword [0x5289c4]
mov dword [0x5289f0], eax
add esp, 4
xor eax, eax
cmp ecx, ebp
jle 0x475317
mov ecx, dword [0x5289f0]
mov dword [ecx + eax*4], eax
mov ecx, dword [0x5289c4]
inc eax
cmp eax, ecx
jl 0x475303
mov edx, dword [0x5289f0]
push 1
push ebp
push ecx
push edx
call fcn.00473fd0
add esp, 0x10
pop ebp
add esp, 0x104
jmp 0x4772f0
sub esp, 0x438
mov eax, dword [0x5289ec]
mov ecx, dword [0x5289c4]
push ebx
push ebp
push esi
push edi
lea edx, [esp + 0x2c]
xor esi, esi
push 0x104
push edx
push esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
lea ecx, [esp + 0x2c]
push str.nesrom.lst
lea edx, [esp + 0x30]
push ecx
push edx
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
push esi
push 0x80
push 3
push esi
push esi
lea eax, [esp + 0x40]
push bind
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x47736e
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x438
ret
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
push ebx
mov dword [esp + 0x28], ebx
call fcn.0048ac32
mov ebp, eax
add esp, 4
test ebp, ebp
mov dword [esp + 0x14], ebp
jne 0x47739b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x438
ret
lea ecx, [esp + 0x28]
push 0
push ecx
push ebx
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov cl, byte [ebp]
xor eax, eax
test cl, cl
je 0x4775f5
cmp cl, 0xd
je 0x4773cd
mov cl, byte [eax + ebp + 1]
inc eax
test cl, cl
jne 0x4773bf
cmp eax, 0xa
jle 0x4775f5
xor ecx, ecx
cmp esi, ebx
jae 0x4773f8
mov edi, dword [esp + 0x14]
mov al, byte [esi + edi]
cmp al, 0x3b
je 0x477415
cmp al, 0xd
je 0x477415
mov byte [esp + ecx + 0x130], al
inc ecx
inc esi
cmp esi, ebx
jb 0x4773e0
mov edx, dword [esp + 0x14]
push edx
call fcn.0048ace4
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x438
ret
cmp esi, ebx
jae 0x4773f8
cmp byte [esi + edi], 0xd
jne 0x477424
add esi, 2
jmp 0x4773d6
mov byte [esp + ecx + 0x130], 0
xor ecx, ecx
inc esi
cmp esi, ebx
jae 0x4773f8
mov al, byte [esi + edi]
cmp al, 0x3b
je 0x47744a
cmp al, 0xd
je 0x47744a
mov byte [esp + ecx + 0x2c], al
inc ecx
inc esi
cmp esi, ebx
jb 0x477433
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
cmp byte [esi + edi], 0xd
jne 0x47745c
add esi, 2
jmp 0x4773d6
lea edx, [esp + 0x10]
lea eax, [esp + 0x2c]
push edx
push eax
mov byte [esp + ecx + 0x34], 0
call fcn.004596c0
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x33c], ecx
xor ecx, ecx
inc esi
cmp esi, ebx
jae 0x4773f8
mov al, byte [esi + edi]
cmp al, 0x3b
je 0x4774a3
cmp al, 0xd
je 0x4774a3
mov byte [esp + ecx + 0x2c], al
inc ecx
inc esi
cmp esi, ebx
jb 0x477489
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
cmp byte [esi + edi], 0xd
jne 0x4774b9
add esi, 2
jmp 0x4773d6
lea edx, [esp + 0x10]
lea eax, [esp + 0x2c]
push edx
push eax
mov byte [esp + ecx + 0x34], 0
call fcn.004596c0
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x444], ecx
xor ecx, ecx
inc esi
cmp esi, ebx
jae 0x4774fa
mov al, byte [esi + edi]
cmp al, 0x3b
je 0x4774fa
cmp al, 0xd
je 0x4774fa
mov byte [esp + ecx + 0x340], al
inc ecx
inc esi
cmp esi, ebx
jb 0x4774e2
mov eax, dword [esp + 0x18]
xor ebp, ebp
test eax, eax
mov byte [esp + ecx + 0x340], 0
jle 0x4775b8
mov edx, dword [esp + 0x1c]
lea edi, [esp + 0x130]
mov eax, edx
mov bl, byte [eax]
mov cl, bl
cmp bl, byte [edi]
jne 0x477541
test cl, cl
je 0x47753d
mov bl, byte [eax + 1]
mov cl, bl
cmp bl, byte [edi + 1]
jne 0x477541
add eax, 2
add edi, 2
test cl, cl
jne 0x47751d
xor eax, eax
jmp 0x477546
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x47755d
mov eax, dword [edx + 0x20c]
mov ebx, dword [esp + 0x33c]
xor eax, ebx
test al, 2
je 0x47756e
mov eax, dword [esp + 0x18]
inc ebp
add edx, 0x318
cmp ebp, eax
jl 0x477514
jmp 0x4775b4
mov eax, ebp
lea ecx, [esp + 0x340]
shl eax, 5
add eax, ebp
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x1c]
lea edi, [eax + edx*8]
lea eax, [esp + 0x340]
mov edx, edi
sub edx, eax
add edx, 0x210
mov al, byte [ecx]
mov byte [edx + ecx], al
inc ecx
test al, al
jne 0x477597
mov ecx, dword [esp + 0x444]
mov dword [edi + 0x20c], ebx
mov dword [edi + 0x314], ecx
mov ebx, dword [esp + 0x24]
cmp esi, ebx
jae 0x4773f8
mov edx, dword [esp + 0x14]
cmp byte [esi + edx], 0xd
je 0x4775d4
inc esi
cmp esi, ebx
jb 0x4775c0
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
mov eax, dword [esp + 0x14]
cmp byte [esi + eax], 0xd
jne 0x4773d6
add esi, 2
jmp 0x4773d6
add esi, 2
xor ecx, ecx
cmp esi, ebx
jae 0x4773f8
mov ebp, dword [esp + 0x14]
mov al, byte [esi + ebp]
cmp al, 0x3b
je 0x47761d
cmp al, 0xd
je 0x47761d
mov byte [esp + ecx + 0x2c], al
inc ecx
inc esi
cmp esi, ebx
jb 0x477603
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
cmp byte [esi + ebp], 0xd
je 0x4775f2
mov byte [esp + ecx + 0x2c], 0
lea ecx, [esp + 0x10]
lea edx, [esp + 0x2c]
push ecx
push edx
call fcn.004596c0
mov edi, dword [esp + 0x18]
add esp, 8
xor ecx, ecx
inc esi
cmp esi, ebx
mov dword [esp + 0x33c], edi
jae 0x4773f8
mov al, byte [esi + ebp]
cmp al, 0x3b
je 0x477672
cmp al, 0xd
je 0x477672
mov byte [esp + ecx + 0x2c], al
inc ecx
inc esi
cmp esi, ebx
jb 0x477658
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
cmp byte [esi + ebp], 0xd
je 0x4775f2
mov byte [esp + ecx + 0x2c], 0
lea eax, [esp + 0x10]
lea ecx, [esp + 0x2c]
push eax
push ecx
call fcn.004596c0
mov edx, dword [esp + 0x18]
add esp, 8
shr edi, 1
xor ecx, ecx
inc esi
cmp edi, 1
mov dword [esp + 0x444], edx
mov dword [esp + 0x20], edi
je 0x47778b
cmp esi, ebx
jae 0x4773f8
mov al, byte [esi + ebp]
cmp al, 0x3b
je 0x4776da
cmp al, 0xd
je 0x4776da
mov byte [esp + ecx + 0x2c], al
inc ecx
inc esi
cmp esi, ebx
jb 0x4776c0
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
cmp byte [esi + ebp], 0xd
je 0x4775f2
mov byte [esp + ecx + 0x2c], 0
lea eax, [esp + 0x10]
lea ecx, [esp + 0x2c]
push eax
push ecx
call fcn.004596c0
mov edx, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x228], edx
mov edi, dword [esp + 0x14]
xor ecx, ecx
inc esi
cmp esi, ebx
jae 0x477731
mov al, byte [esi + edi]
cmp al, 0x3b
je 0x477731
cmp al, 0xd
je 0x477731
mov byte [esp + ecx + 0x340], al
inc ecx
inc esi
cmp esi, ebx
jb 0x477719
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x18]
cmp edi, 1
mov byte [esp + ecx + 0x340], 0
je 0x4778b2
xor edx, edx
test eax, eax
jle 0x477969
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x228]
add eax, 0xf8
mov ebp, dword [eax + 0x114]
shr ebp, 1
cmp edi, ebp
jne 0x477778
cmp dword [eax], ecx
je 0x477860
mov ebp, dword [esp + 0x18]
inc edx
add eax, 0x318
cmp edx, ebp
jl 0x477764
jmp 0x477969
cmp esi, ebx
jae 0x4773f8
mov al, byte [esi + ebp]
cmp al, 0x3b
je 0x4777ad
cmp al, 0xd
je 0x4777ad
mov byte [esp + ecx + 0x2c], al
inc ecx
inc esi
cmp esi, ebx
jb 0x477793
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
cmp byte [esi + ebp], 0xd
je 0x4775f2
mov byte [esp + ecx + 0x2c], 0
lea eax, [esp + 0x10]
lea ecx, [esp + 0x2c]
push eax
push ecx
call fcn.004596c0
mov al, byte [esp + 0x18]
add esp, 8
xor ebp, ebp
mov byte [esp + 0x338], al
test al, al
jbe 0x47770e
mov edi, dword [esp + 0x14]
xor ecx, ecx
inc esi
cmp esi, ebx
jae 0x477712
mov al, byte [esi + edi]
cmp al, 0x3b
je 0x477814
cmp al, 0xd
je 0x477814
mov byte [esp + ecx + 0x2c], al
inc ecx
inc esi
cmp esi, ebx
jb 0x4777fa
jmp 0x477712
cmp esi, ebx
jae 0x477712
cmp byte [esi + edi], 0xd
jne 0x477827
add esi, 2
jmp 0x477849
lea edx, [esp + 0x10]
lea eax, [esp + 0x2c]
push edx
push eax
mov byte [esp + ecx + 0x34], 0
call fcn.004596c0
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [esp + ebp*4 + 0x230], ecx
mov edx, dword [esp + 0x338]
inc ebp
and edx, 0xff
cmp ebp, edx
jl 0x4777ef
jmp 0x477712
mov eax, edx
lea ecx, [esp + 0x340]
shl eax, 5
add eax, edx
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x1c]
lea edi, [eax + edx*8]
lea eax, [esp + 0x340]
mov edx, edi
sub edx, eax
add edx, 0x210
mov al, byte [ecx]
mov byte [edx + ecx], al
inc ecx
test al, al
jne 0x477889
mov ecx, dword [esp + 0x33c]
mov edx, dword [esp + 0x444]
mov dword [edi + 0x20c], ecx
mov dword [edi + 0x314], edx
jmp 0x477969
test eax, eax
jle 0x477969
mov edi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x340]
mov dword [esp + 0x20], ecx
lea ebp, [edi + 0x20c]
sub edi, eax
add edi, 0x210
mov edx, dword [ebp]
and edx, 0xfffffffe
cmp edx, 2
jne 0x47794e
mov al, byte [esp + 0x338]
mov cl, byte [ebp - 4]
lea edx, [ebp - 0x10c]
cmp al, cl
jne 0x47794e
mov ecx, dword [esp + 0x338]
xor eax, eax
and ecx, 0xff
jle 0x477922
mov ebx, dword [edx]
cmp ebx, dword [esp + eax*4 + 0x230]
jne 0x47791e
inc eax
add edx, 4
cmp eax, ecx
jl 0x47790b
mov ebx, dword [esp + 0x24]
cmp eax, ecx
jne 0x47794e
lea eax, [esp + 0x340]
mov cl, byte [eax]
mov byte [edi + eax], cl
inc eax
test cl, cl
jne 0x47792d
mov ecx, dword [esp + 0x33c]
mov edx, dword [esp + 0x444]
mov dword [ebp], ecx
mov dword [ebp + 0x108], edx
mov eax, dword [esp + 0x20]
add edi, 0x318
add ebp, 0x318
dec eax
mov dword [esp + 0x20], eax
jne 0x4778db
cmp esi, ebx
jae 0x4773f8
mov eax, dword [esp + 0x14]
cmp byte [esi + eax], 0xd
je 0x477985
inc esi
cmp esi, ebx
jb 0x477971
jmp 0x4773f8
cmp esi, ebx
jae 0x4773f8
mov ecx, dword [esp + 0x14]
cmp byte [esi + ecx], 0xd
jne 0x4775f5
jmp 0x4775f2