Function at 0x402138
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffe44
mov eax, 0x4e73f8
push ebx
push esi
push edi
lea esi, [ebp - 0x158]
lea ebx, [ebp - 0x1bc]
call fcn.004dc32c
mov dword [ebx + 0x1c], 1
lea edx, [ebp + 8]
lea eax, [ebp + 8]
call fcn.004e5150
inc dword [ebx + 0x1c]
xor edx, edx
mov word [ebx + 0x10], 8
mov word [ebx + 0x10], 0x14
mov dword [esi + 0xc], edx
mov edx, 0x4e713b
inc dword [ebx + 0x1c]
inc dword [ebx + 0x1c]
lea eax, [ebp - 0x160]
mov word [ebx + 0x10], 8
mov word [ebx + 0x10], 0x20
call fcn.004e5118
inc dword [ebx + 0x1c]
xor eax, eax
mov dword [ebp - 0x15c], eax
lea eax, [ebp + 8]
inc dword [ebx + 0x1c]
lea edx, [ebp - 0x160]
lea ecx, [ebp - 0x15c]
call fcn.004e51d0
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x160]
mov edx, 2
call fcn.004e518c
mov word [ebx + 0x10], 8
mov ecx, esi
mov edx, 0x3f
mov eax, dword [ebp - 0x15c]
call fcn.00488004
cmp dword [esi + 8], 0x10
jne 0x4022c4
push 1
lea ecx, [esi + 0xc]
push ecx
call fcn.004e5094
add esp, 8
lea eax, [esi + 0xc]
call fcn.004e5274
mov edx, dword [esi + 0xc]
movsx ecx, byte [edx]
cmp ecx, 0x2e
je 0x4026c3
mov word [ebx + 0x10], 0x2c
xor eax, eax
mov dword [ebp - 0x164], eax
lea ecx, [ebp - 0x164]
inc dword [ebx + 0x1c]
lea edx, [esi + 0xc]
lea eax, [ebp + 8]
call fcn.004e51d0
lea edx, [ebp - 0x164]
push edx
mov edx, 0x4e713d
lea eax, [ebp - 0x168]
call fcn.004e5118
inc dword [ebx + 0x1c]
xor eax, eax
mov dword [ebp - 0x16c], eax
lea edx, [ebp - 0x168]
inc dword [ebx + 0x1c]
lea ecx, [ebp - 0x16c]
pop eax
call fcn.004e51d0
lea edx, [ebp - 0x16c]
mov ecx, dword [edx]
push ecx
call fcn.00402138
pop ecx
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x16c]
mov edx, 2
call fcn.004e518c
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x168]
mov edx, 2
call fcn.004e518c
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x164]
mov edx, 2
call fcn.004e518c
jmp 0x4026c3
mov word [ebx + 0x10], 0x38
xor ecx, ecx
mov dword [ebp - 0x170], ecx
lea edx, [ebp - 0x170]
inc dword [ebx + 0x1c]
xor eax, eax
call fcn.00499350
lea eax, [ebp - 0x170]
mov eax, dword [eax]
xor edx, edx
mov dword [ebp - 0x174], edx
lea edx, [ebp - 0x174]
inc dword [ebx + 0x1c]
call fcn.00488160
lea edx, [ebp - 0x174]
lea eax, [esi + 0xc]
call fcn.004e525c
test al, al
je 0x402462
xor ecx, ecx
mov dword [ebp - 0x178], ecx
lea edx, [ebp - 0x178]
inc dword [ebx + 0x1c]
xor eax, eax
call fcn.00499350
lea eax, [ebp - 0x178]
mov eax, dword [eax]
xor edx, edx
mov dword [ebp - 0x17c], edx
lea edx, [ebp - 0x17c]
inc dword [ebx + 0x1c]
call fcn.00488160
lea edx, [ebp - 0x17c]
xor eax, eax
mov dword [ebp - 0x180], eax
lea ecx, [ebp - 0x180]
inc dword [ebx + 0x1c]
mov eax, 0x4e713f
call fcn.004e52d8
lea edx, [ebp - 0x180]
lea eax, [esi + 0xc]
call fcn.004e525c
test al, al
lea eax, [ebp - 0x180]
setne dl
and edx, 1
push edx
mov edx, 2
dec dword [ebx + 0x1c]
call fcn.004e518c
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x17c]
mov edx, 2
call fcn.004e518c
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x178]
mov edx, 2
call fcn.004e518c
pop ecx
test ecx, ecx
je 0x402462
xor eax, eax
mov dword [ebp - 0x184], eax
lea ecx, [ebp - 0x184]
inc dword [ebx + 0x1c]
lea edx, [esi + 0xc]
lea eax, [ebp + 8]
call fcn.004e51d0
lea edx, [ebp - 0x184]
mov ecx, dword [edx]
push ecx
call fcn.00401fc4
and eax, 0xff
pop ecx
cmp eax, 1
lea eax, [ebp - 0x184]
sbb edx, edx
neg edx
push edx
mov edx, 2
dec dword [ebx + 0x1c]
call fcn.004e518c
pop ecx
test ecx, ecx
je 0x402462
xor eax, eax
mov dword [ebp - 0x188], eax
lea ecx, [ebp - 0x188]
inc dword [ebx + 0x1c]
lea edx, [esi + 0xc]
lea eax, [ebp + 8]
call fcn.004e51d0
lea edx, [ebp - 0x188]
mov ecx, dword [edx]
push ecx
call fcn.004020a0
test al, al
pop ecx
setne al
and eax, 1
mov edx, 2
push eax
lea eax, [ebp - 0x188]
dec dword [ebx + 0x1c]
call fcn.004e518c
pop ecx
test ecx, ecx
jne 0x402466
xor eax, eax
jmp 0x40246b
mov eax, 1
push eax
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x174]
mov edx, 2
call fcn.004e518c
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x170]
mov edx, 2
call fcn.004e518c
pop ecx
test cl, cl
je 0x4026c3
mov word [ebx + 0x10], 0x44
xor eax, eax
mov dword [ebp - 0x18c], eax
lea ecx, [ebp - 0x18c]
inc dword [ebx + 0x1c]
lea edx, [esi + 0xc]
lea eax, [ebp + 8]
call fcn.004e51d0
lea edx, [ebp - 0x18c]
mov ecx, dword [edx]
push ecx
call fcn.00401d24
pop ecx
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x18c]
mov edx, 2
call fcn.004e518c
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
mov word [ebx + 0x10], 0x50
xor ecx, ecx
mov dword [ebp - 0x190], ecx
lea ecx, [ebp - 0x190]
inc dword [ebx + 0x1c]
lea edx, [esi + 0xc]
lea eax, [ebp + 8]
call fcn.004e51d0
cmp dword [ebp - 0x190], 0
je 0x402521
mov eax, dword [ebp - 0x190]
jmp 0x402526
mov eax, 0x4e7141
push eax
call sub.KERNEL32.DLL_CreateFileA
mov dword [0x4f95d8], eax
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x190]
mov edx, 2
call fcn.004e518c
cmp dword [0x4f95d8], 0xffffffff
je 0x4026c3
push 0
mov ecx, dword [0x4f95d8]
push ecx
call sub.KERNEL32.DLL_GetFileSize
mov edi, eax
mov dword [0x4f95cc], edi
cmp edi, 0xc35e100
jg 0x4026c3
push edi
call fcn.004db9f4
pop ecx
mov dword [0x4f95c8], eax
push 0
push 0x4f95d0
mov eax, dword [0x4f95cc]
push eax
mov edx, dword [0x4f95c8]
push edx
mov ecx, dword [0x4f95d8]
push ecx
call sub.KERNEL32.DLL_ReadFile
push 0
push 0
push 0
mov eax, dword [0x4f95d8]
push eax
call sub.KERNEL32.DLL_SetFilePointer
push 0
push 0x4f95d0
push 0x13aa00
mov edx, dword [0x4f95c4]
push edx
mov ecx, dword [0x4f95d8]
push ecx
call sub.KERNEL32.DLL_WriteFile
mov eax, dword [0x4f95d8]
push eax
call sub.KERNEL32.DLL_CloseHandle
mov word [ebx + 0x10], 0x5c
xor edx, edx
mov dword [ebp - 0x194], edx
lea ecx, [ebp - 0x194]
inc dword [ebx + 0x1c]
lea edx, [esi + 0xc]
lea eax, [ebp + 8]
call fcn.004e51d0
lea ecx, [ebp - 0x194]
mov eax, dword [ecx]
push eax
call fcn.00401e7c
pop ecx
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x194]
mov edx, 2
call fcn.004e518c
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
mov word [ebx + 0x10], 0x68
xor ecx, ecx
mov dword [ebp - 0x198], ecx
lea ecx, [ebp - 0x198]
inc dword [ebx + 0x1c]
lea edx, [esi + 0xc]
lea eax, [ebp + 8]
call fcn.004e51d0
cmp dword [ebp - 0x198], 0
je 0x402660
mov eax, dword [ebp - 0x198]
jmp 0x402665
mov eax, 0x4e7142
push eax
call sub.KERNEL32.DLL_CreateFileA
mov dword [0x4f95d8], eax
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x198]
mov edx, 2
call fcn.004e518c
push 0
push 0
push 0x13aa00
mov ecx, dword [0x4f95d8]
push ecx
call sub.KERNEL32.DLL_SetFilePointer
push 0
push 0x4f95d0
mov eax, dword [0x4f95cc]
push eax
mov edx, dword [0x4f95c8]
push edx
mov ecx, dword [0x4f95d8]
push ecx
call sub.KERNEL32.DLL_WriteFile
mov eax, dword [0x4f95d8]
push eax
call sub.KERNEL32.DLL_CloseHandle
mov edx, dword [0x4f9330]
mov eax, dword [edx]
call fcn.004c653c
mov eax, esi
call fcn.00488054
test eax, eax
je 0x4021ef
mov eax, esi
call fcn.00488078
dec dword [ebx + 0x1c]
lea eax, [ebp - 0x15c]
mov edx, 2
call fcn.004e518c
dec dword [ebx + 0x1c]
dec dword [ebx + 0x1c]
lea eax, [esi + 0xc]
mov edx, 2
call fcn.004e518c
dec dword [ebx + 0x1c]
lea eax, [ebp + 8]
mov edx, 2
call fcn.004e518c
mov ecx, dword [ebx]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret