Function at 0x40bc40
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 [0x4a35ec]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0x1c], ebx
cmp ebx, 0xffffffff
jne 0x40bc9e
lea eax, [ebx + 0x65]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6f0]
xor ecx, esp
call fcn.00463907
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.0040ba40
mov esi, eax
cmp esi, 0xffffffff
jne 0x40bcb6
mov ebx, 0x65
jmp 0x40c57e
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 0x4a3564
push ebx
call edi
test eax, eax
je 0x40c56b
mov eax, dword [esp + 0x34]
cmp eax, 0xffffffff
jne 0x40bcf4
mov ebx, 0x40000001
jmp 0x40c57e
cmp eax, 0x20
je 0x40bd03
mov ebx, 0x40000002
jmp 0x40c57e
mov eax, dword [0x4a3570]
xor ebx, ebx
test eax, eax
je 0x40bd18
add eax, 0xffffffe0
add eax, esi
mov dword [0x4a3570], eax
imul eax, dword [0x4a3580], 0x104
push 2
add eax, 2
push eax
call fcn.004673e4
add esp, 8
mov dword [esp + 0x44], eax
mov dword [0x4a37d0], eax
test eax, eax
jne 0x40bd45
lea ebx, [eax + 0x66]
jmp 0x40c57e
xor ecx, ecx
mov dword [eax], ecx
mov dword [esp + 0x34], ecx
cmp dword [0x4a3580], ecx
jle 0x40c57e
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 0x40c56b
mov eax, dword [esp + 0x58]
cmp eax, 0xffffffff
je 0x40bcea
cmp eax, 2
jne 0x40bcf9
mov ax, word [esp + 0x28]
test ax, ax
je 0x40bcac
mov ecx, 0x104
cmp ax, cx
jae 0x40bcac
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 0x40c56b
mov eax, dword [esp + 0x5c]
cmp eax, 0xffffffff
je 0x40bcea
cmp eax, esi
jne 0x40bcf9
movzx eax, word [esp + 0x28]
add eax, eax
cmp eax, 0x208
jae 0x40c59f
xor ecx, ecx
mov word [esp + eax + 0xe0], cx
xor eax, eax
xor cl, cl
mov word [esp + 0x2e8], ax
call fcn.0040c5b0
mov ecx, eax
test ecx, ecx
je 0x40be31
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 0x40be21
lea edx, [esp + 0xe0]
mov esi, edx
nop word [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40be40
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 0x40be60
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 0x40be90
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40bea5
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.0040b960
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40c57e
lea ecx, [esp + 0x2e8]
call fcn.0040b750
test eax, eax
jne 0x40c564
lea ecx, [esp + 0x2e8]
call fcn.0040b940
mov edi, eax
mov dword [esp + 0x10], edi
cmp edi, 0xffffffff
je 0x40c55d
lea eax, [esp + 0xe0]
push str.mmfs2.dll
push eax
call fcn.00468538
mov esi, dword [esp + 0x24]
add esp, 8
mov ecx, esi
push 4
test eax, eax
jne 0x40c199
lea edx, [esp + 0x34]
call fcn.0040b960
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40c554
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.00468708
mov esi, eax
add esp, 4
mov dword [esp + 0x14], esi
test esi, esi
je 0x40c174
push dword [esp + 0x30]
call fcn.00468708
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x40c16b
push dword [esp + 0x30]
mov ecx, dword [esp + 0x20]
mov edx, eax
call fcn.0040b960
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
jne 0x40c15f
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.0045ffd0
mov dword [esp + 0xa0], 0
mov dword [esp + 0x9c], 0x45fff0
call fcn.0045ffd0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40c022
lea esi, [eax - 4]
jmp 0x40c11c
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.004608e0
mov esi, eax
test esi, esi
je 0x40c072
push edi
push dword [esp + 0x98]
call dword [esp + 0x98]
add esp, 8
mov dword [esp + 0x88], 0
test esi, esi
jne 0x40c120
lea ecx, [esp + 0x6c]
call fcn.00460aa0
mov esi, eax
cmp esi, 1
je 0x40c0d2
mov ebx, dword [esp + 0x88]
test ebx, ebx
je 0x40c0bb
mov edi, dword [esp + 0x90]
test edi, edi
je 0x40c0bb
mov ecx, dword [ebx + 0x34]
mov eax, dword [esp + 0x94]
test ecx, ecx
je 0x40c0b4
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 0x40c120
cmp esi, 0xfffffffb
jne 0x40c0cc
cmp dword [esp + 0x70], 0
je 0x40c120
mov ebx, dword [esp + 0x18]
jmp 0x40c11c
mov edi, dword [esp + 0x88]
mov ebx, dword [esp + 0x80]
mov dword [esp + 0x18], ebx
test edi, edi
je 0x40c117
mov esi, dword [esp + 0x90]
test esi, esi
je 0x40c117
mov eax, dword [edi + 0x34]
mov ebx, dword [esp + 0x94]
test eax, eax
je 0x40c108
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 0x40c11c
mov esi, 0xfffffffe
test esi, esi
je 0x40c12b
mov esi, dword [esp + 0x14]
mov ebx, 0x65
jmp 0x40c157
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 0x40c541
cmp dword [esp + 0x60], ebx
jne 0x40c533
xor ebx, ebx
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x18], ebx
push dword [esp + 0x20]
call fcn.004673fa
add esp, 4
push esi
call fcn.004673fa
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 0x40c554
jmp 0x40c1ef
lea edx, [esp + 0x4c]
call fcn.0040b960
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40c554
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 0x40c554
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 0x40c200
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jl 0x40c3de
lea eax, [esp + ecx*2 + 0xd8]
push str..mfx
push eax
call fcn.00468538
add esp, 8
test eax, eax
jne 0x40c3de
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 0x40c26e
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
jmp 0x40c27f
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 0x40c2bb
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.004673e4
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 0x40c3ac
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 0x40c39e
mov eax, dword [esp + 0x64]
cmp eax, 0xffffffff
je 0x40c3a4
cmp eax, edi
jne 0x40c3a4
mov edx, dword [esp + 0x14]
shr edi, 2
test edi, edi
je 0x40c354
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 0x40c340
mov eax, dword [esp + 0x20]
mov edi, 0
and eax, 3
mov dword [esp + 0x50], eax
jbe 0x40c387
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 0x40c370
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 0x40c3a8
jmp 0x40c300
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.00465280
push dword [esp + 0x20]
call fcn.004673fa
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 0x40c57e
lea eax, [esp + 0xe0]
push str.FormattedText.dll
push eax
call fcn.00468538
add esp, 8
test eax, eax
jne 0x40c517
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 [0x4a3548], eax
test eax, eax
je 0x40c510
push str.getRunInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40c510
push 0x3c
lea eax, [esp + 0xa8]
push ebx
push eax
call fcn.00465280
add esp, 0xc
lea eax, [esp + 0xa4]
push eax
push 0x4a35a0
call esi
test eax, eax
jne 0x40c510
mov eax, dword [esp + 0xb4]
mov dword [0x4a37a4], eax
mov eax, dword [esp + 0xac]
mov dword [0x4a37a8], eax
mov eax, dword [esp + 0xb0]
mov dword [0x4a37ac], eax
mov eax, dword [esp + 0xb8]
mov dword [0x4a37b0], eax
mov eax, dword [esp + 0xbc]
mov dword [fcn.00422050], eax
mov eax, dword [esp + 0xc0]
mov dword [fcn.00422050], eax
mov eax, dword [esp + 0xc4]
mov dword [fcn.00421ea0], eax
mov eax, dword [esp + 0xcc]
mov dword [0x4a20bc], eax
mov eax, dword [esp + 0xc8]
mov dword [fcn.00422050], 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 [0x4a3580]
jge 0x40c57e
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40bd61
push edi
mov ebx, 0x40000004
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c57e
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 0x40c57e
mov ebx, 0x68
jmp 0x40c57e
mov ebx, 0x67
jmp 0x40c57e
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.00463907
mov esp, ebp
pop ebp
ret
call fcn.00463a77
int3