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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6f4
mov eax, dword [0x4a1014]
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 [0x4a35e4]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x1c], ebx
cmp ebx, 0xffffffff
jne 0x40b99e
lea eax, [ebx + 0x65]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.0046355d
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.0040b740
mov esi, eax
cmp esi, 0xffffffff
jne 0x40b9b6
mov ebx, 0x65
jmp 0x40c27e
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 0x4a355c
push ebx
call edi
test eax, eax
je 0x40c26b
mov eax, dword [esp + 0x34]
cmp eax, 0xffffffff
jne 0x40b9f4
mov ebx, 0x40000001
jmp 0x40c27e
cmp eax, 0x20
je 0x40ba03
mov ebx, 0x40000002
jmp 0x40c27e
mov eax, dword [0x4a3568]
xor ebx, ebx
test eax, eax
je 0x40ba18
add eax, 0xffffffe0
add eax, esi
mov dword [0x4a3568], eax
imul eax, dword [0x4a3578], 0x104
push 2
add eax, 2
push eax
call fcn.00467034
add esp, 8
mov dword [esp + 0x44], eax
mov dword [0x4a37c8], eax
test eax, eax
jne 0x40ba45
lea ebx, [eax + 0x66]
jmp 0x40c27e
xor ecx, ecx
mov dword [eax], ecx
mov dword [esp + 0x34], ecx
cmp dword [0x4a3578], ecx
jle 0x40c27e
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 0x40c26b
mov eax, dword [esp + 0x58]
cmp eax, 0xffffffff
je 0x40b9ea
cmp eax, 2
jne 0x40b9f9
mov ax, word [esp + 0x28]
test ax, ax
je 0x40b9ac
mov ecx, 0x104
cmp ax, cx
jae 0x40b9ac
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 0x40c26b
mov eax, dword [esp + 0x5c]
cmp eax, 0xffffffff
je 0x40b9ea
cmp eax, esi
jne 0x40b9f9
movzx eax, word [esp + 0x28]
add eax, eax
cmp eax, 0x208
jae 0x40c29f
xor ecx, ecx
mov word [esp + eax + 0xe0], cx
xor eax, eax
xor cl, cl
mov word [esp + 0x2e8], ax
call fcn.0040c2b0
mov ecx, eax
test ecx, ecx
je 0x40bb31
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 0x40bb21
lea edx, [esp + 0xe0]
mov esi, edx
nop word [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40bb40
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 0x40bb60
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 0x40bb90
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40bba5
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.0040b660
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40c27e
lea ecx, [esp + 0x2e8]
call fcn.0040b450
test eax, eax
jne 0x40c264
lea ecx, [esp + 0x2e8]
call fcn.0040b640
mov edi, eax
mov dword [esp + 0x10], edi
cmp edi, 0xffffffff
je 0x40c25d
lea eax, [esp + 0xe0]
push str.mmfs2.dll
push eax
call fcn.00468188
mov esi, dword [esp + 0x24]
add esp, 8
mov ecx, esi
push 4
test eax, eax
jne 0x40be99
lea edx, [esp + 0x34]
call fcn.0040b660
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40c254
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.00468358
mov esi, eax
add esp, 4
mov dword [esp + 0x14], esi
test esi, esi
je 0x40be74
push dword [esp + 0x30]
call fcn.00468358
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x40be6b
push dword [esp + 0x30]
mov ecx, dword [esp + 0x20]
mov edx, eax
call fcn.0040b660
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40be5f
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.0045fc30
mov dword [esp + 0xa0], 0
mov dword [esp + 0x9c], 0x45fc50
call fcn.0045fc30
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40bd22
lea esi, [eax - 4]
jmp 0x40be1c
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.00460540
mov esi, eax
test esi, esi
je 0x40bd72
push edi
push dword [esp + 0x98]
call dword [esp + 0x98]
add esp, 8
mov dword [esp + 0x88], 0
test esi, esi
jne 0x40be20
lea ecx, [esp + 0x6c]
call fcn.00460700
mov esi, eax
cmp esi, 1
je 0x40bdd2
mov ebx, dword [esp + 0x88]
test ebx, ebx
je 0x40bdbb
mov edi, dword [esp + 0x90]
test edi, edi
je 0x40bdbb
mov ecx, dword [ebx + 0x34]
mov eax, dword [esp + 0x94]
test ecx, ecx
je 0x40bdb4
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 0x40be20
cmp esi, 0xfffffffb
jne 0x40bdcc
cmp dword [esp + 0x70], 0
je 0x40be20
mov ebx, dword [esp + 0x18]
jmp 0x40be1c
mov edi, dword [esp + 0x88]
mov ebx, dword [esp + 0x80]
mov dword [esp + 0x18], ebx
test edi, edi
je 0x40be17
mov esi, dword [esp + 0x90]
test esi, esi
je 0x40be17
mov eax, dword [edi + 0x34]
mov ebx, dword [esp + 0x94]
test eax, eax
je 0x40be08
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 0x40be1c
mov esi, 0xfffffffe
test esi, esi
je 0x40be2b
mov esi, dword [esp + 0x14]
mov ebx, 0x65
jmp 0x40be57
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 0x40c241
cmp dword [esp + 0x60], ebx
jne 0x40c233
xor ebx, ebx
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x18], ebx
push dword [esp + 0x20]
call fcn.0046704a
add esp, 4
push esi
call fcn.0046704a
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 0x40c254
jmp 0x40beef
lea edx, [esp + 0x4c]
call fcn.0040b660
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40c254
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 0x40c254
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 0x40bf00
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jl 0x40c0de
lea eax, [esp + ecx*2 + 0xd8]
push str..mfx
push eax
call fcn.00468188
add esp, 8
test eax, eax
jne 0x40c0de
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 0x40bf6e
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
jmp 0x40bf7f
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 0x40bfbb
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.00467034
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 0x40c0ac
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 0x40c09e
mov eax, dword [esp + 0x64]
cmp eax, 0xffffffff
je 0x40c0a4
cmp eax, edi
jne 0x40c0a4
mov edx, dword [esp + 0x14]
shr edi, 2
test edi, edi
je 0x40c054
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 0x40c040
mov eax, dword [esp + 0x20]
mov edi, 0
and eax, 3
mov dword [esp + 0x50], eax
jbe 0x40c087
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 0x40c070
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 0x40c0a8
jmp 0x40c000
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.00464ed0
push dword [esp + 0x20]
call fcn.0046704a
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 0x40c27e
lea eax, [esp + 0xe0]
push str.FormattedText.dll
push eax
call fcn.00468188
add esp, 8
test eax, eax
jne 0x40c217
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 [0x4a3540], eax
test eax, eax
je 0x40c210
push str.getRunInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40c210
push 0x3c
lea eax, [esp + 0xa8]
push ebx
push eax
call fcn.00464ed0
add esp, 0xc
lea eax, [esp + 0xa4]
push eax
push 0x4a3598
call esi
test eax, eax
jne 0x40c210
mov eax, dword [esp + 0xb4]
mov dword [0x4a379c], eax
mov eax, dword [esp + 0xac]
mov dword [0x4a37a0], eax
mov eax, dword [esp + 0xb0]
mov dword [0x4a37a4], eax
mov eax, dword [esp + 0xb8]
mov dword [0x4a37a8], eax
mov eax, dword [esp + 0xbc]
mov dword [fcn.00421d60], eax
mov eax, dword [esp + 0xc0]
mov dword [fcn.00421d60], eax
mov eax, dword [esp + 0xc4]
mov dword [fcn.00421bb0], eax
mov eax, dword [esp + 0xcc]
mov dword [0x4a20bc], eax
mov eax, dword [esp + 0xc8]
mov dword [fcn.00421d60], eax
mov eax, dword [esp + 0xd0]
mov dword [0x4a202c], eax
mov eax, dword [esp + 0xd4]
mov dword [0x4a1dec], eax
mov eax, dword [esp + 0xd8]
mov dword [0x4a1bcc], eax
mov eax, dword [esp + 0xdc]
mov dword [0x4a19ac], 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 [0x4a3578]
jge 0x40c27e
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40ba61
push edi
mov ebx, 0x40000004
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c27e
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 0x40c27e
mov ebx, 0x68
jmp 0x40c27e
mov ebx, 0x67
jmp 0x40c27e
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.0046355d
mov esp, ebp
pop ebp
ret
call fcn.004636cd
int3