Function at 0x100039a0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x11c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x130]
push edi
mov eax, dword [esi]
mov edi, dword [esi + 4]
cmp eax, 4
ja case.default.0x100039bf
jmp dword [eax*4 + 0x10003c98]
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], edi
jmp 0x10003c75
mov eax, dword [esp + 0x130]
lea edx, [esp + 0x14]
push 4
push edx
push eax
mov dword [esp + 0x20], 1
call fcn.10004640
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
lea ebp, [edi + 4]
push ebp
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x10003a23
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], ebx
jmp 0x10003c3f
mov ecx, edi
mov dword [ebx], 4
mov esi, dword [esi + 8]
mov eax, ecx
lea edi, [ebx + 4]
push ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x138]
push ecx
call fcn.10004640
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
push 0x408
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x10003aa7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x130]
lea edx, [esp + 0x14]
push 8
push edx
push eax
mov dword [esp + 0x20], ebx
call fcn.10004640
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov edx, dword [esi + 8]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea ebp, [esp + 0x28]
mov eax, ecx
mov esi, edi
mov edi, ebp
lea ebp, [esp + 0x28]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x1008a624
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, ebp
mov ebp, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
push ecx
push edx
call fcn.100016b0
add esp, 8
test eax, eax
jne 0x10003b41
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x130]
lea edx, [esp + 0x14]
push 8
push edx
push eax
mov dword [esp + 0x20], 0
call fcn.10004640
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
lea ecx, [esp + 0x28]
push ecx
call fcn.10002f30
lea edx, [esp + 0x2c]
mov esi, eax
push 0x1008a074
push edx
mov dword [esp + 0x1c], esi
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x10003b7d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], eax
jmp 0x10003c75
mov ebp, dword [sym.imp.MSVCRT.dll_fread]
push edi
push 0x400
lea edx, [ebx + 8]
push 1
push edx
mov dword [ebx], 3
mov dword [ebx + 4], esi
call ebp
mov ecx, dword [esp + 0x140]
mov esi, eax
lea eax, [esi + 8]
push eax
push ebx
push ecx
call fcn.10004640
mov eax, dword [esp + 0x2c]
add esp, 0x1c
sub eax, esi
mov dword [esp + 0x10], eax
je 0x10003bed
push edi
push 0x400
push 1
push ebx
call ebp
mov edx, dword [esp + 0x140]
mov esi, eax
push esi
push ebx
push edx
call fcn.10004640
add esp, 0x1c
cmp eax, 0xffffffff
je 0x10003c13
mov eax, dword [esp + 0x10]
sub eax, esi
mov dword [esp + 0x10], eax
jne 0x10003bbd
push ebx
call dword [sym.imp.MSVCRT.dll_free]
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
lea ecx, [esp + 0x30]
push ecx
call fcn.10002ad0
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
lea eax, [esp + 0x2c]
push eax
call fcn.10002ad0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov edx, dword [esi + 8]
mov dword [esp + 0x14], 2
mov eax, dword [edx]
mov edx, dword [esp + 0x130]
lea ecx, [esp + 0x14]
push 8
push ecx
push edx
mov dword [esp + 0x24], eax
call fcn.10004640
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0x10000005
mov ecx, dword [esp + 0x130]
lea eax, [esp + 0x14]
push 8
push eax
push ecx
call fcn.10004640
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11c
ret