Function at 0x47a794
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x19]
mov dword [esp + 8], eax
mov dword [esp + 4], str._CHT
lea esi, [ebp - 0x2c]
mov dword [esp], esi
call fcn.004da74c
mov dword [esp + 0xc], 1
mov dword [esp + 8], esi
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.0042159c
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x2c]
lea esi, [eax - 0xc]
cmp esi, 0x521134
jne 0x47ac5e
lea eax, [ebp - 0x1a]
mov dword [esp + 8], eax
mov dword [esp + 4], str.DTKN
lea esi, [ebp - 0x30]
mov dword [esp], esi
call fcn.004da74c
mov dword [esp + 0xc], 1
mov dword [esp + 8], esi
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.0042159c
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x30]
lea esi, [eax - 0xc]
mov edx, 0x521134
cmp edx, esi
jne 0x47ac2c
lea eax, [ebp - 0x1b]
mov dword [esp + 8], eax
mov dword [esp + 4], str.CH00
lea esi, [ebp - 0x34]
mov dword [esp], esi
call fcn.004da74c
mov dword [esp + 0xc], 1
mov dword [esp + 8], esi
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.0042159c
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x34]
lea esi, [eax - 0xc]
mov ecx, 0x521134
cmp ecx, esi
jne 0x47abc8
lea eax, [ebp - 0x1c]
mov dword [esp + 8], eax
mov dword [esp + 4], str.CDPH
lea esi, [ebp - 0x38]
mov dword [esp], esi
call fcn.004da74c
mov dword [esp + 0xc], 1
mov dword [esp + 8], esi
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.0042159c
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x38]
lea esi, [eax - 0xc]
mov edx, 0x521134
cmp edx, esi
jne 0x47ab96
lea eax, [ebp - 0x1d]
mov dword [esp + 8], eax
mov dword [esp + 4], str.ChPr
lea esi, [ebp - 0x3c]
mov dword [esp], esi
call fcn.004da74c
mov dword [esp + 0xc], 1
mov dword [esp + 8], esi
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.0042159c
mov esi, eax
mov eax, dword [ebp - 0x3c]
lea edi, [eax - 0xc]
mov ecx, 0x521134
cmp ecx, edi
jne 0x47abfa
cmp dword [ebp - 0x4c], 0xffffffff
je 0x47aa6c
cmp dword [ebp - 0x54], 0xffffffff
je 0x47aa78
mov eax, dword [ebx]
mov dword [ebp - 0x4c], eax
mov dword [esp + 4], 0x52fe02
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov esi, eax
test eax, eax
je 0x47aae8
mov dword [esp], eax
call sub.msvcrt.dll_rewind
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.msvcrt.dll_fseek
mov dword [esp], esi
call sub.msvcrt.dll_ftell
mov edi, eax
mov dword [esp], esi
call sub.msvcrt.dll_rewind
mov ecx, dword [ebp - 0x54]
add ecx, 0x4000
mov dword [ebp - 0x50], ecx
cmp ecx, edi
jae 0x47aaa8
sub edi, dword [ebp - 0x54]
sub edi, 0x4000
mov dword [esp], edi
call fcn.0050963c
mov dword [ebp - 0x4c], eax
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x50]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_fseek
mov dword [esp + 0xc], esi
mov dword [esp + 8], edi
mov dword [esp + 4], 1
mov edx, dword [ebp - 0x4c]
mov dword [esp], edx
call sub.msvcrt.dll_fread
lea eax, [ebp - 0x1e]
mov dword [esp + 8], eax
mov dword [esp + 4], str.CH00
lea ecx, [ebp - 0x40]
mov dword [esp], ecx
call fcn.004da74c
mov dword [esp + 0xc], edi
lea eax, [ebp - 0x40]
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x4c]
mov dword [esp + 4], edx
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.004214d8
mov edi, eax
mov eax, dword [ebp - 0x40]
lea ecx, [eax - 0xc]
mov dword [ebp - 0x50], ecx
mov edx, 0x521134
cmp edx, ecx
jne 0x47ac8c
cmp edi, 0xffffffff
je 0x47ab60
mov eax, dword [ebp - 0x54]
lea edi, [edi + eax + 0x3f80]
mov eax, edi
sub eax, dword [ebp - 0x54]
mov dword [ebx + 0x64], eax
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x47aa5a
mov edx, dword [ebp - 0x4c]
mov dword [esp], edx
call fcn.00509610
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov al, 1
cmp dword [ebp - 0x58], 0xffffffff
jne 0x47aa97
nop
xor eax, eax
add esp, 0x5c
pop ebx
pop esi
pop edi
leave
ret
mov edi, dword [ebp - 0x4c]
add edi, 0xffffff80
cmp dword [ebp - 0x50], 0xffffffff
je 0x47aad8
mov eax, edi
sub eax, dword [ebp - 0x50]
sub eax, 0xffffff80
mov dword [ebx + 0x64], eax
mov al, 1
cmp dword [ebp - 0x58], 0xffffffff
je 0x47aa6c
mov edx, dword [ebp - 0x58]
sub edx, edi
mov dword [ebx + 0x68], edx
add esp, 0x5c
pop ebx
pop esi
pop edi
leave
ret
mov dword [esp + 8], str.Warning_File_size_mismatch
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
mov dword [esp], esi
call sub.msvcrt.dll_fclose
xor eax, eax
add esp, 0x5c
pop ebx
pop esi
pop edi
leave
ret
cmp esi, 0xffffffff
je 0x47ab58
mov eax, edi
sub eax, esi
mov dword [ebx + 0x64], eax
mov al, 1
jmp 0x47aa91
lea eax, [ebp - 0x24]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Cannot_Open_File:
lea esi, [ebp - 0x44]
mov dword [esp], esi
call fcn.004da74c
xor eax, eax
mov ecx, 0xffffffff
mov edi, dword [ebp - 0x4c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 8], ecx
mov edx, dword [ebp - 0x4c]
mov dword [esp + 4], edx
mov dword [esp], esi
call fcn.004d957c
mov dword [esp], 8
call fcn.0050981c
mov ebx, eax
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.004e7434
mov dword [esp + 8], 0x4e75ac
mov dword [esp + 4], 0x536f34
mov dword [esp], ebx
call fcn.0050a02c
nop
xor eax, eax
jmp 0x47aa91
mov dword [esp + 8], str.Warning_unable_to_determine_start_of_Chaabi_Firmware__CH00_
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
mov edx, dword [ebp - 0x4c]
test edx, edx
je 0x47aac3
mov ecx, dword [ebp - 0x4c]
mov dword [esp], ecx
call fcn.00509610
jmp 0x47aac3
cmp dword [0x51b4e0], 0
jne 0x47acd9
mov eax, dword [esi + 8]
lea edx, [eax - 1]
mov dword [esi + 8], edx
test eax, eax
jg 0x47a8d3
lea eax, [ebp - 0x22]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.004d9148
jmp 0x47a8d3
cmp dword [0x51b4e0], 0
jne 0x47acf1
mov eax, dword [esi + 8]
lea edx, [eax - 1]
mov dword [esi + 8], edx
test eax, eax
jg 0x47a886
lea eax, [ebp - 0x21]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.004d9148
jmp 0x47a886
cmp dword [0x51b4e0], 0
jne 0x47ad09
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jg 0x47a91f
lea eax, [ebp - 0x23]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.004d9148
jmp 0x47a91f
cmp dword [0x51b4e0], 0
jne 0x47ad21
mov eax, dword [esi + 8]
lea edx, [eax - 1]
mov dword [esi + 8], edx
test eax, eax
jg 0x47a839
lea eax, [ebp - 0x20]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.004d9148
jmp 0x47a839
cmp dword [0x51b4e0], 0
jne 0x47acc4
mov eax, dword [esi + 8]
lea edx, [eax - 1]
mov dword [esi + 8], edx
test eax, eax
jg 0x47a7ec
lea eax, [ebp - 0x1f]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.004d9148
jmp 0x47a7ec
cmp dword [0x51b4e0], 0
jne 0x47ad95
mov ecx, dword [ebp - 0x50]
mov eax, dword [ecx + 8]
lea edx, [eax - 1]
mov dword [ecx + 8], edx
test eax, eax
jg 0x47aa2d
lea eax, [ebp - 0x25]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x50]
mov dword [esp], eax
call fcn.004d9148
jmp 0x47aa2d
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004ae5e4
jmp 0x47ac70
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004ae5e4
jmp 0x47abac
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004ae5e4
jmp 0x47abde
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004ae5e4
jmp 0x47ac10
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004ae5e4
jmp 0x47ac42
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004ae5e4
jmp 0x47aca5