Function at 0x40b930
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6f4
mov eax, dword [0x4a0014]
xor eax, esp
mov dword [esp + 0x6f0], eax
push ebx
push esi
push edi
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [0x4a25ec]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x1c], ebx
cmp ebx, 0xffffffff
jne 0x40b98e
lea eax, [ebx + 0x65]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.00462d8d
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.0040b730
mov esi, eax
cmp esi, 0xffffffff
jne 0x40b9a6
mov ebx, 0x65
jmp 0x40c26e
push 0
push 0
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x34]
push 0
push eax
push 0x20
push 0x4a2564
push ebx
call edi
test eax, eax
je 0x40c25b
mov eax, dword [esp + 0x34]
cmp eax, 0xffffffff
jne 0x40b9e4
mov ebx, 0x40000001
jmp 0x40c26e
cmp eax, 0x20
je 0x40b9f3
mov ebx, 0x40000002
jmp 0x40c26e
mov eax, dword [0x4a2570]
xor ebx, ebx
test eax, eax
je 0x40ba08
add eax, 0xffffffe0
add eax, esi
mov dword [0x4a2570], eax
imul eax, dword [0x4a2580], 0x104
push 2
add eax, 2
push eax
call fcn.00466864
add esp, 8
mov dword [esp + 0x44], eax
mov dword [0x4a27b0], eax
test eax, eax
jne 0x40ba35
lea ebx, [eax + 0x66]
jmp 0x40c26e
xor ecx, ecx
mov dword [eax], ecx
mov dword [esp + 0x34], ecx
cmp dword [0x4a2580], ecx
jle 0x40c26e
mov eax, dword [esp + 0x20]
mov dword [esp + 0x4c], eax
mov ebx, dword [esp + 0x1c]
lea eax, [esp + 0x58]
push 0
push eax
push 2
lea eax, [esp + 0x34]
push eax
push ebx
call edi
test eax, eax
je 0x40c25b
mov eax, dword [esp + 0x58]
cmp eax, 0xffffffff
je 0x40b9da
cmp eax, 2
jne 0x40b9e9
mov ax, word [esp + 0x28]
test ax, ax
je 0x40b99c
mov ecx, 0x104
cmp ax, cx
jae 0x40b99c
movzx esi, ax
lea eax, [esp + 0x5c]
push 0
push eax
add esi, esi
lea eax, [esp + 0xe8]
push esi
push eax
push ebx
call edi
test eax, eax
je 0x40c25b
mov eax, dword [esp + 0x5c]
cmp eax, 0xffffffff
je 0x40b9da
cmp eax, esi
jne 0x40b9e9
movzx eax, word [esp + 0x28]
add eax, eax
cmp eax, 0x208
jae 0x40c28f
xor ecx, ecx
mov word [esp + eax + 0xe0], cx
xor eax, eax
xor cl, cl
mov word [esp + 0x2e8], ax
call fcn.0040c2a0
mov ecx, eax
test ecx, ecx
je 0x40bb21
lea edx, [esp + 0x2e8]
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40bb11
lea edx, [esp + 0xe0]
mov esi, edx
nop word [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40bb30
lea edi, [esp + 0x2e8]
sub edx, esi
add edi, 0xfffffffe
nop word [eax + eax]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40bb50
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x44]
lea ecx, [esp + 0x2e8]
mov edx, esi
mov eax, ecx
sub edx, eax
nop dword [eax + eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40bb80
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40bb95
sub ecx, edx
xor eax, eax
sar ecx, 1
lea edx, [esp + 0x68]
push 4
lea esi, [esi + ecx*2]
mov ecx, ebx
add esi, 2
mov dword [esp + 0x48], esi
mov word [esi], ax
call fcn.0040b650
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40c26e
lea ecx, [esp + 0x2e8]
call fcn.0040b440
test eax, eax
jne 0x40c254
lea ecx, [esp + 0x2e8]
call fcn.0040b630
mov edi, eax
mov dword [esp + 0x10], edi
cmp edi, 0xffffffff
je 0x40c24d
lea eax, [esp + 0xe0]
push str.mmfs2.dll
push eax
call fcn.004679b8
mov esi, dword [esp + 0x24]
add esp, 8
mov ecx, esi
push 4
test eax, eax
jne 0x40be89
lea edx, [esp + 0x34]
call fcn.0040b650
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40c244
push 1
push eax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call eax
mov edi, eax
push 0x1e8480
mov dword [esp + 0x30], edi
call fcn.00467b88
mov esi, eax
add esp, 4
mov dword [esp + 0x14], esi
test esi, esi
je 0x40be64
push dword [esp + 0x30]
call fcn.00467b88
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x40be5b
push dword [esp + 0x30]
mov ecx, dword [esp + 0x20]
mov edx, eax
call fcn.0040b650
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40be4f
mov eax, dword [esp + 0x20]
mov ebx, 0x1e8480
push 0x1bcc
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x34]
push 1
push 0
mov dword [esp + 0x24], ebx
mov dword [esp + 0x7c], eax
mov dword [esp + 0x84], esi
mov dword [esp + 0x88], ebx
mov dword [esp + 0x90], 0
mov dword [esp + 0x98], fcn.0045f460
mov dword [esp + 0xa0], 0
mov dword [esp + 0x9c], 0x45f480
call fcn.0045f460
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40bd12
lea esi, [eax - 4]
jmp 0x40be0c
mov dword [edi + 0x34], 0
lea ecx, [esp + 0x6c]
mov dword [esp + 0x88], edi
mov dword [edi + 8], 1
mov dword [edi + 0x24], 0xf
call fcn.0045fd70
mov esi, eax
test esi, esi
je 0x40bd62
push edi
push dword [esp + 0x98]
call dword [esp + 0x98]
add esp, 8
mov dword [esp + 0x88], 0
test esi, esi
jne 0x40be10
lea ecx, [esp + 0x6c]
call fcn.0045ff30
mov esi, eax
cmp esi, 1
je 0x40bdc2
mov ebx, dword [esp + 0x88]
test ebx, ebx
je 0x40bdab
mov edi, dword [esp + 0x90]
test edi, edi
je 0x40bdab
mov ecx, dword [ebx + 0x34]
mov eax, dword [esp + 0x94]
test ecx, ecx
je 0x40bda4
push ecx
push eax
call edi
mov eax, dword [esp + 0x9c]
add esp, 8
push ebx
push eax
call edi
add esp, 8
cmp esi, 2
je 0x40be10
cmp esi, 0xfffffffb
jne 0x40bdbc
cmp dword [esp + 0x70], 0
je 0x40be10
mov ebx, dword [esp + 0x18]
jmp 0x40be0c
mov edi, dword [esp + 0x88]
mov ebx, dword [esp + 0x80]
mov dword [esp + 0x18], ebx
test edi, edi
je 0x40be07
mov esi, dword [esp + 0x90]
test esi, esi
je 0x40be07
mov eax, dword [edi + 0x34]
mov ebx, dword [esp + 0x94]
test eax, eax
je 0x40bdf8
push eax
push ebx
call esi
add esp, 8
push edi
push ebx
call esi
mov ebx, dword [esp + 0x20]
add esp, 8
xor esi, esi
jmp 0x40be0c
mov esi, 0xfffffffe
test esi, esi
je 0x40be1b
mov esi, dword [esp + 0x14]
mov ebx, 0x65
jmp 0x40be47
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x60]
mov edi, dword [esp + 0x10]
push 0
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c231
cmp dword [esp + 0x60], ebx
jne 0x40c223
xor ebx, ebx
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x18], ebx
push dword [esp + 0x20]
call fcn.0046687a
add esp, 4
push esi
call fcn.0046687a
add esp, 4
mov eax, dword [esp + 0x30]
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
add eax, edi
push 0
push 0
push eax
push dword [esp + 0x28]
call esi
mov edi, dword [esp + 0x10]
test ebx, ebx
jne 0x40c244
jmp 0x40bedf
lea edx, [esp + 0x4c]
call fcn.0040b650
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40c244
push 1
push eax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call eax
push dword [esp + 0x48]
mov esi, eax
push dword [esp + 0x20]
push edi
call dword [sym.imp.MMFS2.dll_Ordinal_766]
mov ebx, eax
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40c244
push eax
push eax
mov eax, dword [esp + 0x50]
add eax, esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push dword [esp + 0x28]
call esi
lea ecx, [esp + 0xe0]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40bef0
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jl 0x40c0ce
lea eax, [esp + ecx*2 + 0xd8]
push str..mfx
push eax
call fcn.004679b8
add esp, 8
test eax, eax
jne 0x40c0ce
push eax
push eax
push eax
push edi
call esi
push 1
xorps xmm0, xmm0
lea eax, [esp + 0x54]
push eax
movlpd qword [esp + 0x28], xmm0
push dword [esp + 0x2c]
movlpd qword [esp + 0x5c], xmm0
push dword [esp + 0x2c]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x40bf5e
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
jmp 0x40bf6f
xorps xmm0, xmm0
movlpd qword [esp + 0x38], xmm0
mov edi, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
push 2
xorps xmm0, xmm0
lea eax, [esp + 0x3c]
push eax
movlpd qword [esp + 0x28], xmm0
push dword [esp + 0x2c]
movlpd qword [esp + 0x44], xmm0
push dword [esp + 0x2c]
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x40bfab
mov eax, dword [esp + 0x38]
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x24], eax
push 0
lea eax, [esp + 0x24]
xorps xmm0, xmm0
push eax
push edi
mov edi, dword [esp + 0x1c]
push esi
push edi
movlpd qword [esp + 0x34], xmm0
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 1
push 0x8000
xor esi, esi
call fcn.00466864
mov ecx, eax
add esp, 8
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x2c], eax
test eax, eax
je 0x40c09c
nop
mov edi, 0x8000
cmp eax, edi
push 0
cmovb edi, eax
lea eax, [esp + 0x68]
push eax
push edi
push ecx
push dword [esp + 0x20]
mov dword [esp + 0x34], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40c08e
mov eax, dword [esp + 0x64]
cmp eax, 0xffffffff
je 0x40c094
cmp eax, edi
jne 0x40c094
mov edx, dword [esp + 0x14]
shr edi, 2
test edi, edi
je 0x40c044
nop dword [eax]
mov ecx, dword [edx]
mov eax, esi
shr eax, 0x1f
add edx, 4
add eax, ecx
lea esi, [eax + esi*2]
sub edi, 1
jne 0x40c030
mov eax, dword [esp + 0x20]
mov edi, 0
and eax, 3
mov dword [esp + 0x50], eax
jbe 0x40c077
mov ebx, eax
nop dword [eax + eax]
movzx ecx, byte [edi + edx]
mov eax, esi
shr eax, 0x1f
inc edi
add eax, ecx
lea esi, [eax + esi*2]
cmp edi, ebx
jb 0x40c060
mov ebx, dword [esp + 0x18]
mov eax, dword [esp + 0x2c]
sub eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x2c], eax
je 0x40c098
jmp 0x40bff0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
push 0x8000
push 0
push ecx
call fcn.00464700
push dword [esp + 0x20]
call fcn.0046687a
add esp, 0x10
mov eax, 0x65
cmp dword [esp + 0x68], esi
cmovne ebx, eax
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
jne 0x40c26e
lea eax, [esp + 0xe0]
push str.FormattedText.dll
push eax
call fcn.004679b8
add esp, 8
test eax, eax
jne 0x40c207
push 0x8001
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push ebx
mov edi, eax
lea eax, [esp + 0x2ec]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [0x4a2548], eax
test eax, eax
je 0x40c200
push str.getRunInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40c200
push 0x3c
lea eax, [esp + 0xa8]
push ebx
push eax
call fcn.00464700
add esp, 0xc
lea eax, [esp + 0xa4]
push eax
push 0x4a25a0
call esi
test eax, eax
jne 0x40c200
mov eax, dword [esp + 0xb4]
mov dword [0x4a279c], eax
mov eax, dword [esp + 0xac]
mov dword [0x4a27a0], eax
mov eax, dword [esp + 0xb0]
mov dword [0x4a27a4], eax
mov eax, dword [esp + 0xb8]
mov dword [0x4a27a8], eax
mov eax, dword [esp + 0xbc]
mov dword [fcn.00421ac0], eax
mov eax, dword [esp + 0xc0]
mov dword [fcn.00421ac0], eax
mov eax, dword [esp + 0xc4]
mov dword [fcn.00421910], eax
mov eax, dword [esp + 0xcc]
mov dword [0x4a10bc], eax
mov eax, dword [esp + 0xc8]
mov dword [fcn.00421ac0], eax
mov eax, dword [esp + 0xd0]
mov dword [0x4a102c], eax
mov eax, dword [esp + 0xd4]
mov dword [0x4a0dec], eax
mov eax, dword [esp + 0xd8]
mov dword [0x4a0bcc], eax
mov eax, dword [esp + 0xdc]
mov dword [0x4a09ac], eax
push edi
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
mov esi, dword [esp + 0x34]
inc esi
mov dword [esp + 0x34], esi
cmp esi, dword [0x4a2580]
jge 0x40c26e
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40ba51
push edi
mov ebx, 0x40000004
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c26e
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ebx, [eax - 0x70]
neg ebx
sbb ebx, ebx
add ebx, 0x40000004
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c26e
mov ebx, 0x68
jmp 0x40c26e
mov ebx, 0x67
jmp 0x40c26e
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ebx, [eax - 0x26]
neg ebx
sbb ebx, ebx
add ebx, 0x40000002
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x6fc]
mov eax, ebx
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00462d8d
mov esp, ebp
pop ebp
ret
call fcn.00462efd
int3