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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b2dfc
mov eax, dword fs:[0]
push eax
sub esp, 0x228
mov eax, dword [0x5f8800]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x220], ecx
mov eax, dword [0x5c7574]
mov dword [ebp - 0x18], eax
mov ax, word [0x5c7578]
push 0xff
mov word [ebp - 0x14], ax
lea eax, [ebp - 0x218]
push 0
push eax
mov byte [ebp - 0x21a], 0
mov byte [ebp - 0x219], 0
mov dword [ebp - 0x224], 0
call sub.VCRUNTIME140.dll_memset
push 0xff
lea eax, [ebp - 0x118]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push str.magiccfg.txt
lea eax, [ebp - 0x218]
push 0xff
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strcpy_s
push str.contents
lea eax, [ebp - 0x118]
push 0xff
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strcat_s
push 0x5c7568
lea eax, [ebp - 0x118]
push 0xff
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strcat_s
push 0x5c7568
lea eax, [ebp - 0x118]
push 0xff
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strcat_s
add esp, 0x48
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x118]
push 0xff
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strcat_s
add esp, 0xc
lea eax, [ebp - 0x118]
push 0
push 0
push 3
push 0
push 0
push closesocket
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
mov dword [ebp - 0x22c], edi
cmp esi, 0xffffffff
je 0x4919a4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x5c45dc
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0x230]
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fopen_s
add esp, 0xc
test eax, eax
jne 0x491d3d
lea esi, [edi + 1]
push esi
call fcn.005aa4da
push esi
mov edi, eax
push 0
push edi
mov dword [ebp - 0x228], edi
call sub.VCRUNTIME140.dll_memset
push dword [ebp - 0x230]
push 1
push dword [ebp - 0x22c]
push edi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fread
push dword [ebp - 0x230]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fclose
push 0x114
call fcn.005aa520
add esp, 0x28
mov dword [ebp - 0x22c], eax
mov dword [ebp - 4], 0
test eax, eax
je 0x491a2e
lea ecx, [ebp - 0x18]
push ecx
push edi
mov ecx, eax
call fcn.00587a70
mov esi, eax
jmp 0x491a30
xor esi, esi
mov ecx, esi
mov dword [ebp - 4], 0xffffffff
call fcn.00587b30
mov edi, eax
test edi, edi
je 0x491cf4
nop dword [eax + eax]
mov al, byte [ebp - 0x21a]
test al, al
je 0x491cc7
movsx eax, al
sub eax, 1
jne case.default.0x491a7b
movsx eax, byte [ebp - 0x219]
dec eax
cmp eax, 8
ja case.default.0x491a7b
jmp dword [eax*4 + 0x491d5c]
mov ecx, dword [ebp - 0x220]
push edi
call fcn.004869a0
test al, al
je 0x491d23
push edi
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
mov ecx, dword [ebp - 0x220]
add esp, 4
cmp dword [ecx + eax*4 + 0x185834], 0
jne 0x491d23
push 0x34
call fcn.005aa520
add esp, 4
mov dword [ebp - 0x234], eax
mov dword [ebp - 4], 1
test eax, eax
je 0x491add
mov ecx, eax
call fcn.005852f0
mov dword [ebp - 0x224], eax
jmp 0x491ae7
mov dword [ebp - 0x224], 0
push edi
mov dword [ebp - 4], 0xffffffff
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
mov ecx, dword [ebp - 0x220]
mov edx, dword [ebp - 0x224]
push edi
mov dword [ecx + eax*4 + 0x185834], edx
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
add esp, 8
mov dword [ebp - 0x224], eax
mov byte [ebp - 0x219], 2
jmp case.default.0x491a7b
mov eax, dword [ebp - 0x220]
xorps xmm0, xmm0
mov ecx, dword [ebp - 0x224]
lea edx, [eax + ecx*4]
mov ecx, edi
mov eax, dword [edx + 0x185834]
movups xmmword [eax + 4], xmm0
movq qword [eax + 0x14], xmm0
mov dword [eax + 0x1c], 0
mov word [eax + 0x20], 0
mov byte [eax + 0x22], 0
lea eax, [ecx + 1]
mov dword [ebp - 0x22c], eax
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x491b60
sub ecx, dword [ebp - 0x22c]
mov eax, dword [edx + 0x185834]
push ecx
add eax, 4
push edi
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov byte [ebp - 0x219], 3
jmp case.default.0x491a7b
mov ecx, dword [ebp - 0x220]
push edi
call fcn.004869a0
test al, al
je 0x491d23
push edi
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
mov ecx, dword [ebp - 0x220]
add esp, 4
mov edx, dword [ebp - 0x224]
mov byte [ebp - 0x219], 4
mov ecx, dword [ecx + edx*4 + 0x185834]
mov dword [ecx + 0x24], eax
jmp case.default.0x491a7b
mov ecx, dword [ebp - 0x220]
push edi
call fcn.004869a0
test al, al
je 0x491d23
push edi
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
mov ecx, dword [ebp - 0x220]
add esp, 4
mov edx, dword [ebp - 0x224]
mov byte [ebp - 0x219], 5
mov ecx, dword [ecx + edx*4 + 0x185834]
mov dword [ecx + 0x28], eax
jmp case.default.0x491a7b
mov ecx, dword [ebp - 0x220]
push edi
call fcn.004869a0
test al, al
je 0x491d23
push edi
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
mov ecx, dword [ebp - 0x220]
add esp, 4
mov edx, dword [ebp - 0x224]
mov byte [ebp - 0x219], 6
mov ecx, dword [ecx + edx*4 + 0x185834]
mov dword [ecx + 0x2c], eax
jmp case.default.0x491a7b
mov byte [ebp - 0x219], 7
jmp case.default.0x491a7b
mov byte [ebp - 0x219], 8
jmp case.default.0x491a7b
mov byte [ebp - 0x219], 9
jmp case.default.0x491a7b
mov ecx, dword [ebp - 0x220]
push edi
call fcn.004869a0
test al, al
je 0x491d23
push edi
call sub.api_ms_win_crt_convert_l1_1_0.dll_atoi
mov ecx, dword [ebp - 0x224]
add esp, 4
test eax, eax
mov eax, dword [ebp - 0x220]
mov eax, dword [eax + ecx*4 + 0x185834]
jne 0x491cb3
mov byte [eax + 0x30], 0
mov byte [ebp - 0x21a], 0
mov byte [ebp - 0x219], 0
jmp case.default.0x491a7b
mov byte [eax + 0x30], 1
mov byte [ebp - 0x21a], 0
mov byte [ebp - 0x219], 0
jmp case.default.0x491a7b
cmp dword [edi], 0x6967616d
jne case.default.0x491a7b
cmp byte [edi + 4], 0x63
jne case.default.0x491a7b
mov byte [ebp - 0x21a], 1
mov byte [ebp - 0x219], 1
mov ecx, esi
call fcn.00587b30
mov edi, eax
test edi, edi
jne 0x491a50
test esi, esi
je 0x491d00
mov eax, dword [esi]
mov ecx, esi
push 1
call dword [eax]
push dword [ebp - 0x228]
call fcn.005aa4e3
add esp, 4
cmp byte [ebp - 0x21a], 0
jne 0x491d3d
cmp byte [ebp - 0x219], 0
sete al
jmp 0x491d3f
push dword [ebp - 0x228]
call fcn.005aa4e3
add esp, 4
test esi, esi
je 0x491d3d
mov eax, dword [esi]
mov ecx, esi
push 1
call dword [eax]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005aa550
mov esp, ebp
pop ebp
ret