Function at 0x40c740
Capabilities:
Extract resource via kernel32 functions
Get common file path
Set current directory
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x45ca70
mov eax, dword fs:[0]
push eax
sub esp, 0x218
mov eax, dword [0x47ca80]
xor eax, ebp
mov dword [ebp - 0x24], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x224], ecx
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x13c], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x134], 0xffffffff
mov byte [ebp - 0x135], 0
mov dword [ebp - 0x14c], 0
push 0x462a03
lea ecx, [ebp - 0x130]
call fcn.00402fd0
mov dword [ebp - 4], 0
lea eax, [ebp - 0x130]
push eax
mov ecx, dword [ebp - 0x224]
call fcn.0040c6d0
lea ecx, [ebp - 0x130]
push ecx
lea ecx, [ebp - 0x148]
call fcn.00402fb0
mov byte [ebp - 4], 1
mov byte [ebp - 0x12c], 0
push 0x103
push 0
lea edx, [ebp - 0x12b]
push edx
call fcn.00440170
add esp, 0xc
lea eax, [ebp - 0x12c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push 0x462cfc
lea ecx, [ebp - 0x130]
call fcn.0040a0b0
lea ecx, [ebp - 0x130]
push ecx
lea ecx, [ebp - 0x20]
call fcn.00402fb0
mov byte [ebp - 4], 2
push 0x1000
call dword [sym.imp.USER32.dll_GetSystemMetrics]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40c8b0
push str.EDPEDISK:Remote_Login_Used__n
push 0
push 0x157
push 0x462d30
push 0x462d44
call fcn.0040b8f0
add esp, 0x14
mov byte [ebp - 0x211], 0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x20]
call fcn.00403050
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x148]
call fcn.00403050
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x130]
call fcn.00403050
mov al, byte [ebp - 0x211]
jmp 0x40cc68
lea ecx, [ebp - 0x140]
call fcn.00402f90
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x20]
push edx
push str.EDPEDISK.EXE:__s_Free_DLL_File
lea eax, [ebp - 0x140]
push eax
call fcn.00404400
add esp, 0xc
push 0
lea ecx, [ebp - 0x140]
call fcn.00403140
push eax
push 0
push 0x15e
push 0x462d8c
push 0x462da0
call fcn.0040b8f0
add esp, 0x14
mov dword [ebp - 0x1c], 0
push 0
push 0x80
push 4
push 0
push 0
push 0x1f01ff
lea ecx, [ebp - 0x20]
call fcn.00403130
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x134], eax
cmp dword [ebp - 0x134], 0xffffffff
jne 0x40c9d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x150], eax
mov ecx, dword [ebp - 0x150]
push ecx
push str.EDPEDISK.EXE:Free_DLL_File_Fail__LastError___u
lea edx, [ebp - 0x140]
push edx
call fcn.00404400
add esp, 0xc
push 0
lea ecx, [ebp - 0x140]
call fcn.00403140
push eax
push 0
push 0x166
push 0x462df8
push 0x462e0c
call fcn.0040b8f0
add esp, 0x14
mov byte [ebp - 0x212], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x140]
call fcn.00403050
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x20]
call fcn.00403050
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x148]
call fcn.00403050
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x130]
call fcn.00403050
mov al, byte [ebp - 0x212]
jmp 0x40cc68
push 0
push 0
push 0
mov eax, dword [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 0x134]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0x462e34
push 0xbb
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [ebp - 0x144], eax
cmp dword [ebp - 0x144], 0
jne 0x40ca22
mov byte [ebp - 0x135], 0
jmp 0x40cbb1
mov edx, dword [ebp - 0x144]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
ja 0x40ca46
mov byte [ebp - 0x135], 0
jmp 0x40cbb1
mov eax, dword [ebp - 0x144]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x13c], eax
cmp dword [ebp - 0x13c], 0
jne 0x40ca70
mov byte [ebp - 0x135], 0
jmp 0x40cbb1
mov ecx, dword [ebp - 0x13c]
push ecx
call dword [sym.imp.KERNEL32.dll_LockResource]
mov dword [ebp - 0x10], eax
lea ecx, [ebp - 0x148]
call fcn.00403130
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov edx, dword [ebp - 0x14]
sub edx, 0xaa
mov dword [ebp - 0x14], edx
push 0xaa
mov eax, dword [ebp - 0x10]
push eax
push 0xaa
lea ecx, [ebp - 0x20c]
push ecx
call fcn.00440689
add esp, 0x10
mov edx, dword [ebp - 0x20c]
add edx, 1
push edx
call fcn.004222b4
add esp, 4
mov dword [ebp - 0x218], eax
mov eax, dword [ebp - 0x218]
mov dword [ebp - 0x154], eax
push 0
mov ecx, dword [ebp - 0x20c]
add ecx, 1
push ecx
push 0
mov edx, dword [ebp - 0x154]
push edx
call fcn.004108c0
add esp, 0x10
mov eax, dword [ebp - 0x10]
add eax, 0xaa
mov dword [ebp - 0x15c], eax
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x158], ecx
mov edx, dword [ebp - 0x20c]
mov dword [ebp - 0x210], edx
mov eax, dword [ebp - 0x158]
push eax
mov ecx, dword [ebp - 0x15c]
push ecx
lea edx, [ebp - 0x210]
push edx
mov eax, dword [ebp - 0x154]
push eax
call fcn.00458eb0
add esp, 0x10
push 0
lea ecx, [ebp - 0x14c]
push ecx
mov edx, dword [ebp - 0x210]
push edx
mov eax, dword [ebp - 0x154]
push eax
mov ecx, dword [ebp - 0x134]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub eax, 1
neg eax
sbb eax, eax
add eax, 1
mov byte [ebp - 0x135], al
mov edx, dword [ebp - 0x154]
mov dword [ebp - 0x21c], edx
mov eax, dword [ebp - 0x21c]
push eax
call fcn.004222a9
add esp, 4
mov dword [ebp - 0x154], 0
lea ecx, [ebp - 0x12c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
xor edx, edx
jne 0x40c9f5
cmp dword [ebp - 0x134], 0xffffffff
je 0x40cbd1
mov eax, dword [ebp - 0x134]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x134], 0xffffffff
cmp dword [ebp - 0x13c], 0
je 0x40cbf1
mov ecx, dword [ebp - 0x13c]
push ecx
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov dword [ebp - 0x13c], 0
movzx edx, byte [ebp - 0x135]
test edx, edx
je 0x40cc1a
push str.EDPEDISK.EXE:Free_EdpEDiskCtrlDll_File_Ok
push 0
push 0x1b7
push 0x462e70
push str.CEdpSecDiskAppApp::CopyEdpEDiskCtrlDll
call fcn.0040b8f0
add esp, 0x14
mov al, byte [ebp - 0x135]
mov byte [ebp - 0x21d], al
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x140]
call fcn.00403050
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x20]
call fcn.00403050
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x148]
call fcn.00403050
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x130]
call fcn.00403050
mov al, byte [ebp - 0x21d]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x24]
xor ecx, ebp
call fcn.00440160
mov esp, ebp
pop ebp
ret