Function at 0x599ec0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x14
mov eax, dword [0x6d7160]
xor eax, esp
mov dword [esp + 0x10], eax
push ebp
mov ebp, dword [esp + 0x1c]
mov eax, dword [ebp]
mov word [ebp + 4], 0x4949
cmp dword [eax + 0x14], 0
push esi
je 0x599f02
cmp dword [eax + 0x18], 0xffffffff
je 0x599f12
mov ecx, dword [eax + 0x1c]
cmp ecx, 4
mov dword [eax + 0x18], 4
jbe 0x599efd
mov ecx, 4
mov dword [eax + 0x18], ecx
jmp 0x599f12
mov eax, dword [eax + 4]
push 0
push 4
push eax
call fcn.006081d8
add esp, 0xc
push ebx
push edi
mov esi, ebp
call fcn.0057e000
mov edi, eax
mov dword [esp + 0x10], edi
call fcn.0057e000
mov ecx, dword [ebp]
cmp dword [ecx + 0x14], 0
je 0x599f46
cmp dword [ecx + 0x18], 0xffffffff
je 0x599f55
mov edx, dword [ecx + 0x1c]
cmp edx, eax
mov dword [ecx + 0x18], eax
ja 0x599f41
mov eax, edx
mov dword [ecx + 0x18], eax
jmp 0x599f55
mov ecx, dword [ecx + 4]
push 0
push eax
push ecx
call fcn.006081d8
add esp, 0xc
test edi, edi
je 0x59a02c
lea ecx, [ecx]
sub dword [esp + 0x10], 1
mov esi, ebp
call fcn.0057e000
mov ebx, eax
mov dword [esp + 0x14], ebx
call fcn.0057e000
mov esi, dword [ebp]
mov edx, dword [esi + 0x14]
test edx, edx
je 0x599fba
mov eax, dword [esi + 0x1c]
mov edi, 8
cmp eax, edi
jb 0x599f9b
mov ecx, dword [esi + 0x18]
lea ebx, [ecx + 8]
cmp ebx, eax
mov ebx, dword [esp + 0x14]
jbe 0x599fa4
mov ecx, dword [esi + 0x18]
sub eax, ecx
mov edi, eax
je 0x599fd3
add ecx, edx
push edi
push ecx
lea edx, [esp + 0x20]
push edx
call fcn.0060d1b0
add esp, 0xc
add dword [esi + 0x18], edi
jmp 0x599fd3
mov esi, dword [esi + 4]
test esi, esi
je 0x599fd3
push esi
push 1
lea eax, [esp + 0x20]
push 8
push eax
call fcn.0060860a
add esp, 0x10
mov edi, str.META
lea esi, [esp + 0x18]
mov ecx, 5
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x599fed
mov dword [ebp + 0x350], ebx
mov edi, str.THUMB
lea esi, [esp + 0x18]
mov ecx, 6
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x59a007
mov dword [ebp + 0x34c], ebx
mov edi, str.RAW0
lea esi, [esp + 0x18]
mov ecx, 5
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x59a021
mov dword [ebp + 0x348], ebx
cmp dword [esp + 0x10], 0
jne 0x599f60
mov eax, dword [ebp + 0x350]
mov ecx, dword [ebp]
add eax, 0x14
cmp dword [ecx + 0x14], 0
je 0x59a055
cmp dword [ecx + 0x18], 0xffffffff
je 0x59a064
mov edx, dword [ecx + 0x1c]
cmp edx, eax
mov dword [ecx + 0x18], eax
ja 0x59a050
mov eax, edx
mov dword [ecx + 0x18], eax
jmp 0x59a064
push 0
push eax
mov eax, dword [ecx + 4]
push eax
call fcn.006081d8
add esp, 0xc
mov edi, dword [ebp]
cmp dword [edi + 0x14], 0
lea ebx, [ebp + 0x215]
je 0x59a07f
mov eax, 0x40
call fcn.00410220
jmp 0x59a094
mov edi, dword [edi + 4]
test edi, edi
je 0x59a094
push edi
push 1
push 0x40
push ebx
call fcn.0060860a
add esp, 0x10
push 0x20
push ebx
mov byte [ebp + 0x254], 0
call fcn.00609090
add esp, 8
test eax, eax
pop edi
pop ebx
je 0x59a0ce
lea ecx, [eax + 1]
mov edx, ebp
sub edx, ecx
lea esi, [edx + 0x255]
lea esp, [esp]
mov dl, byte [ecx]
mov byte [esi + ecx], dl
add ecx, 1
test dl, dl
jne 0x59a0c0
mov byte [eax], dl
mov esi, ebp
call fcn.0057df50
mov word [ebp + 0x45e], ax
call fcn.0057df50
mov word [ebp + 0x45c], ax
mov dword [ebp + 0x9692c], fcn.00585b30
call fcn.0057e000
call fcn.0057df50
mov word [ebp + 0x470], ax
call fcn.0057df50
mov ecx, dword [esp + 0x18]
pop esi
mov word [ebp + 0x472], ax
mov dword [ebp + 0x3ac], 0x3fff
pop ebp
xor ecx, esp
call fcn.00607d6d
add esp, 0x14
ret 4