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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4491d6
mov eax, dword fs:[0]
push eax
sub esp, 0x48c
mov eax, dword [0x461068]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov dword [ebp - 0x458], esi
mov dword [ebp - 0x448], ecx
xor edi, edi
mov byte [ebp - 0x442], 0
push 0x200
lea eax, [ebp - 0x440]
mov dword [ebp - 0x44c], edi
push edi
push eax
call fcn.00427180
push 0x200
lea eax, [ebp - 0x240]
push edi
push eax
call fcn.00427180
cmp byte [esi], 0
mov ecx, 0x400
mov eax, 0x200
push edi
cmovne eax, ecx
push eax
push dword [ebp - 0x448]
call fcn.0042a111
add esp, 0x24
test eax, eax
jne 0x40da2b
push dword [ebp - 0x448]
push 0x200
push 1
push 0x463c70
call fcn.0042a2f8
add esp, 0x10
cmp eax, 0x200
jne 0x40da2b
mov ecx, 0x463c70
call fcn.00404610
movups xmm0, xmmword [esi]
xor eax, eax
push 0x200
movups xmmword [ebp - 0x474], xmm0
push eax
movq xmm0, qword [esi + 0x10]
movq qword [ebp - 0x464], xmm0
mov dword [ebp - 0x466], eax
mov word [ebp - 0x462], ax
mov dword [ebp - 0x470], eax
lea eax, [ebp - 0x240]
push eax
mov byte [ebp - 0x473], 0
call fcn.00427180
movzx eax, word [0x463c70]
add esp, 0xc
mov dword [ebp - 0x47c], eax
mov ecx, 0x461e1c
lea eax, [ebp - 0x40]
push eax
call fcn.0040dc40
push 0x45b87c
lea ecx, [ebp - 0x40]
mov dword [ebp - 4], edi
call fcn.0040dbc0
lea eax, [ebp - 0x498]
mov ecx, 0x461e1c
push eax
call fcn.0040a210
push eax
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 1
call fcn.0040bae0
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x484]
cmp edx, 8
jb 0x40d2ca
mov ecx, dword [ebp - 0x498]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40d2c0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40da59
push edx
push ecx
call fcn.00424e9e
add esp, 8
push 0x461e1c
lea ecx, [ebp - 0x28]
call fcn.004028b0
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x28]
call fcn.0040a770
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push 0x4596dc
cmovae eax, dword [ebp - 0x28]
push eax
call fcn.00429d4a
mov esi, eax
add esp, 8
mov dword [ebp - 0x450], esi
test esi, esi
jne 0x40d3b8
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
push 0x45b708
call fcn.0040b710
mov edx, dword [ebp - 0x14]
add esp, 8
cmp edx, 8
jb 0x40d363
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40d359
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40da5e
push edx
push ecx
call fcn.00424e9e
add esp, 8
mov edx, dword [ebp - 0x2c]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
cmp edx, 8
jb 0x40d3b1
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40d3a7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40da63
push edx
push ecx
call fcn.00424e9e
add esp, 8
xor al, al
jmp 0x40da3e
cmp byte [ebp - 0x474], 0
je 0x40d461
lea ecx, [ebp - 0x498]
call fcn.00404430
push ecx
push eax
lea edx, [ebp - 0x440]
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x474]
call fcn.00404760
mov edx, dword [ebp - 0x484]
add esp, 8
cmp edx, 8
jb 0x40d42a
mov ecx, dword [ebp - 0x498]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40d420
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40da68
push edx
push ecx
call fcn.00424e9e
add esp, 8
push esi
push 0x200
lea eax, [ebp - 0x440]
push 1
push eax
call fcn.0042a661
add esp, 0x10
cmp eax, 0x200
je 0x40d461
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
push 0x45b740
call fcn.0040b710
add esp, 8
movzx eax, word [ebp - 0x468]
lea edx, [ebp - 0x474]
push eax
mov ecx, esi
call fcn.00407d30
mov edx, dword [ebp - 0x458]
xor esi, esi
add esp, 4
cmp dword [edx + 4], esi
jle 0x40d975
mov eax, dword [ebp - 0x464]
mov dword [ebp - 0x45c], eax
mov eax, dword [ebp - 0x466]
mov dword [ebp - 0x454], eax
nop dword [eax]
nop word [eax + eax]
movzx ecx, word [esi*4 + 0x463c78]
movzx eax, word [esi*4 + 0x463c76]
shl ecx, 0x10
or ecx, eax
xor eax, eax
cmp byte [edx], al
push 0
setne al
mov dword [ebp - 0x478], ecx
add eax, ecx
shl eax, 9
push eax
push dword [ebp - 0x448]
call fcn.0042a111
add esp, 0xc
test eax, eax
jne 0x40d73b
push dword [ebp - 0x448]
lea eax, [ebp - 0x440]
push 0x200
push 1
push eax
call fcn.0042a2f8
add esp, 0x10
cmp eax, 0x200
jne 0x40d733
lea ecx, [ebp - 0x440]
call fcn.00404610
mov al, byte [ebp - 0x43c]
mov byte [ebp - 0x441], al
movzx eax, word [ebp - 0x43e]
push eax
push dword [ebp - 0x478]
mov dword [ebp - 0x480], eax
movzx eax, byte [ebp - 0x440]
add eax, 0x41
push eax
push esi
push str.part__d::__c:_lba___ld_tlen___d_t
call fcn.0040b710
movzx eax, word [ebp - 0x436]
push eax
movzx eax, word [ebp - 0x438]
push eax
movzx eax, word [ebp - 0x43a]
push eax
push str.ldr_06o_bpar_06o_pg_06o__
call fcn.0040b710
mov al, byte [ebp - 0x441]
add esp, 0x24
test al, 1
je 0x40d59a
push str.BAD
call fcn.0040b710
mov al, byte [ebp - 0x441]
add esp, 4
mov cl, al
and cl, 2
mov byte [ebp - 0x443], cl
je 0x40d5c0
push 0x459d38
call fcn.0040b710
mov al, byte [ebp - 0x441]
add esp, 4
mov cl, byte [ebp - 0x443]
test cl, cl
setne byte [ebp - 0x443]
test al, 4
je 0x40d5e0
push 0x459d40
call fcn.0040b710
mov al, byte [ebp - 0x441]
add esp, 4
test al, 8
je 0x40d5fe
push str.FWP
call fcn.0040b710
mov al, byte [ebp - 0x441]
add esp, 4
mov byte [ebp - 0x443], 1
test al, 0x10
je 0x40d60f
push str.FRP
call fcn.0040b710
add esp, 4
push 0x459d60
call fcn.0040b710
mov ax, word [ebp - 0x466]
mov ecx, 0x800
add esp, 4
cmp ax, cx
jae 0x40d762
movzx ecx, word [ebp - 0x46a]
movzx eax, ax
imul ecx, eax
movzx eax, word [ebp - 0x464]
push dword [ebp - 0x480]
add ecx, eax
movzx eax, word [ebp - 0x468]
imul ecx, eax
mov eax, dword [ebp - 0x454]
shl eax, 4
mov dword [ebp - 0x478], ecx
mov ecx, dword [ebp - 0x45c]
and ecx, 0xf
or ecx, eax
cmp byte [ebp - 0x443], 0
mov eax, ecx
not eax
movzx edx, ax
movzx eax, cx
mov ecx, dword [ebp - 0x470]
cmove edx, eax
lea eax, [ecx*4]
lea ecx, [ebp - 0x4a]
sub ecx, eax
lea eax, [ebp - 0x474]
push eax
mov word [ecx], dx
mov edx, dword [ebp - 0x450]
mov ecx, dword [ebp - 0x448]
call fcn.0040da80
add esp, 8
test al, al
jne 0x40d6ce
push esi
push 0x459b44
call fcn.0040b710
add esp, 8
inc edi
mov dword [ebp - 0x44c], edi
mov ecx, dword [ebp - 0x450]
lea edx, [ebp - 0x474]
push 0
call fcn.00407d30
mov edx, dword [ebp - 0x46a]
add esp, 4
mov ecx, dword [ebp - 0x470]
mov byte [ebp - 0x442], al
mov eax, dword [ebp - 0x466]
imul edx, eax
mov dword [ebp - 0x454], eax
mov eax, dword [ebp - 0x464]
mov dword [ebp - 0x45c], eax
shl ecx, 2
add edx, eax
lea eax, [ebp - 0x4c]
imul edx, dword [ebp - 0x468]
sub eax, ecx
sub edx, dword [ebp - 0x478]
inc dword [ebp - 0x470]
mov word [eax], dx
jmp 0x40d750
push esi
push 0x459d68
jmp 0x40d741
push esi
push 0x459dc0
call fcn.0040b710
add esp, 8
inc edi
mov dword [ebp - 0x44c], edi
mov edx, dword [ebp - 0x458]
inc esi
cmp esi, dword [edx + 4]
jl 0x40d4b0
jmp 0x40d77c
push 0x45a0d0
call fcn.0040b710
mov edx, dword [ebp - 0x458]
add esp, 4
inc edi
mov dword [ebp - 0x44c], edi
cmp byte [ebp - 0x442], 0
je 0x40d975
mov esi, dword [ebp - 0x450]
lea edx, [ebp - 0x474]
mov ecx, esi
mov dword [ebp - 0x448], 0
mov dword [ebp - 0x454], 0
call fcn.00407e70
movzx eax, word [ebp - 0x46c]
xor edi, edi
mov ecx, dword [ebp - 0x47c]
mov word [ebp - 0x42], ax
movzx eax, byte [ebp - 0x46a]
mov word [ebp - 0x44], ax
movzx eax, word [ebp - 0x468]
shl ecx, 8
mov word [ebp - 0x46], ax
mov eax, dword [ebp - 0x470]
or ecx, eax
mov word [ebp - 0x48], cx
mov dword [ebp - 0x45c], 0x15c1
lea ecx, [eax*2 + 4]
mov dword [ebp - 0x47c], ecx
cmp ecx, 2
jl 0x40d84a
mov dx, word [ebp - 0x454]
lea eax, [ebp - 0x44]
mov si, word [ebp - 0x448]
add ecx, 0xfffffffe
shr ecx, 1
inc ecx
lea edi, [ecx + ecx]
nop
add si, word [eax + 2]
lea eax, [eax - 4]
add dx, word [eax + 4]
sub ecx, 1
jne 0x40d820
mov ecx, dword [ebp - 0x47c]
mov word [ebp - 0x448], si
mov esi, dword [ebp - 0x450]
mov word [ebp - 0x454], dx
cmp edi, ecx
jge 0x40d867
lea eax, [edi + edi]
lea ecx, [ebp - 0x42]
sub ecx, eax
mov eax, 0x15c1
add ax, word [ecx]
movzx eax, ax
mov dword [ebp - 0x45c], eax
mov eax, dword [ebp - 0x470]
lea ecx, [ebp - 0x4a]
mov edx, dword [ebp - 0x448]
add edx, dword [ebp - 0x454]
add edx, dword [ebp - 0x45c]
shl eax, 2
sub ecx, eax
mov eax, 0xe00
cmp byte [ebp - 0x474], 0
push 0
mov word [ecx], dx
mov ecx, 0x1000
cmovne eax, ecx
push eax
push esi
call fcn.0042a111
lea ecx, [ebp - 0x240]
call fcn.00404610
push esi
push 0x200
lea eax, [ebp - 0x240]
push 1
push eax
call fcn.0042a661
add esp, 0x1c
cmp eax, 0x200
je 0x40d8f0
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
push 0x45b794
call fcn.0040b710
add esp, 8
mov byte [ebp - 0x442], 0
xor eax, eax
mov ecx, 0x200
cmp byte [ebp - 0x474], al
push 0
cmovne eax, ecx
push eax
push esi
call fcn.0042a111
mov ecx, 0x80
lea edi, [ebp - 0x240]
mov esi, 0x4619e0
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebp - 0x240]
call fcn.00404610
push dword [ebp - 0x450]
lea eax, [ebp - 0x240]
push 0x200
push 1
push eax
call fcn.0042a661
add esp, 0x1c
cmp eax, 0x200
je 0x40d969
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
cmovae eax, dword [ebp - 0x28]
push eax
push 0x45b794
call fcn.0040b710
add esp, 8
mov byte [ebp - 0x442], 0
mov edx, dword [ebp - 0x458]
mov edi, dword [ebp - 0x44c]
mov eax, dword [edx + 4]
sub eax, edi
push eax
push 0x45b7c8
call fcn.0040b710
push dword [ebp - 0x450]
call fcn.00429dd7
add esp, 0xc
test edi, edi
je 0x40d9a5
push edi
push 0x459c10
call fcn.0040b710
add esp, 8
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x40d9df
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40d9d5
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40da6d
push edx
push ecx
call fcn.00424e9e
add esp, 8
mov edx, dword [ebp - 0x2c]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
cmp edx, 8
jb 0x40da38
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40da1f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40da72
push edx
push ecx
call fcn.00424e9e
add esp, 8
jmp 0x40da38
push 0x45b890
call fcn.0040b710
add esp, 4
mov al, byte [ebp - 0x442]
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.00424e8d
mov esp, ebp
pop ebp
ret
call fcn.00429c39
call fcn.00429c39
call fcn.00429c39
call fcn.00429c39
call fcn.00429c39
call fcn.00429c39
int3